crossnote 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +17 -0
- package/README.md +289 -0
- package/out/cjs/index.cjs +595 -0
- package/out/dependencies/README.md +26 -0
- package/out/dependencies/electron-webview/preload.js +29 -0
- package/out/dependencies/font-awesome/css/font-awesome.min.css +4 -0
- package/out/dependencies/font-awesome/fonts/FontAwesome.otf +0 -0
- package/out/dependencies/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/out/dependencies/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
- package/out/dependencies/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/out/dependencies/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/out/dependencies/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/out/dependencies/jquery/jquery.js +4 -0
- package/out/dependencies/jquery-contextmenu/font/context-menu-icons.eot +0 -0
- package/out/dependencies/jquery-contextmenu/font/context-menu-icons.ttf +0 -0
- package/out/dependencies/jquery-contextmenu/font/context-menu-icons.woff +0 -0
- package/out/dependencies/jquery-contextmenu/font/context-menu-icons.woff2 +0 -0
- package/out/dependencies/jquery-contextmenu/jquery.contextMenu.min.css +16 -0
- package/out/dependencies/jquery-contextmenu/jquery.contextMenu.min.js +2 -0
- package/out/dependencies/jquery-contextmenu/jquery.ui.position.min.js +6 -0
- package/out/dependencies/jquery-modal/jquery.modal.min.css +1 -0
- package/out/dependencies/jquery-modal/jquery.modal.min.js +5 -0
- package/out/dependencies/katex/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Bold.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Italic.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Math-Italic.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Script-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/out/dependencies/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/out/dependencies/katex/katex.min.css +1 -0
- package/out/dependencies/mermaid/mermaid.min.js +1642 -0
- package/out/dependencies/remarkable/remarkable.js +4 -0
- package/out/dependencies/reveal/css/print/paper.css +203 -0
- package/out/dependencies/reveal/css/print/pdf.css +164 -0
- package/out/dependencies/reveal/css/reveal.css +8 -0
- package/out/dependencies/reveal/css/theme/README.md +21 -0
- package/out/dependencies/reveal/css/theme/beige.css +301 -0
- package/out/dependencies/reveal/css/theme/black.css +294 -0
- package/out/dependencies/reveal/css/theme/blood.css +323 -0
- package/out/dependencies/reveal/css/theme/league.css +303 -0
- package/out/dependencies/reveal/css/theme/moon.css +301 -0
- package/out/dependencies/reveal/css/theme/night.css +295 -0
- package/out/dependencies/reveal/css/theme/none.css +1 -0
- package/out/dependencies/reveal/css/theme/serif.css +297 -0
- package/out/dependencies/reveal/css/theme/simple.css +297 -0
- package/out/dependencies/reveal/css/theme/sky.css +304 -0
- package/out/dependencies/reveal/css/theme/solarized.css +298 -0
- package/out/dependencies/reveal/css/theme/white.css +294 -0
- package/out/dependencies/reveal/js/reveal.js +9 -0
- package/out/dependencies/reveal/lib/css/zenburn.css +80 -0
- package/out/dependencies/reveal/lib/font/league-gothic/LICENSE +2 -0
- package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.css +10 -0
- package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.eot +0 -0
- package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.ttf +0 -0
- package/out/dependencies/reveal/lib/font/league-gothic/league-gothic.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/LICENSE +45 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
- package/out/dependencies/reveal/lib/font/source-sans-pro/source-sans-pro.css +39 -0
- package/out/dependencies/reveal/lib/js/classList.js +2 -0
- package/out/dependencies/reveal/lib/js/head.min.js +6 -0
- package/out/dependencies/reveal/lib/js/html5shiv.js +7 -0
- package/out/dependencies/reveal/plugin/highlight/highlight.js +77 -0
- package/out/dependencies/reveal/plugin/markdown/example.html +136 -0
- package/out/dependencies/reveal/plugin/markdown/example.md +36 -0
- package/out/dependencies/reveal/plugin/markdown/markdown.js +412 -0
- package/out/dependencies/reveal/plugin/markdown/marked.js +6 -0
- package/out/dependencies/reveal/plugin/math/math.js +67 -0
- package/out/dependencies/reveal/plugin/multiplex/client.js +13 -0
- package/out/dependencies/reveal/plugin/multiplex/index.js +64 -0
- package/out/dependencies/reveal/plugin/multiplex/master.js +34 -0
- package/out/dependencies/reveal/plugin/multiplex/package.json +19 -0
- package/out/dependencies/reveal/plugin/notes/notes.html +792 -0
- package/out/dependencies/reveal/plugin/notes/notes.js +147 -0
- package/out/dependencies/reveal/plugin/notes-server/client.js +65 -0
- package/out/dependencies/reveal/plugin/notes-server/index.js +69 -0
- package/out/dependencies/reveal/plugin/notes-server/notes.html +585 -0
- package/out/dependencies/reveal/plugin/print-pdf/print-pdf.js +67 -0
- package/out/dependencies/reveal/plugin/search/search.js +206 -0
- package/out/dependencies/reveal/plugin/zoom-js/zoom.js +272 -0
- package/out/dependencies/vega-embed/vega-embed.min.js +7 -0
- package/out/dependencies/wavedrom/default.js +3 -0
- package/out/dependencies/wavedrom/wavedrom.min.js +14 -0
- package/out/esm/index.mjs +595 -0
- package/out/styles/loading.css +1 -0
- package/out/styles/markdown-it-admonition.css +1 -0
- package/out/styles/octocat-spinner-128.gif +0 -0
- package/out/styles/preview.css +1 -0
- package/out/styles/preview_theme/atom-dark.css +1 -0
- package/out/styles/preview_theme/atom-light.css +1 -0
- package/out/styles/preview_theme/atom-material.css +1 -0
- package/out/styles/preview_theme/github-dark.css +1 -0
- package/out/styles/preview_theme/github-light.css +1 -0
- package/out/styles/preview_theme/github.css +0 -0
- package/out/styles/preview_theme/gothic.css +1 -0
- package/out/styles/preview_theme/medium.css +1 -0
- package/out/styles/preview_theme/monokai.css +1 -0
- package/out/styles/preview_theme/newsprint.css +1 -0
- package/out/styles/preview_theme/night.css +1 -0
- package/out/styles/preview_theme/none.css +0 -0
- package/out/styles/preview_theme/one-dark.css +1 -0
- package/out/styles/preview_theme/one-light.css +1 -0
- package/out/styles/preview_theme/solarized-dark.css +1 -0
- package/out/styles/preview_theme/solarized-light.css +1 -0
- package/out/styles/preview_theme/vue.css +1 -0
- package/out/styles/prism_theme/atom-dark.css +1 -0
- package/out/styles/prism_theme/atom-light.css +1 -0
- package/out/styles/prism_theme/atom-material.css +1 -0
- package/out/styles/prism_theme/coy.css +1 -0
- package/out/styles/prism_theme/darcula.css +1 -0
- package/out/styles/prism_theme/dark.css +1 -0
- package/out/styles/prism_theme/default.css +1 -0
- package/out/styles/prism_theme/funky.css +1 -0
- package/out/styles/prism_theme/github.css +1 -0
- package/out/styles/prism_theme/hopscotch.css +1 -0
- package/out/styles/prism_theme/monokai.css +1 -0
- package/out/styles/prism_theme/okaidia.css +1 -0
- package/out/styles/prism_theme/one-dark.css +1 -0
- package/out/styles/prism_theme/one-light.css +1 -0
- package/out/styles/prism_theme/pen-paper-coffee.css +1 -0
- package/out/styles/prism_theme/pojoaque.css +1 -0
- package/out/styles/prism_theme/solarized-dark.css +1 -0
- package/out/styles/prism_theme/solarized-light.css +1 -0
- package/out/styles/prism_theme/twilight.css +1 -0
- package/out/styles/prism_theme/vs.css +1 -0
- package/out/styles/prism_theme/vue.css +1 -0
- package/out/styles/prism_theme/xonokai.css +1 -0
- package/out/styles/style-template.css +1 -0
- package/out/styles/twemoji.css +1 -0
- package/out/types/src/code-chunk/code-chunk-data.d.ts +14 -0
- package/out/types/src/code-chunk/code-chunk.d.ts +3 -0
- package/out/types/src/converters/ebook-convert.d.ts +1 -0
- package/out/types/src/converters/markdown-convert.d.ts +26 -0
- package/out/types/src/converters/pandoc-convert.d.ts +26 -0
- package/out/types/src/converters/prince-convert.d.ts +1 -0
- package/out/types/src/converters/process-graphs.d.ts +22 -0
- package/out/types/src/custom-markdown-it-features/admonition.d.ts +3 -0
- package/out/types/src/custom-markdown-it-features/code-fences.d.ts +3 -0
- package/out/types/src/custom-markdown-it-features/critic-markup.d.ts +4 -0
- package/out/types/src/custom-markdown-it-features/emoji.d.ts +4 -0
- package/out/types/src/custom-markdown-it-features/html5-embed.d.ts +4 -0
- package/out/types/src/custom-markdown-it-features/math.d.ts +4 -0
- package/out/types/src/custom-markdown-it-features/wikilink.d.ts +4 -0
- package/out/types/src/index.d.ts +13 -0
- package/out/types/src/lib/block-attributes/index.d.ts +4 -0
- package/out/types/src/lib/block-attributes/normalizeBlockAttributes.d.ts +2 -0
- package/out/types/src/lib/block-attributes/parseBlockAttributes.d.ts +2 -0
- package/out/types/src/lib/block-attributes/stringifyBlockAttributes.d.ts +2 -0
- package/out/types/src/lib/block-attributes/types.d.ts +3 -0
- package/out/types/src/lib/block-info/index.d.ts +3 -0
- package/out/types/src/lib/block-info/normalizeBlockInfo.d.ts +2 -0
- package/out/types/src/lib/block-info/parseBlockInfo.d.ts +2 -0
- package/out/types/src/lib/block-info/types.d.ts +6 -0
- package/out/types/src/lib/compute-checksum.d.ts +3 -0
- package/out/types/src/markdown-engine/custom-subjects.d.ts +11 -0
- package/out/types/src/markdown-engine/extension-helper.d.ts +1 -0
- package/out/types/src/markdown-engine/heading-id-generator.d.ts +5 -0
- package/out/types/src/markdown-engine/index.d.ts +108 -0
- package/out/types/src/markdown-engine/toc.d.ts +18 -0
- package/out/types/src/markdown-engine/transformer.d.ts +28 -0
- package/out/types/src/notebook/config-helper.d.ts +16 -0
- package/out/types/src/notebook/graph-view.d.ts +15 -0
- package/out/types/src/notebook/index.d.ts +53 -0
- package/out/types/src/notebook/markdown.d.ts +11 -0
- package/out/types/src/notebook/note.d.ts +25 -0
- package/out/types/src/notebook/reference.d.ts +22 -0
- package/out/types/src/notebook/search.d.ts +18 -0
- package/out/types/src/notebook/slash.d.ts +1 -0
- package/out/types/src/notebook/types.d.ts +91 -0
- package/out/types/src/prism/iele.d.ts +1 -0
- package/out/types/src/prism/k.d.ts +1 -0
- package/out/types/src/render-enhancers/code-block-styling.d.ts +2 -0
- package/out/types/src/render-enhancers/embedded-local-images.d.ts +3 -0
- package/out/types/src/render-enhancers/embedded-svgs.d.ts +3 -0
- package/out/types/src/render-enhancers/extended-table-syntax.d.ts +2 -0
- package/out/types/src/render-enhancers/fenced-code-chunks.d.ts +19 -0
- package/out/types/src/render-enhancers/fenced-diagrams.d.ts +12 -0
- package/out/types/src/render-enhancers/fenced-math.d.ts +3 -0
- package/out/types/src/render-enhancers/resolved-image-paths.d.ts +2 -0
- package/out/types/src/renderers/parse-math.d.ts +13 -0
- package/out/types/src/renderers/puml-server.d.ts +5 -0
- package/out/types/src/renderers/puml.d.ts +6 -0
- package/out/types/src/renderers/vega-lite.d.ts +1 -0
- package/out/types/src/renderers/vega.d.ts +1 -0
- package/out/types/src/renderers/viz.d.ts +2 -0
- package/out/types/src/tools/image-uploader.d.ts +9 -0
- package/out/types/src/tools/latex.d.ts +8 -0
- package/out/types/src/tools/magick.d.ts +1 -0
- package/out/types/src/tools/mermaid.d.ts +1 -0
- package/out/types/src/tools/pdf.d.ts +7 -0
- package/out/types/src/tools/wavedrom.d.ts +1 -0
- package/out/types/src/utility.d.ts +27 -0
- package/out/types/src/webview/webview.d.ts +1 -0
- package/out/types/test/header-id-generator.test.d.ts +1 -0
- package/out/types/test/lib/attributes.test.d.ts +1 -0
- package/out/types/test/lib/block-info.test.d.ts +1 -0
- package/out/types/tsconfig.tsbuildinfo +1 -0
- package/out/webview/index.js +22 -0
- package/package.json +127 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
University of Illinois/NCSA
|
|
2
|
+
Open Source License
|
|
3
|
+
|
|
4
|
+
```
|
|
5
|
+
Copyright (c) 2017 Yiyi Wang
|
|
6
|
+
All rights reserved.
|
|
7
|
+
|
|
8
|
+
Developed by: Yiyi Wang
|
|
9
|
+
https://github.com/shd101wyy/mume
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
|
|
15
|
+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution.
|
|
16
|
+
Neither the names of Yiyi Wang, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# MUME
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/shd101wyy/mume)
|
|
4
|
+
|
|
5
|
+
This library powers:
|
|
6
|
+
|
|
7
|
+
- [markdown preview enhanced for atom](https://github.com/shd101wyy/markdown-preview-enhanced)
|
|
8
|
+
- [markdown preview enhanced for vscode](https://github.com/shd101wyy/vscode-markdown-preview-enhanced)
|
|
9
|
+
|
|
10
|
+
and other external projects such as:
|
|
11
|
+
|
|
12
|
+
- [TechnicalMarkdown](https://github.com/gabyx/TechnicalMarkdown) up to commit 13856d37030483679
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install --save @shd101wyy/mume
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
// CJS
|
|
24
|
+
const path = require('path');
|
|
25
|
+
const mume = require('@shd101wyy/mume');
|
|
26
|
+
|
|
27
|
+
// ESM
|
|
28
|
+
// import * as mume from "@shd101wyy/mume"
|
|
29
|
+
|
|
30
|
+
async function main() {
|
|
31
|
+
const configPath = path.resolve(os.tmpdir(), '.mume');
|
|
32
|
+
|
|
33
|
+
// if no configPath is specified, the default is "~/.config/mume"
|
|
34
|
+
// but only if the old location (~/.mume) does not exist
|
|
35
|
+
await mume.init(configPath);
|
|
36
|
+
|
|
37
|
+
const engine = new mume.MarkdownEngine({
|
|
38
|
+
filePath: '/Users/wangyiyi/Desktop/markdown-example/test3.md',
|
|
39
|
+
config: {
|
|
40
|
+
configPath: configPath,
|
|
41
|
+
previewTheme: 'github-light.css',
|
|
42
|
+
// revealjsTheme: "white.css"
|
|
43
|
+
codeBlockTheme: 'default.css',
|
|
44
|
+
printBackground: true,
|
|
45
|
+
enableScriptExecution: true, // <= for running code chunks
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// open in browser
|
|
50
|
+
await engine.openInBrowser({ runAllCodeChunks: true });
|
|
51
|
+
|
|
52
|
+
// html export
|
|
53
|
+
await engine.htmlExport({ offline: false, runAllCodeChunks: true });
|
|
54
|
+
|
|
55
|
+
// chrome (puppeteer) export
|
|
56
|
+
await engine.chromeExport({ fileType: 'pdf', runAllCodeChunks: true }); // fileType = 'pdf'|'png'|'jpeg'
|
|
57
|
+
|
|
58
|
+
// prince export
|
|
59
|
+
await engine.princeExport({ runAllCodeChunks: true });
|
|
60
|
+
|
|
61
|
+
// ebook export
|
|
62
|
+
await engine.eBookExport({ fileType: 'epub' }); // fileType = 'epub'|'pdf'|'mobi'|'html'
|
|
63
|
+
|
|
64
|
+
// pandoc export
|
|
65
|
+
await engine.pandocExport({ runAllCodeChunks: true });
|
|
66
|
+
|
|
67
|
+
// markdown(gfm) export
|
|
68
|
+
await engine.markdownExport({ runAllCodeChunks: true });
|
|
69
|
+
|
|
70
|
+
return process.exit();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
main();
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Markdown Engine Configuration
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
const config = {
|
|
80
|
+
// Default config directory; `null` means "~/.config/mume"
|
|
81
|
+
configPath : null,
|
|
82
|
+
|
|
83
|
+
// Enable this option will render markdown by pandoc instead of markdown-it.
|
|
84
|
+
usePandocParser: false,
|
|
85
|
+
|
|
86
|
+
// In Markdown, a single newline character doesn't cause a line break in the generated HTML. In GitHub Flavored Markdown, that is not true. Enable this config option to insert line breaks in rendered HTML for single newlines in Markdown source.
|
|
87
|
+
breakOnSingleNewLine: true,
|
|
88
|
+
|
|
89
|
+
// Enable smartypants and other sweet transforms.
|
|
90
|
+
enableTypographer: false,
|
|
91
|
+
|
|
92
|
+
// Enable conversion of URL-like text to links in the markdown preview.
|
|
93
|
+
enableLinkify: true,
|
|
94
|
+
|
|
95
|
+
// Math
|
|
96
|
+
mathRenderingOption: "KaTeX", // "KaTeX" | "MathJax" | "None"
|
|
97
|
+
mathInlineDelimiters: [["$", "$"], ["\\(", "\\)"]],
|
|
98
|
+
mathBlockDelimiters: [["$$", "$$"], ["\\[", "\\]"]],
|
|
99
|
+
mathRenderingOnLineService: "https://latex.codecogs.com/gif.latex", // "https://latex.codecogs.com/svg.latex", "https://latex.codecogs.com/png.latex"
|
|
100
|
+
mathjaxV3ScriptSrc: 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js',
|
|
101
|
+
|
|
102
|
+
// Enable Wiki Link syntax support. More information can be found a https://help.github.com/articles/adding-links-to-wikis/
|
|
103
|
+
enableWikiLinkSyntax: true,
|
|
104
|
+
// If checked, we use GitHub style piped wiki links, i.e. [[linkText|wikiLink]]. Otherwise, we use
|
|
105
|
+
// [[wikiLink|linkText]] as the original Wikipedia style.
|
|
106
|
+
useGitHubStylePipedLink: true
|
|
107
|
+
// By default, the extension for wikilink is `.md`. For example: [[test]] will direct to file path `test.md`.
|
|
108
|
+
wikiLinkFileExtension: '.md'
|
|
109
|
+
|
|
110
|
+
// Enable emoji & font-awesome plugin. This only works for markdown-it parser, but not pandoc parser.
|
|
111
|
+
enableEmojiSyntax: true
|
|
112
|
+
|
|
113
|
+
// Enable extended table syntax to support merging table cells.
|
|
114
|
+
enableExtendedTableSyntax: false
|
|
115
|
+
|
|
116
|
+
// Enable CriticMarkup syntax. Only works with markdown-it parser.
|
|
117
|
+
// Please check http://criticmarkup.com/users-guide.php for more information.
|
|
118
|
+
enableCriticMarkupSyntax: false
|
|
119
|
+
|
|
120
|
+
// Front matter rendering option
|
|
121
|
+
frontMatterRenderingOption: 'none', // 'none' | 'table' | 'code block'
|
|
122
|
+
|
|
123
|
+
// Mermaid theme
|
|
124
|
+
mermaidTheme: 'default', // 'default' | 'dark' | 'forest'
|
|
125
|
+
|
|
126
|
+
// Code Block theme
|
|
127
|
+
// If `auto.css` is chosen, then the code block theme that best matches the current preview theme will be picked.
|
|
128
|
+
codeBlockTheme: 'auto.css',
|
|
129
|
+
// "auto.css",
|
|
130
|
+
// "default.css",
|
|
131
|
+
// "atom-dark.css",
|
|
132
|
+
// "atom-light.css",
|
|
133
|
+
// "atom-material.css",
|
|
134
|
+
// "coy.css",
|
|
135
|
+
// "darcula.css",
|
|
136
|
+
// "dark.css",
|
|
137
|
+
// "funky.css",
|
|
138
|
+
// "github.css",
|
|
139
|
+
// "hopscotch.css",
|
|
140
|
+
// "monokai.css",
|
|
141
|
+
// "okaidia.css",
|
|
142
|
+
// "one-dark.css",
|
|
143
|
+
// "one-light.css",
|
|
144
|
+
// "pen-paper-coffee.css",
|
|
145
|
+
// "pojoaque.css",
|
|
146
|
+
// "solarized-dark.css",
|
|
147
|
+
// "solarized-light.css",
|
|
148
|
+
// "twilight.css",
|
|
149
|
+
// "vue.css",
|
|
150
|
+
// "vs.css",
|
|
151
|
+
// "xonokai.css"
|
|
152
|
+
|
|
153
|
+
// Preview theme
|
|
154
|
+
previewTheme: 'github-light.css',
|
|
155
|
+
// "atom-dark.css",
|
|
156
|
+
// "atom-light.css",
|
|
157
|
+
// "atom-material.css",
|
|
158
|
+
// "github-dark.css",
|
|
159
|
+
// "github-light.css",
|
|
160
|
+
// "gothic.css",
|
|
161
|
+
// "medium.css",
|
|
162
|
+
// "monokai.css",
|
|
163
|
+
// "newsprint.css",
|
|
164
|
+
// "night.css",
|
|
165
|
+
// "none.css",
|
|
166
|
+
// "one-dark.css",
|
|
167
|
+
// "one-light.css",
|
|
168
|
+
// "solarized-dark.css",
|
|
169
|
+
// "solarized-light.css",
|
|
170
|
+
// "vue.css"
|
|
171
|
+
|
|
172
|
+
// Revealjs presentation theme
|
|
173
|
+
revealjsTheme: "white.css",
|
|
174
|
+
// "beige.css",
|
|
175
|
+
// "black.css",
|
|
176
|
+
// "blood.css",
|
|
177
|
+
// "league.css",
|
|
178
|
+
// "moon.css",
|
|
179
|
+
// "night.css",
|
|
180
|
+
// "serif.css",
|
|
181
|
+
// "simple.css",
|
|
182
|
+
// "sky.css",
|
|
183
|
+
// "solarized.css",
|
|
184
|
+
// "white.css",
|
|
185
|
+
// "none.css"
|
|
186
|
+
|
|
187
|
+
// Accepted protocols for links.
|
|
188
|
+
protocolsWhiteList: "http://, https://, atom://, file://, mailto:, tel:",
|
|
189
|
+
|
|
190
|
+
// When using Image Helper to copy images, by default images will be copied to root image folder path '/assets'
|
|
191
|
+
imageFolderPath: '/assets',
|
|
192
|
+
|
|
193
|
+
// Whether to print background for file export or not. If set to `false`, then `github-light` preview theme will b used. You can also set `print_background` in front-matter for individual files.
|
|
194
|
+
printBackground: false,
|
|
195
|
+
|
|
196
|
+
// Chrome executable path, which is used for Puppeteer export. Leaving it empty means the path will be found automatically.
|
|
197
|
+
chromePath: '',
|
|
198
|
+
|
|
199
|
+
// ImageMagick command line path. Should be either `magick` or `convert`. Leaving it empty means the path will be found automatically.
|
|
200
|
+
imageMagickPath: '',
|
|
201
|
+
|
|
202
|
+
// Pandoc executable path
|
|
203
|
+
pandocPath: 'pandoc',
|
|
204
|
+
|
|
205
|
+
// Pandoc markdown flavor
|
|
206
|
+
pandocMarkdownFlavor: "markdown-raw_tex+tex_math_single_backslash",
|
|
207
|
+
|
|
208
|
+
// Pandoc arguments e.g. ['--smart', '--filter=/bin/exe']. Please use long argument names.
|
|
209
|
+
pandocArguments: [],
|
|
210
|
+
|
|
211
|
+
// Default latex engine for Pandoc export and latex code chunk.
|
|
212
|
+
latexEngine: 'pdflatex',
|
|
213
|
+
|
|
214
|
+
// Enables executing code chunks and importing javascript files.
|
|
215
|
+
// This enables also the sidebar table of content.
|
|
216
|
+
// ⚠ ️ Please use this feature with caution because it may put your security at risk!
|
|
217
|
+
// Your machine can get hacked if someone makes you open a markdown with malicious code while script execution is enabled.
|
|
218
|
+
enableScriptExecution: false,
|
|
219
|
+
|
|
220
|
+
// Enables transform audio video link to to html5 embed audio video tags.
|
|
221
|
+
// Internally it enables markdown-it-html5-embed plugins.
|
|
222
|
+
enableHTML5Embed: false,
|
|
223
|
+
|
|
224
|
+
// Enables video/audio embed with ![]() syntax (default).
|
|
225
|
+
HTML5EmbedUseImageSyntax: true,
|
|
226
|
+
|
|
227
|
+
// Enables video/audio embed with []() syntax.
|
|
228
|
+
HTML5EmbedUseLinkSyntax: false,
|
|
229
|
+
|
|
230
|
+
// When true embed media with http:// schema in URLs. When false ignore and don't embed them.
|
|
231
|
+
HTML5EmbedIsAllowedHttp: false,
|
|
232
|
+
|
|
233
|
+
// HTML attributes to pass to audio tags.
|
|
234
|
+
HTML5EmbedAudioAttributes: 'controls preload="metadata" width="320"',
|
|
235
|
+
|
|
236
|
+
// HTML attributes to pass to video tags.
|
|
237
|
+
HTML5EmbedVideoAttributes: 'controls preload="metadata" width="320" height="240"',
|
|
238
|
+
|
|
239
|
+
// Puppeteer waits for a certain timeout in milliseconds before the document export.
|
|
240
|
+
puppeteerWaitForTimeout: 0,
|
|
241
|
+
|
|
242
|
+
// Args passed to puppeteer.launch({args: $puppeteerArgs})
|
|
243
|
+
puppeteerArgs: [],
|
|
244
|
+
|
|
245
|
+
// Render using PlantUML server instead of binary. Leave it empty to use the plantuml.jar file at `plantumlJarPath` (`java` is required in system path). Eg: "http://localhost:8080/svg/".
|
|
246
|
+
// You run start a plantuml server by running:
|
|
247
|
+
// $ docker run -d -p 8080:8080 plantuml/plantuml-server:jetty
|
|
248
|
+
plantumlServer: "http://localhost:8080/svg/",
|
|
249
|
+
|
|
250
|
+
// The absolute of the PlantUML jar file.
|
|
251
|
+
// The plantuml.jar file could be downloaded from https://sourceforge.net/projects/plantuml/
|
|
252
|
+
plantumlJarPath: "",
|
|
253
|
+
|
|
254
|
+
// Example values:
|
|
255
|
+
// - cdn.jsdelivr.net
|
|
256
|
+
// - fastly.jsdelivr.net
|
|
257
|
+
// - gcore.jsdelivr.net
|
|
258
|
+
// - testingcf.jsdelivr.net
|
|
259
|
+
jsdelivrCdnHost: "cdn.jsdelivr.net",
|
|
260
|
+
|
|
261
|
+
// Kroki server url.
|
|
262
|
+
krokiServer: "https://kroki.io",
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Init Engine
|
|
266
|
+
const engine = new mume.MarkdownEngine({
|
|
267
|
+
filePath: '...',
|
|
268
|
+
projectDirectoryPath: '...',
|
|
269
|
+
config: config
|
|
270
|
+
})
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Global Configuration
|
|
274
|
+
|
|
275
|
+
Global config files are located in the `$XDG_STATE_HOME/mume` directory, which is `~/.config/mume` by default
|
|
276
|
+
|
|
277
|
+
## Development
|
|
278
|
+
|
|
279
|
+
[Visual Studio Code](https://code.visualstudio.com/) is recommended.
|
|
280
|
+
Recommended to use Node.js version 20.
|
|
281
|
+
|
|
282
|
+
1. Clone this project
|
|
283
|
+
2. Run `yarn` from shell
|
|
284
|
+
3. Open in vscode, then `cmd+shift+b` to build
|
|
285
|
+
4. Run the tests with `yarn test`
|
|
286
|
+
|
|
287
|
+
Or
|
|
288
|
+
|
|
289
|
+
If you already have [nix](https://nixos.org/download.html) and [direnv](https://direnv.net/) installed, simply cd to the project directory, then run `direnv allow` once.
|