From 58c4878526dec5510f23c812274686787d8724ba Mon Sep 17 00:00:00 2001 From: Agustin Henze Date: Fri, 13 Jun 2014 21:51:02 -0300 Subject: Imported Upstream version 7.0.1 --- docs/creating-a-theme.txt | 8 +- docs/extending.txt | 68 +++++++++- docs/getting-help.txt | 2 +- docs/internals.txt | 2 +- docs/man/nikola.1 | 23 +--- docs/manual.txt | 335 +++++++++++++++++++--------------------------- docs/social_buttons.txt | 13 +- docs/sphinx/conf.py | 94 ++++++------- docs/theming.txt | 4 +- docs/upgrading-to-v6.txt | 4 +- 10 files changed, 272 insertions(+), 281 deletions(-) (limited to 'docs') diff --git a/docs/creating-a-theme.txt b/docs/creating-a-theme.txt index 40a4566..220a8e7 100644 --- a/docs/creating-a-theme.txt +++ b/docs/creating-a-theme.txt @@ -1,6 +1,6 @@ .. title: Creating a Theme .. slug: creating-a-theme -.. date: 2012/03/13 12:00 +.. date: 2012-03-13 12:00:00 UTC-03:00 .. tags: .. link: .. description: @@ -107,7 +107,7 @@ The general page layout for the theme is done by the ``base.tmpl`` template, whi
  • ${base.html_translations()}
  • %endif - % if not hide_sourcelink: + % if show_sourcelink:
  • <%block name="sourcelink">
  • %endif @@ -131,7 +131,7 @@ The general page layout for the theme is done by the ``base.tmpl`` template, whi ${bootstrap.late_load_js()} ${base.html_social()} - + <%block name="extra_js"> ${body_end} diff --git a/docs/extending.txt b/docs/extending.txt index fb216c5..f8b685a 100644 --- a/docs/extending.txt +++ b/docs/extending.txt @@ -1,6 +1,6 @@ .. title: Extending Nikola .. slug: extending -.. date: 2012/03/30 23:00 +.. date: 2012-03-30 23:00:00 UTC-03:00 .. tags: .. link: .. description: @@ -8,7 +8,7 @@ Extending Nikola ================ -:Version: 6.4.0 +:Version: 7.0.1 :Author: Roberto Alsina .. class:: alert alert-info pull-right @@ -369,6 +369,11 @@ RestExtension Plugins Implement directives for reStructuredText, see ``media.py`` for a simple example. +MarkdownExtension Plugins +------------------------- + +Implement Markdown extensions, see ``mdx_nikola.py`` for a simple example. + SignalHandler Plugins --------------------- @@ -383,15 +388,17 @@ Currently Nikola emits the following signals: ``sighandlers_loaded`` Right after SignalHandler plugin activation. ``initialized`` - Right after plugin activation. + When all tasks are loaded. ``configured`` When all the configuration file is processed. Note that plugins are activated before this is emitted. +``scanned`` + After posts are scanned. ``new_post`` When a new post is created, using the ``nikola new_post`` command. The signal data contains the path of the file, and the metadata file (if there is one). ``deployed`` When the ``nikola deploy`` command is run, and there is at least one new - entry/post since ``last_deploy``. The signal data is of the form :: + entry/post since ``last_deploy``. The signal data is of the form:: { 'last_deploy: # datetime object for the last deployed time, @@ -436,3 +443,56 @@ Here's the relevant code from the tag plugin. self.site.config['TAG_PATH'], self.slugify_name(name) + ".xml"] if _f] +Template Hooks +============== + +Plugins can use a hook system for adding stuff into templates. In order to use +it, a plugin must register itself. The following hooks currently exist: + +* ``extra_head`` (not equal to the config option!) +* ``body_end`` (not equal to the config option!) +* ``page_header`` +* ``menu`` +* ``menu_alt`` (right-side menu in bootstrap, after ``menu`` in base) +* ``page_footer`` + +For example, in order to register a script into ``extra_head``: + +.. code-block:: python + + # In set_site + site.template_hooks['extra_head'].append(' - - - """ - - EXTRA_HEAD_DATA = """ - -
    - """ - - ENABLED_EXTRAS = [ 'local_search' ] - - -The
    in EXTRA_HEAD_DATA is a hack but it will migrate into the of the -documents thanks to magic, and will hold the search results after the user searches. - -Mustache -~~~~~~~~ - -This task gives you a ``mustache.html`` file which lets you access your whole -blog without reloading the page, using client-side templates. Makes it much -faster and modern ;-) - Custom Plugins -------------- @@ -1623,10 +1528,10 @@ Getting Extra Plugins If you want extra plugins, there is also the `Plugins Index `_. -Similarly to themes, there is a nice, built-in command to install them — -``install_plugin``:: +Similarly to themes, there is a nice, built-in command to manage them — +``plugin``:: - $ nikola install_plugin -l + $ nikola plugin -l Plugins: -------- helloworld @@ -1634,7 +1539,7 @@ Similarly to themes, there is a nice, built-in command to install them — ⋮ ⋮ - $ nikola install_plugin helloworld + $ nikola plugin --install helloworld [2013-10-12T16:51:56Z] NOTICE: install_plugin: Downloading: http://plugins.getnikola.com/v6/helloworld.zip [2013-10-12T16:51:58Z] NOTICE: install_plugin: Extracting: helloworld into plugins plugins/helloworld/requirements.txt @@ -1649,6 +1554,29 @@ Similarly to themes, there is a nice, built-in command to install them — # Should the Hello World plugin say “BYE” instead? BYE_WORLD = False +Then you also can uninstall your plugins:: + + $ nikola plugin --uninstall tags + [2014-04-15T08:59:24Z] WARNING: plugin: About to uninstall plugin: tags + [2014-04-15T08:59:24Z] WARNING: plugin: This will delete /home/ralsina/foo/plugins/tags + Are you sure? [y/n] y + [2014-04-15T08:59:26Z] WARNING: plugin: Removing /home/ralsina/foo/plugins/tags + +And upgrade them:: + + $ nikola plugin --upgrade + [2014-04-15T09:00:18Z] WARNING: plugin: This is not very smart, it just reinstalls some plugins and hopes for the best + Will upgrade 1 plugins: graphviz + Upgrading graphviz + [2014-04-15T09:00:20Z] INFO: plugin: Downloading: http://plugins.getnikola.com/v7/graphviz.zip + [2014-04-15T09:00:20Z] INFO: plugin: Extracting: graphviz into /home/ralsina/.nikola/plugins/ + [2014-04-15T09:00:20Z] NOTICE: plugin: This plugin has third-party dependencies you need to install manually. + Contents of the requirements-nonpy.txt file: + + Graphviz + http://www.graphviz.org/ + + You have to install those yourself or through a package manager. You can also share plugins you created with the community! Visit the `GitHub repository `__ to find out more. @@ -1657,6 +1585,19 @@ You can use the plugins in this repository without installing them into your site, by cloning the repository and adding the path of the plugins directory to the ``EXTRA_PLUGINS_DIRS`` list in your configuration. +Shell Tab Completion +-------------------- + +Since Nikola is a command line tool, and this is the 21st century, it's handy to have smart tab-completion +so that you don't have to type the full commands. + +To enable this, you can use the ``nikola tabcompletion`` command like this, depending on your shell:: + + $ nikola tabcompletion --shell bash --hardcode-tasks > _nikola_bash + $ nikola tabcompletion --shell zsh --hardcode-tasks > _nikola_zsh + +The ``--hardcode-tasks`` adds tasks to the completion and may need updating periodically. + License ------- diff --git a/docs/social_buttons.txt b/docs/social_buttons.txt index de7fecf..1d6c5b5 100644 --- a/docs/social_buttons.txt +++ b/docs/social_buttons.txt @@ -1,6 +1,6 @@ .. title: Alternative Social Buttons .. slug: social_buttons -.. date: 2013/08/19 23:00 +.. date: 2013-08-19 23:00:00 UTC-03:00 .. tags: .. link: .. description: @@ -8,7 +8,7 @@ Using Alternative Social Buttons with Nikola ============================================ -:Version: 6.4.0 +:Version: 7.0.1 .. class:: alert alert-info pull-right @@ -33,7 +33,7 @@ the bottom right of the page, provided by Addthis. This is the HTML code for tha
  • - + """ @@ -96,8 +96,7 @@ is the HTML code suggested by ShareNice: data-services="plus.google.com,facebook.com,digg.com,email,delicious.com,twitter.com" style="float:right">""" - BODY_END = """""" + BODY_END = """""" And you should now see a sharing box at the bottom right of the page. @@ -169,8 +168,8 @@ Edit your ``conf.py``: .. code-block:: python BODY_END = """ - - +