Skip to content
This repository has been archived by the owner on May 17, 2018. It is now read-only.

Commit

Permalink
Merge pull request #253 from facelessuser/master
Browse files Browse the repository at this point in the history
Bug Fixes and New Features
  • Loading branch information
Julien Bouquillon committed Nov 16, 2014
2 parents 86db81b + c079a94 commit 9013ccd
Show file tree
Hide file tree
Showing 20 changed files with 1,600 additions and 738 deletions.
429 changes: 322 additions & 107 deletions MarkdownPreview.py

Large diffs are not rendered by default.

22 changes: 19 additions & 3 deletions MarkdownPreview.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,22 @@
"enable_mathjax": false,

/*
Pygments support for syntax highlighting.
Enable uml support scripts: flowchart.js and sequence-diagram.js.
*/
"enable_uml": false,

/*
Enable highlighting. This enables codehilite extension if not already enabled.
*/
"enable_highlight": false,

/*
Pygments support for syntax highlighting. Controls whether codehilite extension
will use Pygments. If disabled, code blocks will be formatted for javascript
highighters such as highlight.js.
*/
"enable_pygments": true,

/*
List of enabled extensions of the selected markdown parser.
Expand Down Expand Up @@ -179,17 +191,21 @@

/*
Sets how image paths are handled.
Setting is a string value: (absolute | base64 | none)
Setting is a string value: (absolute | relative | base64 | none)
absolute: converts relative local paths to absolute
relative: converts relative local paths to a path relative to the
HTML output
base64: coverts the local file to base64 and embeds it in the HTML
none: does nothing
*/
"image_path_conversion": "absolute",

/*
Sets how file paths are handled.
Setting is a string value: (absolute | none)
Setting is a string value: (absolute | relative | none)
absolute: converts relative local paths to absolute
relative: converts relative local paths to a path relative to the
HTML output
none: does nothing
*/
"file_path_conversions": "absolute",
Expand Down
45 changes: 13 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ You can use builtin [python-markdown][10] parser or use the [github markdown API
- Embed images as base64 (see [settings][settings] file for more info)
- Strip out multimarkdown critic marks (see [settings][settings] file for more info)
- 3rd party extensions for the Python Markdown parser:
- **magiclink**: Automatic conversion of http or ftp links to html links.
- **delete**: Surround inline text with `~~crossed out~~` to get del tags ~~crossed out~~.
- **insert**: Surround inline text with `^^underlined^^` to get ins tags <ins>underlined</ins>
- **tasklist**: Support for github like tasklists using the following notation: `- [X] Completed Task`.
- **githubemoji**: Support for github emojis (`:smile:` --> :smile:). Converts to HTML images that use github's actual emoji assets.
- **b64**: Convert and embed images in the HTML as base64 by adding the extension as `b64(base_path=${BASE_PATH})` (recently a global b64 that works on all parsers was added; see [settings][settings] file for more info).
- **headeranchor**: Adds support for github style anchor links preceding headers.
- **github**: A convenience extension to add: `magiclink`, `delete`, `tasklist`, `githubemoji`, `headeranchor`, and `nl2br` to parse and display GFM in a github-ish way. It is recommed to pair `github` with `extra` and `codehilite` (with language guessing off) to parse close to github's way.
- **admonitionicon**: Add font icon to admonition blocks. Default CSS uses [font awesome](http://fortawesome.github.io/Font-Awesome/)
- **progressbar**: Create progress bars. See [Using Progress Bars](#using-progress-bars) for more info.

| Extension | Documentation |
|-----------|---------------|
| magiclink | Find and convert HTML links and email address to links ([MagicLink Documentation](http://facelessuser.github.io/PyMdown/Extensions/MagicLink.html)). |
| delete | Surround inline text with `~~crossed out~~` to get del tags ~~crossed out~~. |
| insert | Surround inline text with `^^underlined^^` to get ins tags <ins>underlined</ins>. |
| tasklist | Github Flavored Markdown tasklists ([Tasklist Documentation](http://facelessuser.github.io/PyMdown/Extensions/Tasklist.html)). |
| githubemoji | Support for Github Flavored Markdown emojis ([GithubEmoji Documentation](http://facelessuser.github.io/PyMdown/Extensions/GithubEmoji.html)). |
| headeranchor | Github Flavored Markdown style header anchors ([HeaderAnchor Documentation](http://facelessuser.github.io/PyMdown/Extensions/HeaderAnchor.html)). |
| github | A convenience extension to add: `magiclink`, `delete`, `tasklist`, `githubemoji`, `headeranchor`, `superfences`, and `nl2br` to parse and display Markdown in a github-ish way. It is recommed to pair `github` with `extra` and `codehilite` (with language guessing off) to parse close to github's way. Be aware of what extensions `github` loads, because you should not load extensions more than once. |
| progressbar | Create progress bars ([ProgressBar Documentation](http://facelessuser.github.io/PyMdown/Extensions/ProgressBar.html)). |
| superfences | Allow fenced blocks to be nested under lists, blockquotes, etc. and add special UML diagram blocks ([SuperFences Documentation](http://facelessuser.github.io/PyMdown/Extensions/SuperFences.html)). |

## Installation :

Expand Down Expand Up @@ -84,6 +86,7 @@ If you add the codehilite extension manually in the enabled extensions, you can
* Show line numbers: `codehilite(linenums=True)` (True|False).
* Change the higlight theme: `codehilite(pygments_style=emacs)`.
* Inline the CSS: `codehilite(noclasses=True)` (True|False).
* Use multiple: `codehilite(linenums=True, pygments_style-emacs)`.

See [codehilte page](https://pythonhosted.org/Markdown/extensions/code_hilite.html) for more info.

Expand Down Expand Up @@ -133,28 +136,6 @@ Yaml frontmatter has a few special key names that are used that will not be hand
---
```

### Using Progress Bars
Create a progress bar with the following notations:

- Percentage: `[== 35% optional label]`
- Division: `[== 37.5/500 optional label]`

Though progress bars will be recognized inline, they should be displayed as block; they should be used as block items except were not possible (tables etc.). In general it is best to have an empty line before and after a progress bar.

```
Some text
[== 25% progress bar]
Some more text
```

Default styling is a flat candy-striped bar, but there is included CSS for animated candy-stripping and a glossy bar. You can access one or more of these additional stylings by adding the classes when enabling the extension `progressbar(addclasses=candystripe-animate gloss)`.

Also by default, the progress bar extension adds classes to allow for different stylings of percent levels: 0-20%, 21-40%, 41-60%, 61-80%, 80-99%, 100%. This can be turned off by defining the extension as `progressbar(levelclass=False)`. When level classes are disabled, the default color is blue.

Additionally, you can change the settings with this inline notation as well `[==50% MyLabel]{addclasses="additional classes" levelclass="false"}`.

### Parsing Github Flavored Markdown :
Github Flavored Mardown (GFM) is a very popular markdown. Markdown Preview can actually handle them in a couple of ways: online and offline.

Expand Down
5 changes: 5 additions & 0 deletions flowchart-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 9013ccd

Please sign in to comment.