-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84fccb9
commit 12e7866
Showing
20 changed files
with
133 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,7 @@ content | |
hugo/resources | ||
hugo_stats.json | ||
|
||
.wgd-directory.yaml | ||
.tree.json | ||
.wgd-local-links.csv | ||
.wgd-local-log.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {MarkdownNodes} from '../MarkdownNodes.ts'; | ||
import {walkRecursiveSync} from '../markdownNodesUtils.ts'; | ||
import {replaceUrlsWithIds} from '../../utils/idParsers.ts'; | ||
|
||
export function convertGoogleUrls(markdownChunks: MarkdownNodes) { | ||
walkRecursiveSync(markdownChunks.body, (chunk) => { | ||
if ('text' in chunk) { | ||
chunk.text = replaceUrlsWithIds(chunk.text); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {MarkdownNodes} from '../MarkdownNodes.ts'; | ||
import {extractText, walkRecursiveSync} from '../markdownNodesUtils.ts'; | ||
|
||
export function fixIdLinks(markdownChunks: MarkdownNodes) { | ||
let inHtml = false; | ||
walkRecursiveSync(markdownChunks.body, (chunk) => { | ||
if (chunk.isTag && chunk.tag === 'HTML_MODE/') { | ||
inHtml = true; | ||
return; | ||
} | ||
|
||
if (inHtml) { | ||
return; | ||
} | ||
|
||
if (chunk.isTag && 'A' === chunk.tag) { | ||
if (chunk.payload?.href && chunk.payload?.href.startsWith('#')) { | ||
const innerTxt = extractText(chunk); | ||
const escapedText = innerTxt.toLowerCase().replace(/[^\w]+/g, ' ').trim().replaceAll(' ', '-'); | ||
if (escapedText) { | ||
chunk.payload.href = '#' + escapedText; | ||
} | ||
} | ||
} | ||
}, {}, (chunk) => { | ||
if (chunk.isTag && chunk.tag === 'HTML_MODE/') { | ||
inHtml = false; | ||
return; | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<html> | ||
<head> | ||
<meta content="text/html; charset=UTF-8" http-equiv="content-type" /> | ||
<style> | ||
.code { font-family: Courier, serif; } | ||
</style> | ||
</head> | ||
<body> | ||
<h1 id="developer-guide">Developer Guide</h1> | ||
<p>See <a href="#node-setup-on-the-system">Node setup on the system</a> for prereq.</p><br /> | ||
<p><a href="https://drive.google.com/open?id=0AIkOKXbzWCtSUk9PVA">Example Google Drive Shared Folder</a></p><br /> | ||
<h1 id="node-setup-on-the-system">Node setup on the system</h1> | ||
<h2 id="using-os">using OS</h2> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Developer Guide | ||
|
||
See [Node setup on the system](#node-setup-on-the-system) for prereq. | ||
|
||
[Example Google Drive Shared Folder](https://drive.google.com/open?id=0AIkOKXbzWCtSUk9PVA) | ||
|
||
# Node setup on the system | ||
|
||
## using OS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Developer Guide | ||
|
||
See [Node setup on the system](#node-setup-on-the-system) for prereq. | ||
|
||
[Example Google Drive Shared Folder](gdoc:0AIkOKXbzWCtSUk9PVA) | ||
|
||
# Node setup on the system | ||
|
||
## using OS | ||
|
||
``` | ||
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash - | ||
sudo apt install nodejs | ||
``` |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters