Support for pygment defaults and relevant documentation

This commit is contained in:
SDGSDG 2013-09-15 22:43:24 -07:00
commit 3580233b38
21 changed files with 288 additions and 33 deletions

View file

@ -12,9 +12,20 @@ Testing sourcecode directive
----------------------------
.. sourcecode:: python
:linenos:
:linenos:
formatter = self.options and VARIANTS[self.options.keys()[0]]
formatter = self.options and VARIANTS[self.options.keys()[0]]
Testing another case
--------------------
This will now have a line number in 'custom' since it's the default in
pelican.conf, it will have nothing in default.
.. sourcecode:: python
formatter = self.options and VARIANTS[self.options.keys()[0]]
Lovely.
@ -71,3 +82,17 @@ Testing even more sourcecode directives
Lovely.
Testing overriding config defaults
----------------------------------
Even if the default is line numbers, we can override it here
.. sourcecode:: python
:linenos: none
formatter = self.options and VARIANTS[self.options.keys()[0]]
Lovely.

View file

@ -48,6 +48,9 @@ STATIC_PATHS = [
# custom page generated with a jinja2 template
TEMPLATE_PAGES = {'pages/jinja2_template.html': 'jinja2_template.html'}
# code blocks with line numbers
PYGMENTS_RST_OPTIONS = {'linenos': 'table'}
# foobar will not be used, because it's not in caps. All configuration keys
# have to be in caps
foobar = "barbaz"