- français
- English
Markdown On EPFL wiki
## About
This is an attempt to use markdown as input on EPFL wiki. This works with showdown/pagedown javascript and it's far to be perfect !
## Issues
- There is no "nl2br" like function when editing the source (means you have to save page elsewhere, have you heard about [zim](http://www.zim-wiki.org/). Or copy paste your text before saving.
- The ampersand sign & is not converted.
- Titles after pre do not always display properly.
## Improvements
- It should be possible to have a live preview from the textaera
## How it works
### The div
Your page must have a div with your markdonw text. The div's ID have to be "divmarkdown".
### The javascript
It's using showdown: http://mathiasbynens.be/notes/showdown-javascript-jquery
You will need to include the main script file [Markdown.Converter.js](https://code.google.com/p/pagedown/source/browse/Markdown.Converter.js) and, to avoid XSS vulnerabilities, the sanitizer [Markdown.Sanitizer.js](https://code.google.com/p/pagedown/source/browse/Markdown.Sanitizer.js) to your wiki. Go to Administration > Advanced options > " tag content" and add:
< script src="https://wiki.epfl.ch/igmit/documents/Markdown.Converter.js"> < script src="https://wiki.epfl.ch/igmit/documents/Markdown.Sanitizer.js">In the footer content, add:
< script> (function() { var content = document.getElementById('divmarkdown'), convert = new Markdown.getSanitizingConverter().makeHtml; if (content) { content.innerHTML = convert(content.innerHTML); } }()); < /script>###The CSS Go to Administration > Advanced options > " tag content" and add:
< style> #header2013 { display: none; visibility: hidden; } body{ font-family: Georgia, Palatino, serif; color: #444444; } a { color: #0099ff; margin: 0; padding: 0; vertical-align: baseline; } pre { padding: 0px 24px; max-width: 800px; white-space: pre-wrap; } code { font-family: Consolas, Monaco, Andale Mono, monospace; line-height: 1.5; font-size: 13px; } blockquote { margin: 1em 2em; max-width: 476px; } blockquote p { color: #666; max-width: 460px; } < /style>