This is a Django CMS Plugin to port Simple Markdown editor, based in:
Support:
- Live editing
- Live preview
- Code snippets
pip install djcms_markdown
In settings.py
INSTALLED_APPS = (
# ...
'djcms_markdown',
)
Add defult code styles:
p code {
font-family: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,sans-serif;
background: #282a36;
color: #ececec;
vertical-align: middle;
white-space: pre-wrap;
font-size: 0.8em;
line-height: 1em;
border-radius: 4px 4px 4px 4px;
-moz-border-radius: 4px 4px 4px 4px;
-webkit-border-radius: 4px 4px 4px 4px;
border: 1px solid #303030;
padding: 0.2rem 0.3rem 0.1rem;
}
styles
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/dracula.min.css">
More style in highlight.js [repo].(https://github.com/isagalaev/highlight.js/tree/master/src/styles)
highlight.js
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
highlight.js init
<script>
$(document).ready(function () {
$('pre code').each(function (i, block) {
hljs.highlightBlock(block);
});
});
</script>
python setup.py test