Skip to content

Commit

Permalink
v1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
djfdyuruiry authored Jun 4, 2022
1 parent fe975a3 commit 77eae41
Show file tree
Hide file tree
Showing 8 changed files with 295 additions and 258 deletions.
3 changes: 1 addition & 2 deletions .iyarc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# no fix available as of Nov 2020
536
GHSA-g36h-6r4f-3mqp
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v16
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pretty-markdown-pdf",
"displayName": "Pretty Markdown PDF",
"description": "Convert Markdown to a Pretty PDF :D",
"version": "1.5.1",
"version": "1.5.2",
"publisher": "djfdyuruiry",
"license": "MIT",
"repository": {
Expand All @@ -15,27 +15,27 @@
},
"scripts": {
"samples": "yarn install && ./generate-samples.sh",
"test": "yarn install && improved-yarn-audit && yarn samples"
"test": "yarn install && improved-yarn-audit --fail-on-missing-exclusions && yarn samples"
},
"dependencies": {
"cheerio": "^1.0.0-rc.6",
"cheerio": "^1.0.0-rc.11",
"emoji-images": "^0.1.1",
"highlight.js": "^10.7.2",
"markdown-it": "^12.0.6",
"highlight.js": "^11.5.1",
"markdown-it": "^13.0.1",
"markdown-it-checkbox": "^1.1.0",
"markdown-it-container": "^3.0.0",
"markdown-it-emoji": "^2.0.0",
"markdown-it-emoji": "^2.0.2",
"markdown-it-include": "^2.0.0",
"markdown-it-named-headers": "0.0.4",
"markdown-it-plantuml": "^1.0.0",
"mkdirp": "^1.0.4",
"mustache": "^4.2.0",
"puppeteer": "^9.0.0",
"puppeteer": "^14.2.1",
"rimraf": "^3.0.2",
"vscode-uri": "^3.0.2",
"yargs": "^16.2.0"
"vscode-uri": "^3.0.3",
"yargs": "^17.5.1"
},
"devDependencies": {
"improved-yarn-audit": "^2.3.2"
"improved-yarn-audit": "^3.0.0"
}
}
70 changes: 35 additions & 35 deletions sample/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,13 @@ <h3 id="javascript">Javascript</h3>
<pre class='hljs'><code><div><span class="hljs-keyword">const</span> prettyMdPdf = <span class="hljs-built_in">require</span>(<span class="hljs-string">&quot;pretty-markdown-pdf&quot;</span>)

<span class="hljs-comment">// output to `my-doc.pdf`</span>
prettyMdPdf.convertMd({ <span class="hljs-attr">markdownFilePath</span>: <span class="hljs-string">&quot;my-doc.md&quot;</span> })
prettyMdPdf.<span class="hljs-title function_">convertMd</span>({ <span class="hljs-attr">markdownFilePath</span>: <span class="hljs-string">&quot;my-doc.md&quot;</span> })

<span class="hljs-comment">// specify an output file path</span>
prettyMdPdf.convertMd({ <span class="hljs-attr">markdownFilePath</span>: <span class="hljs-string">&quot;my-doc.md&quot;</span>, <span class="hljs-attr">outputFilePath</span>: <span class="hljs-string">&quot;output.pdf&quot;</span> })
prettyMdPdf.<span class="hljs-title function_">convertMd</span>({ <span class="hljs-attr">markdownFilePath</span>: <span class="hljs-string">&quot;my-doc.md&quot;</span>, <span class="hljs-attr">outputFilePath</span>: <span class="hljs-string">&quot;output.pdf&quot;</span> })

<span class="hljs-comment">// specify an output file type, outputs to `my-doc.html`</span>
prettyMdPdf.convertMd({ <span class="hljs-attr">markdownFilePath</span>: <span class="hljs-string">&quot;my-doc.md&quot;</span>, <span class="hljs-attr">outputFileType</span>: <span class="hljs-string">&quot;html&quot;</span> })
prettyMdPdf.<span class="hljs-title function_">convertMd</span>({ <span class="hljs-attr">markdownFilePath</span>: <span class="hljs-string">&quot;my-doc.md&quot;</span>, <span class="hljs-attr">outputFileType</span>: <span class="hljs-string">&quot;html&quot;</span> })

