Login

Snippets by blinks

Snippet List

An XML-RPC Decorator

Drop this package wherever you want, import the decorator, and use it with one argument to decorate any function you want (`@xmlrpc('pingback.ping')`). That function is now available on your XML-RPC interface, available through this view. Make sure to provide the view (`call_xmlrpc`) with a URL so that it's accessible.

  • xml-rpc
Read More

Markdown and Syntax Highlighting in Django

This is a [Django template tag](http://www.djangoproject.com/documentation/templates_python/#extending-the-template-system "Extending the template system") that renders an arbitrary block of text with Markdown and [Pygments](http://pygments.org "Syntax highlighter"). Use Markdown as usual, and when you have a code block to insert, put it inside `code` tags, with the language as the class: `<code class='python'>print "Hello, World"</code>` To use it in a template, first `{% load ... %}` the tag library, then `{{ content|render }}` your content. The tag takes one optional argument, to enable safe rendering in markdown. To use it, call `{{ content|render:"safe" }}`.

  • pygments
  • markdown
  • syntax-highlighting
  • template-tag
Read More

blinks has posted 3 snippets.