Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
yzane committed Sep 29, 2019
2 parents 7c9d1d1 + 798cc19 commit a845132
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 23 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Change Log

## 1.3.0 (2019/09/28)
* Add: Support [markdown-it-include](https://github.com/camelaissani/markdown-it-include)
* Integrate markdown-it-include plugin [#138](https://github.com/yzane/vscode-markdown-pdf/pull/138)
* Add: `markdown-pdf.markdown-it-include.enable` option
* Update: README

## 1.2.1 (2019/09/23)
* Fix: [fix typo, grammar](https://github.com/yzane/vscode-markdown-pdf/pull/122)
* Add: [Option to specify the plantuml delimiter](https://github.com/yzane/vscode-markdown-pdf/pull/104)
* Fix: fix typo, grammar [#122](https://github.com/yzane/vscode-markdown-pdf/pull/122)
* Add: Option to specify the plantuml delimiter [#104](https://github.com/yzane/vscode-markdown-pdf/pull/104)
* Update: dependencies packages
* Update: README
* Delete the description of the obsolete options.
Expand Down
46 changes: 41 additions & 5 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* [emoji](http://www.webpagefx.com/tools/emoji-cheat-sheet/)
* [markdown-it-checkbox](https://github.com/mcecot/markdown-it-checkbox)
* [markdown-it-container](https://github.com/markdown-it/markdown-it-container)
* [markdown-it-include](https://github.com/camelaissani/markdown-it-include)
* [PlantUML](http://plantuml.com/)
* [markdown-it-plantuml](https://github.com/gmunguia/markdown-it-plantuml)

Expand Down Expand Up @@ -66,6 +67,34 @@ OUTPUT

![PlantUML](images/PlantUML.png)

### markdown-it-include

Include markdown fragment files: `:[alternate-text](relative-path-to-file.md)`.

```
├── [plugins]
│ └── README.md
├── CHANGELOG.md
└── README.md
```

INPUT
```
README Content
:[Plugins](./plugins/README.md)
:[Changelog](CHANGELOG.md)
```

OUTPUT
```
Content of README.md
Content of plugins/README.md
Content of CHANGELOG.md
```

## インストール

Expand Down Expand Up @@ -168,6 +197,7 @@ Markdown PDF をインストールして、Visutal Studio Code で Markdownフ
||[markdown-pdf.omitBackground](#markdown-pdfomitbackground)|
|[PlantUML options](#plantuml-options)|[markdown-pdf.plantumlOpenMarker](#markdown-pdfplantumlopenmarker)|
||[markdown-pdf.plantumlCloseMarker](#markdown-pdfplantumlclosemarker)|
|[markdown-it-include options](#markdown-it-include-options)|[markdown-pdf.markdown-it-include.enable](#markdown-pdfmarkdown-it-includeenable)|

### Save options

Expand Down Expand Up @@ -453,6 +483,12 @@ Markdown PDF をインストールして、Visutal Studio Code で Markdownフ
- plantuml パーサーの終了区切り文字
- Default: @enduml

### markdown-it-include options

#### `markdown-pdf.markdown-it-include.enable`
- markdown-it-include を有効にします
- boolean. Default: true

<div class="page"/>

## FAQ
Expand Down Expand Up @@ -504,12 +540,11 @@ Visual Studio Code の `files.autoGuessEncoding` オプションを使うと、

## [Release Notes](CHANGELOG.md)

### 1.2.1 (2019/09/23)
* Fix: [fix typo, grammar](https://github.com/yzane/vscode-markdown-pdf/pull/122)
* Add: [Option to specify the plantuml delimiter](https://github.com/yzane/vscode-markdown-pdf/pull/104)
* Update: dependencies packages
### 1.3.0 (2019/09/28)
* Add: Support [markdown-it-include](https://github.com/camelaissani/markdown-it-include)
* Integrate markdown-it-include plugin [#138](https://github.com/yzane/vscode-markdown-pdf/pull/138)
* Add: `markdown-pdf.markdown-it-include.enable` option
* Update: README
* Delete the description of the obsolete options.


## License
Expand All @@ -529,6 +564,7 @@ MIT
* [janl/mustache.js](https://github.com/janl/mustache.js)
* [markdown-it/markdown-it-container](https://github.com/markdown-it/markdown-it-container)
* [gmunguia/markdown-it-plantuml](https://github.com/gmunguia/markdown-it-plantuml)
* [camelaissani/markdown-it-include](https://github.com/camelaissani/markdown-it-include)

and

Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ If the download is not successful or you want to avoid downloading every time yo
||[markdown-pdf.omitBackground](#markdown-pdfomitbackground)|
|[PlantUML options](#plantuml-options)|[markdown-pdf.plantumlOpenMarker](#markdown-pdfplantumlopenmarker)|
||[markdown-pdf.plantumlCloseMarker](#markdown-pdfplantumlclosemarker)|
|[markdown-it-include options](#markdown-it-include-options)|[markdown-pdf.markdown-it-include.enable](#markdown-pdfmarkdown-it-includeenable)|

### Save options

Expand Down Expand Up @@ -488,6 +489,12 @@ If the download is not successful or you want to avoid downloading every time yo
- Closing delimiter used for the plantuml parser.
- Default: @enduml

### markdown-it-include options

#### `markdown-pdf.markdown-it-include.enable`
- Enable markdown-it-include.
- boolean. Default: true

<div class="page"/>

## FAQ
Expand Down Expand Up @@ -539,12 +546,11 @@ Please use the following to insert a page break.

## [Release Notes](CHANGELOG.md)

### 1.2.1 (2019/09/23)
* Fix: [fix typo, grammar](https://github.com/yzane/vscode-markdown-pdf/pull/122)
* Add: [Option to specify the plantuml delimiter](https://github.com/yzane/vscode-markdown-pdf/pull/104)
* Update: dependencies packages
### 1.3.0 (2019/09/28)
* Add: Support [markdown-it-include](https://github.com/camelaissani/markdown-it-include)
* Integrate markdown-it-include plugin [#138](https://github.com/yzane/vscode-markdown-pdf/pull/138)
* Add: `markdown-pdf.markdown-it-include.enable` option
* Update: README
* Delete the description of the obsolete options.


## License
Expand All @@ -564,6 +570,7 @@ MIT
* [janl/mustache.js](https://github.com/janl/mustache.js)
* [markdown-it/markdown-it-container](https://github.com/markdown-it/markdown-it-container)
* [gmunguia/markdown-it-plantuml](https://github.com/gmunguia/markdown-it-plantuml)
* [camelaissani/markdown-it-include](https://github.com/camelaissani/markdown-it-include)

and

Expand Down
10 changes: 6 additions & 4 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,12 @@ function convertMarkdownToHtml(filename, type, text) {
// https://github.com/camelaissani/markdown-it-include
// the syntax is :[alt-text](relative-path-to-file.md)
// https://talk.commonmark.org/t/transclusion-or-including-sub-documents-for-reuse/270/13
md.use(require("markdown-it-include"), {
root: path.dirname(filename),
includeRe: /\:(?:\[[^\]]*\])?\(([^)]+\.md)\)/i
});
if (vscode.workspace.getConfiguration('markdown-pdf')['markdown-it-include']['enable']) {
md.use(require("markdown-it-include"), {
root: path.dirname(filename),
includeRe: /\:(?:\[[^\]]*\])?\(([^)]+\.md)\)/i
});
}

statusbarmessage.dispose();
return md.render(text);
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "markdown-pdf",
"displayName": "Markdown PDF",
"description": "Convert Markdown to PDF",
"version": "1.2.1",
"version": "1.3.0",
"publisher": "yzane",
"icon": "images/icon.png",
"engines": {
Expand Down Expand Up @@ -455,6 +455,11 @@
"type": "number",
"default": 10000,
"description": "Statusbar message timeout [milliseconds]"
},
"markdown-pdf.markdown-it-include.enable": {
"type": "boolean",
"default": true,
"description": "Enable markdown-it-include. "
}
}
}
Expand Down
44 changes: 38 additions & 6 deletions sample/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ <h2 id="features">Features</h2>
<li><a href="http://www.webpagefx.com/tools/emoji-cheat-sheet/">emoji</a></li>
<li><a href="https://github.com/mcecot/markdown-it-checkbox">markdown-it-checkbox</a></li>
<li><a href="https://github.com/markdown-it/markdown-it-container">markdown-it-container</a></li>
<li><a href="https://github.com/camelaissani/markdown-it-include">markdown-it-include</a></li>
<li><a href="http://plantuml.com/">PlantUML</a>
<ul>
<li><a href="https://github.com/gmunguia/markdown-it-plantuml">markdown-it-plantuml</a></li>
Expand Down Expand Up @@ -444,6 +445,27 @@ <h3 id="markdown-it-plantuml">markdown-it-plantuml</h3>
</div></code></pre>
<p>OUTPUT</p>
<p><img src="images/PlantUML.png" alt="PlantUML"></p>
<h3 id="markdown-it-include">markdown-it-include</h3>
<p>Include markdown fragment files: <code>:[alternate-text](relative-path-to-file.md)</code>.</p>
<pre class="hljs"><code><div>├── [plugins]
│ └── README.md
├── CHANGELOG.md
└── README.md
</div></code></pre>
<p>INPUT</p>
<pre class="hljs"><code><div>README Content

:[Plugins](./plugins/README.md)

:[Changelog](CHANGELOG.md)
</div></code></pre>
<p>OUTPUT</p>
<pre class="hljs"><code><div>Content of README.md

Content of plugins/README.md

Content of CHANGELOG.md
</div></code></pre>
<h2 id="install">Install</h2>
<p>Chromium download starts automatically when Markdown PDF is installed and Markdown file is first opened with Visutal Studio Code.</p>
<p>However, it is time-consuming depending on the environment because of its large size (~ 170Mb Mac, ~ 282Mb Linux, ~ 280Mb Win).</p>
Expand Down Expand Up @@ -649,6 +671,10 @@ <h3 id="list">List</h3>
<td style="text-align:left"></td>
<td style="text-align:left"><a href="#markdown-pdfplantumlclosemarker">markdown-pdf.plantumlCloseMarker</a></td>
</tr>
<tr>
<td style="text-align:left"><a href="#markdown-it-include-options">markdown-it-include options</a></td>
<td style="text-align:left"><a href="#markdown-pdfmarkdown-it-includeenable">markdown-pdf.markdown-it-include.enable</a></td>
</tr>
</tbody>
</table>
<h3 id="save-options">Save options</h3>
Expand Down Expand Up @@ -941,6 +967,12 @@ <h4 id="markdown-pdfplantumlclosemarker"><code>markdown-pdf.plantumlCloseMarker<
<li>Closing delimiter used for the plantuml parser.</li>
<li>Default: @enduml</li>
</ul>
<h3 id="markdown-it-include-options">markdown-it-include options</h3>
<h4 id="markdown-pdfmarkdown-it-includeenable"><code>markdown-pdf.markdown-it-include.enable</code></h4>
<ul>
<li>Enable markdown-it-include.</li>
<li>boolean. Default: true</li>
</ul>
<div class="page"/>
<h2 id="faq">FAQ</h2>
<h3 id="how-can-i-change-emoji-size">How can I change emoji size ?</h3>
Expand Down Expand Up @@ -972,16 +1004,15 @@ <h3 id="markdown-pdfstyles-option"><code>markdown-pdf.styles</code> option</h3>
<li>Online CSS (https://xxx/xxx.css) is applied correctly for JPG and PNG, but problems occur with PDF. <a href="https://github.com/yzane/vscode-markdown-pdf/issues/67">#67</a></li>
</ul>
<h2 id="release-notes"><a href="CHANGELOG.md">Release Notes</a></h2>
<h3 id="121-20190923">1.2.1 (2019/09/23)</h3>
<h3 id="130-20190928">1.3.0 (2019/09/28)</h3>
<ul>
<li>Fix: <a href="https://github.com/yzane/vscode-markdown-pdf/pull/122">fix typo, grammar</a></li>
<li>Add: <a href="https://github.com/yzane/vscode-markdown-pdf/pull/104">Option to specify the plantuml delimiter</a></li>
<li>Update: dependencies packages</li>
<li>Update: README
<li>Add: Support <a href="https://github.com/camelaissani/markdown-it-include">markdown-it-include</a>
<ul>
<li>Delete the description of the obsolete options.</li>
<li>Integrate markdown-it-include plugin <a href="https://github.com/yzane/vscode-markdown-pdf/pull/138">#138</a></li>
<li>Add: <code>markdown-pdf.markdown-it-include.enable</code> option</li>
</ul>
</li>
<li>Update: README</li>
</ul>
<h2 id="license">License</h2>
<p>MIT</p>
Expand All @@ -998,6 +1029,7 @@ <h2 id="special-thanks">Special thanks</h2>
<li><a href="https://github.com/janl/mustache.js">janl/mustache.js</a></li>
<li><a href="https://github.com/markdown-it/markdown-it-container">markdown-it/markdown-it-container</a></li>
<li><a href="https://github.com/gmunguia/markdown-it-plantuml">gmunguia/markdown-it-plantuml</a></li>
<li><a href="https://github.com/camelaissani/markdown-it-include">camelaissani/markdown-it-include</a></li>
</ul>
<p>and</p>
<ul>
Expand Down
Binary file modified sample/README.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sample/README.pdf
Binary file not shown.
Binary file modified sample/README.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var removeNPMAbsolutePaths = require('removeNPMAbsolutePaths');
console.log('delete file...');
deleteFile(path.join(__dirname, '..', 'node_modules', 'emoji-images', 'json'));
deleteFile(path.join(__dirname, '..', 'node_modules', 'puppeteer', '.local-chromium'));
deleteFile(path.join(__dirname, '..', 'sample', 'README.*'));

removeNPMAbsolutePaths(path.join(__dirname, '..', 'node_modules'), { force: true, fields: ['_where', '_args']})
.then(results => results.forEach(result => {
Expand Down

0 comments on commit a845132

Please sign in to comment.