-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better parsing & linking, snippeting
- Loading branch information
1 parent
a3ce298
commit 74a3984
Showing
66 changed files
with
937 additions
and
389 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
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 @@ | ||
import { fromJs } from 'esast-util-from-js'; | ||
|
||
import { lang } from '../../utils.js'; | ||
|
||
export const jsast = ({ text = '', title = '' }) => { | ||
const type = lang(title) === 'mjs' ? 'module' : 'script'; | ||
|
||
try { | ||
return type === 'module' ? fromJs(text, { module: true }) : fromJs(text); | ||
} catch (_) { | ||
// can ignore syntactically incorrect snippets | ||
return null; | ||
} | ||
}; |
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 |
---|---|---|
@@ -1 +1,19 @@ | ||
export const txt = (obj) => obj; | ||
import { staticLabels } from '../utils.js'; | ||
|
||
export const txt = ({ text = '' }) => { | ||
const forelinks = [ | ||
...staticLabels({ | ||
text, | ||
begin: /(\()[\s]*see[\s]*:/gi, | ||
end: /(\))/gi, | ||
}), | ||
]; | ||
|
||
const tags = staticLabels({ | ||
text, | ||
begin: /(\()[\s]*tags[\s]*:/gi, | ||
end: /(\))/gi, | ||
}); | ||
|
||
return { text, forelinks, tags }; | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"--port": 3456, | ||
"-no-open": true, | ||
"study": { | ||
"save": true | ||
} | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.