diff options
Diffstat (limited to 'docs/internals.txt')
| -rw-r--r-- | docs/internals.txt | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/docs/internals.txt b/docs/internals.txt index 7a38f27..14de433 100644 --- a/docs/internals.txt +++ b/docs/internals.txt @@ -1,3 +1,10 @@ +.. title: Nikola Internals +.. slug: internals +.. date: 2012/03/30 23:00 +.. tags: +.. link: +.. description: + Nikola Internals ================ @@ -16,14 +23,15 @@ Nikola is a Pile of Plugins an existing one. There are several kinds of plugins, all implementing interfaces defined in - ``nikola/plugin_categories.py``. + ``nikola/plugin_categories.py`` and documented in + `Extending Nikola <http://getnikola.com/extending.html>`_ If your plugin has a dependency, please make sure it doesn't make Nikola throw an exception when the dependency is missing. Try to fail gracefully with an informative message. Commands are plugins - When you use ``nikola foo`` you are using the plugin ``command_foo``. Those are + When you use ``nikola foo`` you are using the plugin ``command/foo``. Those are used to extend Nikola's command line. Their interface is defined in the ``Command`` class. They take options and arguments and do whatever you want, so go wild. @@ -36,7 +44,7 @@ The Build Command Nikola's goal is similar, deep at heart, to a Makefile. Take sources, compile them into something, in this case a website. Instead of a Makefile, Nikola uses -`doit <http://pydoit.com>`_ +`doit <http://pydoit.org>`_ Doit has the concept of "tasks". The 1 minute summary of tasks is that they have: @@ -77,8 +85,8 @@ one of the existing ones. You can do doctests, you can do unit tests, you can do integration tests. There is support for all of them. -Post and Stories ----------------- +Posts and Stories +----------------- Nikola has a concept of posts and stories. Both are more or less the same thing, except posts are added into RSS feeds and stories are not. All of them are in a list called @@ -100,17 +108,19 @@ the timeline, because it will cause consistency issues. Your plugin can use the timeline to generate "stuff" (technical term). For example, Nikola comes with plugins that use the timeline to create a website (surprised?). -The workflow included with nikola is as follows: +The workflow included with nikola is as follows (incomplete!): -#. The post is assigned a compiler based on its extension and the ``post_compilers`` option. +#. The post is assigned a compiler based on its extension and the ``COMPILERS`` option. #. The compiler is applied to the post data and a "HTML fragment" is produced. That - fragment is stored in a cache (the ``render_posts`` plugin). + fragment is stored in a cache (the ``posts`` plugin). #. The configured theme has templates (and a template engine), which are applied to the post's - HTML fragment and metadata (the ``render_pages`` plugin). -#. The original sources for the post are copied to some accessible place (the ``render_sources`` plugin) -#. If the post is tagged, some pages and RSS feeds for each tag are updated (the ``render_tags`` plugin) -#. If the post is new, it's included in the blog's RSS feed (the ``render_rss`` plugin) -#. The post is added in the right place in the index pages for the blog (the ``task_indexes`` plugin) + HTML fragment and metadata (the ``pages`` plugin). +#. The original sources for the post are copied to some accessible place (the ``sources`` plugin) +#. If the post is tagged, some pages and RSS feeds for each tag are updated (the ``tags`` plugin) +#. If the post is new, it's included in the blog's RSS feed (the ``rss`` plugin) +#. The post is added in the right place in the index pages for the blog (the ``indexes`` plugin) +#. CSS/JS/Images for the theme are put in the right places (the ``copy_assets`` and ``bundles`` plugins) +#. A File describing the whole site is created (the ``sitemap`` plugin) You can add whatever you want to that list: just create a plugin for it. @@ -128,4 +138,3 @@ themes To change how the generated site looks, you can create custom themes. And of course, you can also replace or extend each of the existing plugins. - |
