Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yzane committed Aug 14, 2016
0 parents commit a2d7750
Show file tree
Hide file tree
Showing 20 changed files with 2,057 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
work/**
*.vsix
*.bat
.eslintrc.json
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// A launch configuration that launches the extension inside a new window
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/test" ],
"stopOnEntry": false
}
]
}
9 changes: 9 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.vscode/**
typings/**
test/**
.gitignore
jsconfig.json
*.vsix
work/**
*.bat
.eslintrc.json
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright (c) yzane

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in 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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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
AUTHORS 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 IN THE
SOFTWARE.
137 changes: 137 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Markdown PDF

This extension convert Markdown file to pdf, html, png or jpeg file.

## Features

Supports the following features.
* Syntax highlighting
* emoji
* checkbox

## Usage

1. Open the Markdown file.
1. Press `F1` or `Ctrl+Shift+P`.
1. Type `pdf` and select `Convert Markdown to PDF`

![demo](https://raw.githubusercontent.com/yzane/vscode-markdown-pdf/master/images/usage.gif)

## Extension Settings

[Visual Studio Code User and Workspace Settings](https://code.visualstudio.com/docs/customization/userandworkspace)

1. Select **File > Preferences > UserSettings or Workspace Settings**
1. Find markdown-pdf settings in the **Default Settings**
1. Copy `markdown-pdf.*` settings
1. Paste to the **settings.json**, and change the value

![demo](https://raw.githubusercontent.com/yzane/vscode-markdown-pdf/master/images/settings.gif)

## Options

```javascript
{
// A list of local paths to the stylesheets to use from the markdown-pdf.
"markdown-pdf.styles": [
"C:\\Users\\<USERNAME>\\Documents\\markdown-pdf.css", // OK
"C:/Users/<USERNAME>/Documents/markdown-pdf.css", // OK
"/home/<USERNAME>/settings/markdown-pdf.css", // OK
"C:\Users\<USERNAME>\Documents\markdown-pdf.css" // NG All '\' need to be written as '\\'.
],

// Set the style file name. for example: github.css, monokai.css ...
// fine name list : https://github.com/isagalaev/highlight.js/tree/master/src/styles
// demo site : https://highlightjs.org/static/demo/
"markdown-pdf.highlightStyle": "github.css",

// Enable Syntax highlighting
"markdown-pdf.highlight": true,

// Enable line breaks
"markdown-pdf.breaks": false,

// Enable emoji. http://www.webpagefx.com/tools/emoji-cheat-sheet/
"markdown-pdf.emoji": true,

// Allowed file types: pdf , html, png, jpeg
"markdown-pdf.type": "pdf",

// Only used for types png & jpeg
"markdown-pdf.quality": 90,

// Page Option. allowed units: A3, A4, A5, Legal, Letter, Tabloid
"markdown-pdf.format": "A4",

// Page Option. portrait or landscape
"markdown-pdf.orientation": "portrait",

// Page Option. Border Top. units: mm, cm, in, px
"markdown-pdf.border.top": "0.1cm",

// Page Option. Border bottom. units: mm, cm, in, px
"markdown-pdf.border.bottom": "0.1cm",

// Page Option. Border right. units: mm, cm, in, px
"markdown-pdf.border.right": "0.1cm",

// Page Option. Border left. units: mm, cm, in, px
"markdown-pdf.border.left": "0.1cm",

// Header contents
"markdown-pdf.header.contents": "",

// Header height. units: mm, cm, in, px
"markdown-pdf.header.height": "",

// Footer contents
"markdown-pdf.footer.contents": "<div style=\"text-align: center;\">{{page}}/{{pages}}</div>",

// Footer height. units: mm, cm, in, px
"markdown-pdf.footer.height": ""

}
```


## F.A.Q.

### How can I change emoji size ?

1. Add the following to your stylesheet which was specified in the markdown-pdf.styles.

```css
.emoji {
width: 2em;
height: 2em;
}
```


## Release Notes

### 0.1.0 (2016/08/14)

* Initial release.


## License

MIT


## Special thanks
* [marcbachmann/node-html-pdf](https://github.com/marcbachmann/node-html-pdf)
* [markdown-it/markdown-it](https://github.com/markdown-it/markdown-it)
* [mcecot/markdown-it-checkbox](https://github.com/mcecot/markdown-it-checkbox)
* [markdown-it/markdown-it-emoji](https://github.com/markdown-it/markdown-it-emoji)
* [HenrikJoreteg/emoji-images](https://github.com/HenrikJoreteg/emoji-images)
* [isagalaev/highlight.js](https://github.com/isagalaev/highlight.js)
* [cheeriojs/cheerio](https://github.com/cheeriojs/cheerio)
* [janl/mustache.js](https://github.com/janl/mustache.js)


and


* [cakebake/markdown-themeable-pdf](https://github.com/cakebake/markdown-themeable-pdf)
Loading

0 comments on commit a2d7750

Please sign in to comment.