diff --git a/docs/newest.md b/docs/newest.md deleted file mode 100644 index ecb55a7..0000000 --- a/docs/newest.md +++ /dev/null @@ -1,115 +0,0 @@ -## 0.2.8 - -* Upgraded mume to [0.2.2](https://github.com/shd101wyy/mume/blob/master/CHANGELOG.md). -* Removed `ctrl-shift-i` keybord shortcut. -* Added `Open Preview` command to context menu. - -## 0.2.7 - -* Added `ignoreLink` option to TOC. -* Fixed issue [#585](https://github.com/shd101wyy/markdown-preview-enhanced/issues/585), [#586](https://github.com/shd101wyy/markdown-preview-enhanced/issues/585). - -## 0.2.6 - -* Removed the `Welcome Page`. -* Supported revealjs `fragment` [#559](https://github.com/shd101wyy/markdown-preview-enhanced/issues/559). -* Supported Experimental Puppeteer export (Headless Chrome). - -## 0.2.5 - -* Fixed revealjs html export style bug. -* Supported configuring attributes for diagram **containers**. - For example: - - ```puml {.center} - // your code here - ``` - will add `class="center"` to the container. - -* By default, all exported files will use `github-light.css` style. You can use your preview theme for export by setting `printBackground` to `true` from the extension settings, or add `print_background:true` to front-matter. - -## 0.2.3 & 0.2.4 - -* The old feature [WaveDrom diagram](https://shd101wyy.github.io/markdown-preview-enhanced/#/diagrams?id=wavedrom) is now supported again. -* The doc of customization css is updated, please [check it here](https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css). -* Sidebar TOC is now supported in HTML export, and it is enabled by default. - ![screen shot 2017-08-05 at 8 50 16 pm](https://user-images.githubusercontent.com/1908863/28999904-c40b56b6-7a1f-11e7-9a9e-ab2e19a82b41.png) - - You can configure the sidebar TOC by front-matter. For more information, please check [this doc](https://shd101wyy.github.io/markdown-preview-enhanced/#/html?id=configuration). - -* Upgraded [mume](https://github.com/shd101wyy/mume) to version [0.1.7](https://github.com/shd101wyy/mume/blob/master/CHANGELOG.md). - -## 0.2.2 - -* Deprecated the old way of defining attribtues (still supported but not recommened) [#529](https://github.com/shd101wyy/markdown-preview-enhanced/issues/529). Now attributes should be defined like below in order to be compatible with the pandoc parser: - - {#identifier .class .class key=value key=value} - - - And here are a few changes: - - # Hi {#id .class1 .class2} - - Show `line-numbers` - ```javascript {.line-numbers} - x = 1 - ``` - - ```python {cmd=true output="markdown"} - print("**Hi there**") - ``` - - - - \@import "test.png" {width=50% height=30%} - -* Added a few more preview themes. -* Supported [vega](https://vega.github.io/vega/) and [vega-lite](https://vega.github.io/vega-lite/). [#524](https://github.com/shd101wyy/markdown-preview-enhanced/issues/524). - - * Code block with `vega` notation will be rendered by [vega](https://vega.github.io/vega/). - * Code block with `vega-lite` notation will be rendered by [vega-lite](https://vega.github.io/vega-lite/). - * Both `JSON` and `YAML` inputs are supported. - - ![screen shot 2017-07-28 at 7 59 58 am](https://user-images.githubusercontent.com/1908863/28718265-d023e1c2-736a-11e7-8678-a29704f3a23c.png) - - You can also [@import](https://shd101wyy.github.io/markdown-preview-enhanced/#/file-imports) a `JSON` or `YAML` file as `vega` diagram, for example: - -
-    \@import "your_vega_source.json" {as:"vega"}
-    \@import "your_vega_lite_source.json" {as:"vega-lite"}
-
- -* Supported [ditaa](https://github.com/stathissideris/ditaa). - ditaa can convert diagrams drawn using ascii art ('drawings' that contain characters that resemble lines like | / - ), into proper bitmap graphics. (**Java** is required to be installed) - - `ditaa` is intergrated with [code chunk](https://shd101wyy.github.io/markdown-preview-enhanced/#/code-chunk), for example: - -
-  ```ditaa {cmd=true args=["-E"]}
-  +--------+   +-------+    +-------+
-  |        | --+ ditaa +--> |       |
-  |  Text  |   +-------+    |diagram|
-  |Document|   |!magic!|    |       |
-  |     {d}|   |       |    |       |
-  +---+----+   +-------+    +-------+
-      :                         ^
-      |       Lots of work      |
-      +-------------------------+
-  ```
-
- -> shift-enter to run code chunk. -> set `{hide=true}` to hide code block. -> set `{run_on_save=true}` to render ditaa when you save the markdown file. - -![screen shot 2017-07-28 at 8 11 15 am](https://user-images.githubusercontent.com/1908863/28718626-633fa18e-736c-11e7-8a4a-915858dafff6.png) - -## 0.2.0, 0.2.1 - -* Upgraded [mume](https://github.com/shd101wyy/mume) to version `0.1.5`. - * Fixed header id bug [#516](https://github.com/shd101wyy/markdown-preview-enhanced/issues/516). - * Fixed `enableExtendedTableSyntax` bug. - * Fixed `MathJax` init error. - * Fixed plain text code block font size issue. - * Fixed `transformMarkdown` function `Maximum call stack size exceeded` issue [515](https://github.com/shd101wyy/markdown-preview-enhanced/issues/515), [#517](https://github.com/shd101wyy/markdown-preview-enhanced/issues/517). - * Fixed `webview.ts` `clickTagA` action bug [503](https://github.com/shd101wyy/markdown-preview-enhanced/issues/503). diff --git a/docs/welcome.md b/docs/welcome.md deleted file mode 100644 index 7559ec0..0000000 --- a/docs/welcome.md +++ /dev/null @@ -1,28 +0,0 @@ -
-

Markdown Preview Enhanced

-

- - - -@import "https://user-images.githubusercontent.com/1908863/28734960-d71fb3dc-73a8-11e7-8555-847373d1ed0f.gif" {width: 500, style: "position:relative; left: 50%; transform: translateX(-50%);"} -
-
- -

- English    - 简体中文    - 正體中文   

-Support this project! -

- - - -@import "newest.md"; - - - -
-


-Released under the University of Illinois/NCSA Open Source License
-Copyright © 2015-2017 Yiyi Wang -
diff --git a/media/PreviewOnRightPane_16x.svg b/media/PreviewOnRightPane_16x.svg new file mode 100644 index 0000000..eefaadf --- /dev/null +++ b/media/PreviewOnRightPane_16x.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + diff --git a/media/PreviewOnRightPane_16x_dark.svg b/media/PreviewOnRightPane_16x_dark.svg new file mode 100644 index 0000000..c18634b --- /dev/null +++ b/media/PreviewOnRightPane_16x_dark.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + diff --git a/package.json b/package.json index f7c7667..7f6e414 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,12 @@ "commands": [ { "command": "markdown-preview-enhanced.openPreview", - "title": "Markdown Preview Enhanced: Open Preview" + "title": "Markdown Preview Enhanced: Open Preview", + "category": "Markdown", + "icon": { + "light": "./media/PreviewOnRightPane_16x.svg", + "dark": "./media/PreviewOnRightPane_16x_dark.svg" + } }, { "command": "markdown-preview-enhanced.toggleScrollSync", @@ -128,6 +133,13 @@ "when": "editorLangId == markdown", "group": "markdown-preview-enhanced" } + ], + "editor/title": [ + { + "command": "markdown-preview-enhanced.openPreview", + "when": "editorLangId == markdown", + "group": "navigation" + } ] }, "configuration": { @@ -231,11 +243,11 @@ "description": "Front matter rendering option", "type": "string", "enum": [ + "none", "table", - "code block", - "none" + "code block" ], - "default": "table" + "default": "none" }, "markdown-preview-enhanced.mermaidTheme": { "description": "Mermaid theme, you can choose one from [\"mermaid.css\", \"mermaid.dark.css\", \"mermaid.forest.css\"]", @@ -320,8 +332,8 @@ ] }, "markdown-preview-enhanced.protocolsWhiteList": { - "description": "Accepted protocols followed by `://` for links.", - "default": "http, https, atom, file", + "description": "Accepted protocols for links.", + "default": "http://, https://, atom://, file://, mailto:, tel:", "type": "string" }, "markdown-preview-enhanced.imageFolderPath": { @@ -407,7 +419,7 @@ "test": "npm run compile && node ./node_modules/vscode/bin/test" }, "dependencies": { - "@shd101wyy/mume": "^0.3.2" + "@shd101wyy/mume": "^0.3.3" }, "devDependencies": { "@types/jquery": "^3.2.17", @@ -421,4 +433,4 @@ "typescript": "^2.6.2", "vscode": "^1.1.13" } -} \ No newline at end of file +} diff --git a/src/preview-content-provider.ts b/src/preview-content-provider.ts index 297666b..d53e796 100644 --- a/src/preview-content-provider.ts +++ b/src/preview-content-provider.ts @@ -152,7 +152,7 @@ export class MarkdownPreviewEnhancedView const lineCount = editor.document.lineCount; for (let i2 = 0; i2 < lineCount; i2++) { const line = editor.document.lineAt(i2); - if (line.text.match(/^```(.+)\"?cmd\"?\s*[:=]/)) { + if (line.text.match(/^```(.+)\"?cmd\"?\s*[=\s}]/)) { if (codeChunkOffset === targetCodeChunkOffset) { i2 = i2 + 1; while (i2 < lineCount) { @@ -165,7 +165,7 @@ export class MarkdownPreviewEnhancedView } else { codeChunkOffset++; } - } else if (line.text.match(/\@import\s+(.+)\"?cmd\"?\s*[:=]/)) { + } else if (line.text.match(/\@import\s+(.+)\"?cmd\"?\s*[=\s}]/)) { if (codeChunkOffset === targetCodeChunkOffset) { // console.log('find code chunk' ) return insertResult(i2, editor); @@ -509,7 +509,7 @@ export class MarkdownPreviewEnhancedView public runAllCodeChunks(sourceUri) { const engine = this.getEngine(sourceUri); if (engine) { - engine.runAllCodeChunks().then(() => { + engine.runCodeChunks().then(() => { this.updateMarkdown(sourceUri); }); }