</div></code></pre>
<h2 id="configuration">Configuration</h2>
Expand All @@ -483,42 +483,42 @@ <h2 id="configuration">Configuration</h2>
<pre class='hljs'><code><div>pretty-md-pdf -i my-doc.md -c /tmp/config.json
</div></code></pre>
<p>From JavaScript you can do:</p>
<pre class='hljs'><code><div>prettyMdPdf.convertMd({ <span class="hljs-attr">markdownFilePath</span>: <span class="hljs-string">&quot;my-doc.md&quot;</span>, <span class="hljs-attr">configFilePath</span>: <span class="hljs-string">&quot;/tmp/config.json&quot;</span>)
<pre class='hljs'><code><div>prettyMdPdf.<span class="hljs-title function_">convertMd</span>({ <span class="hljs-attr">markdownFilePath</span>: <span class="hljs-string">&quot;my-doc.md&quot;</span>, <span class="hljs-attr">configFilePath</span>: <span class="hljs-string">&quot;/tmp/config.json&quot;</span>)
</div></code></pre>
<h3 id="example">Example</h3>
<p>Below is the default config JSON file as an example:</p>
<pre class='hljs'><code><div>{
<span class="hljs-attr">&quot;type&quot;</span>: [
<pre class='hljs'><code><div><span class="hljs-punctuation">{</span>
<span class="hljs-attr">&quot;type&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
<span class="hljs-string">&quot;pdf&quot;</span>
],
<span class="hljs-attr">&quot;outputDirectory&quot;</span>: <span class="hljs-string">&quot;&quot;</span>,
<span class="hljs-attr">&quot;outputDirectoryRelativePathFile&quot;</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">&quot;styles&quot;</span>: [],
<span class="hljs-attr">&quot;stylesRelativePathFile&quot;</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">&quot;includeDefaultStyles&quot;</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">&quot;highlight&quot;</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">&quot;highlightStyle&quot;</span>: <span class="hljs-string">&quot;&quot;</span>,
<span class="hljs-attr">&quot;breaks&quot;</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">&quot;emoji&quot;</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">&quot;markdown-it-include&quot;</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">&quot;executablePath&quot;</span>: <span class="hljs-string">&quot;&quot;</span>,
<span class="hljs-attr">&quot;scale&quot;</span>: <span class="hljs-number">1</span>,
<span class="hljs-attr">&quot;displayHeaderFooter&quot;</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">&quot;headerTemplate&quot;</span>: <span class="hljs-string">&quot;&lt;div style=\&quot;font-size: 9px; margin-left: 1cm;\&quot;&gt; &lt;span class=&#x27;title&#x27;&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=\&quot;font-size: 9px; margin-left: auto; margin-right: 1cm; \&quot;&gt; &lt;span class=&#x27;date&#x27;&gt;&lt;/span&gt;&lt;/div&gt;&quot;</span>,
<span class="hljs-attr">&quot;footerTemplate&quot;</span>: <span class="hljs-string">&quot;&lt;div style=\&quot;font-size: 9px; margin: 0 auto;\&quot;&gt; &lt;span class=&#x27;pageNumber&#x27;&gt;&lt;/span&gt; / &lt;span class=&#x27;totalPages&#x27;&gt;&lt;/span&gt;&lt;/div&gt;&quot;</span>,
<span class="hljs-attr">&quot;printBackground&quot;</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">&quot;orientation&quot;</span>: <span class="hljs-string">&quot;portrait&quot;</span>,
<span class="hljs-attr">&quot;pageRanges&quot;</span>: <span class="hljs-string">&quot;&quot;</span>,
<span class="hljs-attr">&quot;format&quot;</span>: <span class="hljs-string">&quot;A4&quot;</span>,
<span class="hljs-attr">&quot;width&quot;</span>: <span class="hljs-string">&quot;&quot;</span>,
<span class="hljs-attr">&quot;height&quot;</span>: <span class="hljs-string">&quot;&quot;</span>,
<span class="hljs-attr">&quot;margin&quot;</span>: <span class="hljs-string">&quot;1cm&quot;</span>,
<span class="hljs-attr">&quot;quality&quot;</span>: <span class="hljs-number">100</span>,
<span class="hljs-attr">&quot;clip&quot;</span>: {
<span class="hljs-attr">&quot;height&quot;</span>: <span class="hljs-literal">null</span>
},
<span class="hljs-attr">&quot;omitBackground&quot;</span>: <span class="hljs-literal">false</span>
}
<span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;outputDirectory&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;outputDirectoryRelativePathFile&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">false</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;styles&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;stylesRelativePathFile&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">false</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;includeDefaultStyles&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">true</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;highlight&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">true</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;highlightStyle&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;breaks&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">false</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;emoji&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">true</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;markdown-it-include&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">true</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;executablePath&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;scale&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-number">1</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;displayHeaderFooter&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">true</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;headerTemplate&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&lt;div style=\&quot;font-size: 9px; margin-left: 1cm;\&quot;&gt; &lt;span class=&#x27;title&#x27;&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=\&quot;font-size: 9px; margin-left: auto; margin-right: 1cm; \&quot;&gt; &lt;span class=&#x27;date&#x27;&gt;&lt;/span&gt;&lt;/div&gt;&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;footerTemplate&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&lt;div style=\&quot;font-size: 9px; margin: 0 auto;\&quot;&gt; &lt;span class=&#x27;pageNumber&#x27;&gt;&lt;/span&gt; / &lt;span class=&#x27;totalPages&#x27;&gt;&lt;/span&gt;&lt;/div&gt;&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;printBackground&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">true</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;orientation&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;portrait&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;pageRanges&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;format&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;A4&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;width&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;height&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;margin&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;1cm&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;quality&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-number">100</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;clip&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
<span class="hljs-attr">&quot;height&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">null</span>
<span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;omitBackground&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">false</span>
<span class="hljs-punctuation">}</span>
</div></code></pre>
<h3 id="options">Options</h3>
<table>
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.
Loading

0 comments on commit 77eae41

Please sign in to comment.