Snippet List
### Simple wiki with MediaWiki and Markdown Support
Once you install the mwlib you can use mwit to convert Mediawiki markup to HTML. I am include the model that uses it to hopefully provide a good example. I maintain a version and only one copy of each wiki entry in the main table and archive replaced markup into another table, you will need to create the archive model or remove that section of code. The line ending changes in mwit are so that it will work with IE.
- markup
- markdown
- mediawiki
- wiki
- archive
**updated 12/16/08**
I run several blogs by visual-artists and web-designers who want a quick way to insert images into their blog without the awkwardness of WSYIWYG and without the technicality of code (eww...).
Thanks in advance for your input.
#Syntax in a blog goes:
[[thumb:the-image-slug]] # Gives you a thumbnail
[[image:the-image-slug]] # Presents full-size-image
Then of course:
{% blog.post|yeagowiki %}
You will also need to create some templates (see snippet). Here's a sample:
<!-- /templates/photologue/image_snippet.html -->
<div class="photologue-image">
<a href="{% if url %}{{ url }}{% else %}/media/{{ image.image }}{% endif %}">
<img src="{{ image.get_display_url }}" />
</a>
<p class="photologue-image-caption">{{ image.caption }}</p>
</div>
- templatetag
- markdown
- wiki
- photologue
I wanted to have the possibility to use a wiki-like markup style in my flatpages for various purposes (embedding images, quoting, etc.)
After a few dead ends I came up with this, which is quite nice I think.
> It basically takes a named tag, loads the corresponding template, passes in all arguments, renders the template and replaces the named tag with the result.
*The markup looks like this:*
> [[example:value to pass|option1=somevalue option2=values can have spaces too! without having to put them in quotes option3=some other value]]
*This results in:*
* Filter tries to load wiki/wiki_example.html
* If it is loaded, it passes an WikiElement containing the value and the options to the template, renders it and replaces the tag with the rendered template
*In the "wiki/wiki_example.html" template you can use it like this:*
{{param.value}}
{{param.opts.option1}}
Or loop over param.opts.iteritems.
- template
- filter
- markup
- wiki
3 snippets posted so far.