Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getnikola/nikola
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1d90dfc7e637
Choose a base ref
...
head repository: getnikola/nikola
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 72433448dfee
Choose a head ref
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 24, 2015

  1. Proofread: fix typos, grammar, markup

    I noticed a typo which broke formatting (line 259), and while fixing
    that I tidied up some other bits.
    jean committed Dec 24, 2015
    Copy the full SHA
    5dcba82 View commit details
  2. Missed the original typo!

    jean committed Dec 24, 2015
    Copy the full SHA
    46a48e2 View commit details
  3. Merge pull request #2197 from jean/proofread-extending

    Proofread: fix typos, grammar, markup
    Kwpolska committed Dec 24, 2015
    Copy the full SHA
    7243344 View commit details
Showing with 16 additions and 14 deletions.
  1. +16 −14 docs/extending.txt
30 changes: 16 additions & 14 deletions docs/extending.txt
Original file line number Diff line number Diff line change
@@ -172,8 +172,8 @@ TemplateSystem Plugins
----------------------

Nikola supports Mako and Jinja2. If you prefer some other templating
system, then you will have to write a TemplateSystem plugin. Here's how they work.
First, you have to create a .plugin file. Here's the one for the Mako plugin:
system, then you will have to write a ``TemplateSystem`` plugin. Here's how they work.
First, you have to create a ``.plugin`` file. Here's the one for the Mako plugin:

.. code-block:: ini

@@ -253,10 +253,10 @@ Task Plugins
------------

If you want to do something that depends on the data in your site, you
probably want to do a Task plugin, which will make it be part of the
``nikola build`` command. There are the currently available tasks, all
probably want to do a ``Task`` plugin, which will make it be part of the
``nikola build`` command. These are the currently available tasks, all
provided by plugins:
T

.. sidebar:: Other Tasks

There are also ``LateTask`` plugins, which are executed later,
@@ -380,7 +380,7 @@ They must provide:
If the compiler produces something other than HTML files, it should also implement ``extension`` which
returns the preferred extension for the output file.

These plugins can also be used to extract metadata from file. To do so, the
These plugins can also be used to extract metadata from a file. To do so, the
plugin may implement ``read_metadata`` that will return a dict containing the
metadata contained in the file.

@@ -389,25 +389,27 @@ RestExtension Plugins

Implement directives for reStructuredText, see `media.py <https://github.com/getnikola/nikola/blob/master/nikola/plugins/compile/rest/media.py>`__ for a simple example.

If your output depends on a config value, you need to make your post record a dependency on a pseudo-path, like this:
If your output depends on a config value, you need to make your post record a
dependency on a pseudo-path, like this:

.. code-block:: text

####MAGIC####CONFIG:OPTIONNAME

Then, whenever the ``OPTIONNAME`` option is changed in conf.py, the file will be rebuilt.

If your directive depends or may depend on the whole timeline (like the post-list directive, where adding new posts
to the site could make it stale), you should record a dependency on the
pseudo-path ``####MAGIC####TIMELINE``.
If your directive depends or may depend on the whole timeline (like the
``post-list`` directive, where adding new posts to the site could make it
stale), you should record a dependency on the pseudo-path
``####MAGIC####TIMELINE``.

MarkdownExtension Plugins
-------------------------

Implement Markdown extensions, see `mdx_nikola.py <https://github.com/getnikola/nikola/blob/master/nikola/plugins/compile/markdown/mdx_nikola.py>`__ for a simple example.

Note that python markdown extensions are often also available as separate packages. This is only meant to ship extensions
along with Nikola.
Note that Python markdown extensions are often also available as separate
packages. This is only meant to ship extensions along with Nikola.

SignalHandler Plugins
---------------------
@@ -477,7 +479,7 @@ Path/Link Resolution Mechanism

Any plugin can register a function using ``Nikola.register_path_handler`` to
allow resolution of paths and links. These are useful for templates, which
can access them via _link.
can access them via ``_link``.

For example, you can always get a link to the path for the feed of the "foo" tag
by using ``_link('tag_rss', 'foo')`` or the ``link://tag_rss/foo`` URL.
@@ -529,7 +531,7 @@ HTML:


The second argument to ``append()`` is used to determine whether the function
needs access to the current template context and the site. If it it set to
needs access to the current template context and the site. If it is set to
``True``, the function will also receive ``site`` and ``context`` keyword
arguments. Example use: