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 #231 from facelessuser/master
Browse files Browse the repository at this point in the history
New Extensions and Modifications
  • Loading branch information
facelessuser committed Aug 1, 2014
2 parents ba80f75 + c84437c commit 931b4b3
Show file tree
Hide file tree
Showing 7 changed files with 588 additions and 40 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ You can use builtin [python-markdown][10] parser or use the [github markdown API
- 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 double `~~word~~` show text ~~crossed out~~.
- **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.

## Installation :

Expand Down Expand Up @@ -130,6 +133,28 @@ 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
170 changes: 138 additions & 32 deletions markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhD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GGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff');
}

@font-face{
font-family: fontawesome-mini;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAzUABAAAAAAFNgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABbAAAABwAAAAcZMzaOEdERUYAAAGIAAAAHQAAACAAOQAET1MvMgAAAagAAAA+AAAAYHqhde9jbWFwAAAB6AAAAFIAAAFa4azkLWN2dCAAAAI8AAAAKAAAACgFgwioZnBnbQAAAmQAAAGxAAACZVO0L6dnYXNwAAAEGAAAAAgAAAAIAAAAEGdseWYAAAQgAAAFDgAACMz7eroHaGVhZAAACTAAAAAwAAAANgWEOEloaGVhAAAJYAAAAB0AAAAkDGEGa2htdHgAAAmAAAAAEwAAADBEgAAQbG9jYQAACZQAAAAaAAAAGgsICJBtYXhwAAAJsAAAACAAAAAgASgBD25hbWUAAAnQAAACZwAABOD4no+3cG9zdAAADDgAAABsAAAAmF+yXM9wcmVwAAAMpAAAAC4AAAAusPIrFAAAAAEAAAAAyYlvMQAAAADLVHQgAAAAAM/u9uZ4nGNgZGBg4ANiCQYQYGJgBEJuIGYB8xgABMMAPgAAAHicY2Bm42OcwMDKwMLSw2LMwMDQBqGZihmiwHycoKCyqJjB4YPDh4NsDP+BfNb3DIuAFCOSEgUGRgAKDg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PbJ55Dsekq1lJpnypsMUsYOdCW30o103Ytu/lvh+5RWFLfBjm9/N8hJntPhvx92rnoE/kyHdGasGy754kw36vsVf/lFeBi+0COu+cfgQr42G3CRpeLoZ53gmfe3X6rcKt5oVxnptHR9JS8ehVUd5wvvahN2uqxOOpMXapibI5k7Zwbt4xBSaTfoKBufhAnO/uqNcfK8OTs0OQ6l7JIqFjDhYj5WcjevCnI/1DDiI8j4ndWb/5YzDZWh79yomWXeXj7Nnw70/2TIeFPTrlSh89k1ObOSRVZWZfgF0r/zJQB4nG2JUQuCQBCEd07TTg36fb2IyBaLd3vWaUh/vmSJnvpgmG8YcmS8X3Shf3R7QA4OBUocUKHGER5NNbOOEvwc1txnuWkTRb/aPjimJ5vXabI+3VfOiyS15UWvyezM2xiGOPyuMohOH8O8JiO4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFhZsBQrAAA=) format('woff');
}

/* Body */
html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }

Expand All @@ -28,11 +33,11 @@ a:active{ color:#faa700; }
a:focus{ outline: thin dotted; }
a:hover, a:active{ outline: 0; }

::-moz-selection { background:rgba(255,255,0,0.3); color:#000 }
::selection { background:rgba(255,255,0,0.3); color:#000 }
::-moz-selection { background:#a8d1ff; color:#000 }
::selection { background:#a8d1ff; color:#000 }

a::-moz-selection { background:rgba(255,255,0,0.3); color:#0645ad }
a::selection { background:rgba(255,255,0,0.3); color:#0645ad }
a::-moz-selection { background:#a8d1ff; color:#0645ad }
a::selection { background:#a8d1ff; color:#0645ad }

/* Header Anchor Links*/
.headeranchor-link {
Expand Down Expand Up @@ -136,52 +141,152 @@ pre code { border: 0; padding: 0; }
font-size: 0.88em;
padding: 0.5em 1em 0.5em 1em;
margin: 10px auto;
color: #888888;
background-color: #F8F8F8;
border: 1px solid #888888;
}

.admonition p {
padding: 0;
margin: 0.5em 0 0.5em 0;
}
.admonition p { padding: 0; margin: 0; }
.admonition-title { font-weight: bold; margin: 0; }

.admonition-title {
font-weight: bold;
.admonition-icon {
font: normal normal 16px fontawesome-mini;
line-height: 1.5;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
float: left;
}

.admonition.attention {
color: #4F8A10;
background-color: #DFF2BF;
border: 1px solid #4F8A10;
.admonition.attention { color: #4F8A10; background-color: #DFF2BF; border: 1px solid #4F8A10; }
.admonition.caution { color: #D63301; background-color: #FFCCBA; border: 1px solid #D63301; }
.admonition.hint { color: #00529B; background-color: #BDE5F8; border: 1px solid #00529B; }
.admonition.danger { color: #D8000C; background-color: #FFBABA; border: 1px solid #D8000C; }
.admonition.question { color: #00049b; background-color: #BDC8F8; border: 1px solid #00049b; }
.admonition.note { color: #9F6000; background-color: #FEEFB3; border: 1px solid #9F6000; }

.attention > .admonition-icon:before { content: "\f058\00a0"; }
.caution > .admonition-icon:before { content: "\f06a\00a0"; }
.hint > .admonition-icon:before { content: "\f05a\00a0"; }
.danger > .admonition-icon:before { content: "\f056\00a0"; }
.question > .admonition-icon:before { content: "\f059\00a0"; }
.note > .admonition-icon:before { content: "\f040\00a0"; }

/* progress bar*/
.progress {
display: block;
width: 300px;
margin: 10px 0;
height: 24px;
border: 1px solid #ccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #F8F8F8;
position: relative;
box-shadow: inset -1px 1px 3px rgba(0, 0, 0, .1);
}

.admonition.caution {
color: #9F6000;
background-color: #FEEFB3;
border: 1px solid #9F6000;
.progress-label {
position: absolute;
text-align: center;
font-weight: bold;
width: 100%; margin: 0;
line-height: 24px;
color: #333;
text-shadow:
1px 1px 0px #fefefe,
-1px -1px 0px #fefefe,
-1px 1px 0px #fefefe,
1px -1px 0px #fefefe,
0px 1px 0px #fefefe,
0px -1px 0px #fefefe,
1px 0px 0px #fefefe,
-1px 0px 0px #fefefe,
1px 1px 2px #000;
-webkit-font-smoothing: antialiased !important;
white-space: nowrap;
overflow: hidden;
}

.admonition.hint {
color: #00529B;
background-color: #BDE5F8;
border: 1px solid #00529B;
.progress-bar {
height: 24px;
float: left;
border-right: 1px solid #ccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #34c2e3;
box-shadow: inset 0 1px 0px rgba(255, 255, 255, .5);
background-size: 30px 30px;
background-image: -webkit-linear-gradient(
135deg,
rgba(255, 255, 255, .4) 27%, transparent 27%,
transparent 53%, rgba(255, 255, 255, .4) 53%,
rgba(255, 255, 255, .4) 77%, transparent 77%,
transparent
);
background-image: -moz-linear-gradient(
135deg,
rgba(255, 255, 255, .4) 27%, transparent 27%,
transparent 53%, rgba(255, 255, 255, .4) 53%,
rgba(255, 255, 255, .4) 77%, transparent 77%,
transparent
);
background-image: -ms-linear-gradient(
135deg,
rgba(255, 255, 255, .4) 27%, transparent 27%,
transparent 53%, rgba(255, 255, 255, .4) 53%,
rgba(255, 255, 255, .4) 77%, transparent 77%,
transparent
);
background-image: -o-linear-gradient(
135deg,
rgba(255, 255, 255, .4) 27%, transparent 27%,
transparent 53%, rgba(255, 255, 255, .4) 53%,
rgba(255, 255, 255, .4) 77%, transparent 77%,
transparent
);
background-image: linear-gradient(
135deg,
rgba(255, 255, 255, .4) 27%, transparent 27%,
transparent 53%, rgba(255, 255, 255, .4) 53%,
rgba(255, 255, 255, .4) 77%, transparent 77%,
transparent
);
}

.admonition.danger {
color: #D8000C;
background-color: #FFBABA;
border: 1px solid #D8000C;
.progress-100plus .progress-bar { background-color: #1ee038; }
.progress-80plus .progress-bar { background-color: #86e01e; }
.progress-60plus .progress-bar { background-color: #f2d31b; }
.progress-40plus .progress-bar { background-color: #f2b01e; }
.progress-20plus .progress-bar { background-color: #f27011; }
.progress-0plus .progress-bar { background-color: #f63a0f; }

.gloss .progress-bar {
box-shadow:
inset -1px 1px 0px rgba(255, 255, 255, .5),
inset 0 -4px 12px rgba(255, 255, 255, .7),
inset 0 4px 12px rgba(255, 255, 255, .7),
inset 0 -12px 0px rgba(0, 0, 0, .05),
inset 1px -1px 0px rgba(255, 255, 255, .2);
}

.admonition.note {
color: #888888;
background-color: #F8F8F8;
border: 1px solid #888888;
.candystripe-animate .progress-bar{
-webkit-animation: animate-stripes 3s linear infinite;
-moz-animation: animate-stripes 3s linear infinite;
animation: animate-stripes 3s linear infinite;
}

@-webkit-keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
@-moz-keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
@keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }

/* Inlines */
b, strong { font-weight: bold; }

ins { background: #ff9; color: #000; text-decoration: none; }

mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }

sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
Expand Down Expand Up @@ -262,6 +367,7 @@ td:not(.linenos) .linenodiv { padding: 0 !important; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
pre, blockquote { border: 1px solid #999; padding-right: 1em; page-break-inside: avoid; }
.progress, .progress-bar { box-shadow: none; }
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
p, h2, h3 { orphans: 3; widows: 3; }
Expand Down
47 changes: 47 additions & 0 deletions markdown/extensions/admonitionicon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
mdownx.admonitionicon
An extension for Python Markdown.
Add spans for adding icons.
MIT license.
Copyright (c) 2014 Isaac Muse <[email protected]>
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.
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from ..extensions import Extension
from ..treeprocessors import Treeprocessor
from ..util import etree


class AdmonitionIconTreeprocessor(Treeprocessor):
CLASSNAME_ICON = 'admonition-icon'

def run(self, root):
""" Add admontion icon """
for tag in root.getiterator("div"):
classes = tag.attrib.get("class", "").split()
if "admonition" in classes:
span = etree.Element('span')
span.set('class', self.CLASSNAME_ICON)
tag.insert(0, span)
return root


class AdmonitionIconExtension(Extension):
def extendMarkdown(self, md, md_globals):
"""Add AdmonitionIconTreeprocessor to Markdown instance"""

adicon = AdmonitionIconTreeprocessor(md)
md.treeprocessors.add("admonitionicon", adicon, ">inline")
md.registerExtension(self)


def makeExtension(configs={}):
return AdmonitionIconExtension(configs=configs)
2 changes: 1 addition & 1 deletion markdown/extensions/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DeleteExtension(Extension):

def extendMarkdown(self, md, md_globals):
"""Add support for <del>test</del> tags as ~~test~~"""

md.ESCAPED_CHARS.append('~')
md.inlinePatterns.add("del", SimpleTagPattern(RE_DEL, "del"), "<not_strong")


Expand Down
Loading

0 comments on commit 931b4b3

Please sign in to comment.