diff options
| author | 2014-06-13 21:51:04 -0300 | |
|---|---|---|
| committer | 2014-06-13 21:51:04 -0300 | |
| commit | 3dddbd8cc879402c2047919bccd20e6697082657 (patch) | |
| tree | 38d6290f37be1d67d91c46027974e6ee3372e232 /docs | |
| parent | 7ac2cf148f7a8ea0de126fed3360b49964ce9b45 (diff) | |
| parent | 58c4878526dec5510f23c812274686787d8724ba (diff) | |
Merge tag 'upstream/7.0.1'
Upstream version 7.0.1
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/creating-a-theme.txt | 8 | ||||
| -rw-r--r-- | docs/extending.txt | 68 | ||||
| -rw-r--r-- | docs/getting-help.txt | 2 | ||||
| -rw-r--r-- | docs/internals.txt | 2 | ||||
| -rw-r--r-- | docs/man/nikola.1 | 23 | ||||
| -rw-r--r-- | docs/manual.txt | 335 | ||||
| -rw-r--r-- | docs/social_buttons.txt | 13 | ||||
| -rw-r--r-- | docs/sphinx/conf.py | 94 | ||||
| -rw-r--r-- | docs/theming.txt | 4 | ||||
| -rw-r--r-- | docs/upgrading-to-v6.txt | 4 |
10 files changed, 272 insertions, 281 deletions
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 <li>${base.html_translations()}</li> %endif </%block> - % if not hide_sourcelink: + % if show_sourcelink: <li><%block name="sourcelink"></%block></li> %endif </ul> @@ -131,7 +131,7 @@ The general page layout for the theme is done by the ``base.tmpl`` template, whi </div> ${bootstrap.late_load_js()} ${base.html_social()} - <script type="text/javascript">jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true}); + <script>jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true}); $(window).on('hashchange', function(){ if (location.hash && $(location.hash)[0]) { $('body').animate({scrollTop: $(location.hash).offset().top - $('#navbar').outerHeight(true)*1.2 }, 1); @@ -193,7 +193,7 @@ Monospace is a two-column-with-footer layout, so let's copy the basics from its </div> </div> ${bootstrap.late_load_js()} - <script type="text/javascript">jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script> + <script>jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script> <%block name="extra_js"></%block> ${body_end} </body> 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 <ralsina@netmanagers.com.ar> .. 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('<script src="/assets/js/fancyplugin.js">') + +There is also another API available. It allows use of dynamically generated +HTML: + +.. code-block:: python + + # In set_site + def generate_html_bit(name, ftype='js'): + return '<script src="/assets/{t}/{n}.{t}">'.format(n=name, t=ftype) + + site.template_hooks['extra_head'].append(generate_html_bit, False, 'fancyplugin', type='js') + + +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 +``True``, the function will also receive ``site`` and ``context`` keyword +arguments. Example use: + + +.. code-block:: python + + # In set_site + def greeting(addr, endswith='', site=None, context=None): + if context['lang'] == 'en': + greet = u'Hello' + elif context['lang'] == 'es': + greet = u'¡Hola' + + t = u' BLOG_TITLE = {0}'.format(site.config['BLOG_TITLE'](context['lang'])) + + return u'<h3>{greet} {addr}{endswith}</h3>'.format(greet=greet, addr=addr, + endswith=endswith) + t + + site.template_hooks['page_header'].append(greeting, True, u'Nikola Tesla', endswith=u'!') diff --git a/docs/getting-help.txt b/docs/getting-help.txt index 31edc8d..b36d98c 100644 --- a/docs/getting-help.txt +++ b/docs/getting-help.txt @@ -3,7 +3,7 @@ .. date: 1970-01-01 15:00:00 .. description: Get help using Nikola, or contact us. -:Version: 6.4.0 +:Version: 7.0.1 .. class:: alert alert-info pull-right diff --git a/docs/internals.txt b/docs/internals.txt index 06a2747..a025075 100644 --- a/docs/internals.txt +++ b/docs/internals.txt @@ -1,6 +1,6 @@ .. title: Nikola Internals .. slug: internals -.. date: 2012/03/30 23:00 +.. date: 2012-03-30 23:00:00 UTC-03:00 .. tags: .. link: .. description: diff --git a/docs/man/nikola.1 b/docs/man/nikola.1 index 214a924..0379d29 100644 --- a/docs/man/nikola.1 +++ b/docs/man/nikola.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.44.1. -.TH NIKOLA "1" "March 2014" "nikola 6.4.0" "User Commands" +.TH NIKOLA "1" "June 2014" "nikola 7.0.1" "User Commands" .SH NAME -nikola \- manual page for nikola 6.4.0 +nikola \- manual page for nikola 7.0.1 .SH DESCRIPTION Nikola is a tool to create static websites and blogs. For full documentation and more information, please visit http://getnikola.com/ .SS "Available commands:" @@ -36,36 +36,27 @@ dump dependency DB nikola forget clear successful run status from internal DB .TP +nikola github_deploy +deploy the site to GitHub pages +.TP nikola help show help .TP nikola ignore ignore task (skip) on subsequent runs .TP -nikola import_blogger -import a blogger dump -.TP -nikola import_feed -import a RSS/Atom dump -.TP nikola import_wordpress import a WordPress dump .TP nikola init create a Nikola site in the specified folder .TP -nikola install_plugin -install plugin into current site -.TP nikola install_theme install theme into current site .TP nikola list list tasks from dodo file .TP -nikola mincss -apply mincss to the generated site -.TP nikola new_page create a new page in the site .TP @@ -75,8 +66,8 @@ create a new blog post or site page nikola orphans list all orphans .TP -nikola run -run tasks +nikola plugin +manage plugins .TP nikola serve start the test webserver diff --git a/docs/manual.txt b/docs/manual.txt index ea080bb..dec8ac1 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -1,6 +1,6 @@ .. title: The Nikola Handbook .. slug: handbook -.. date: 2012/03/30 23:00 +.. date: 2012-03-30 23:00:00 UTC-03:00 .. tags: .. link: .. description: @@ -8,7 +8,7 @@ The Nikola Handbook =================== -:Version: 6.4.0 +:Version: 7.0.1 .. class:: alert alert-info pull-right @@ -20,7 +20,7 @@ All You Need to Know After you have Nikola `installed <#installing-nikola>`_: -Create a empty site: +Create a empty site (with a setup wizard): ``nikola init mysite`` You can create a site with demo files in it with ``nikola init --demo mysite`` @@ -151,7 +151,7 @@ Cost and Performance probably serve a bazillion (technical term) pageviews from a phone using static sites. -Lockin +Lock-in On server-side blog platforms, sometimes you can't export your own data, or it's in strange formats you can't use in other services. I have switched blogging platforms from Advogato to PyCs to two homebrew systems, to Nikola, @@ -201,51 +201,23 @@ This is currently lacking on detail. Considering the niche Nikola is aimed at, I suspect that's not a problem yet. So, when I say "get", the specific details of how to "get" something for your specific operating system are left to you. -The short version is: ``pip install nikola`` +The short version is:: -Note that you need Python v2.6 or newer OR v3.3 or newer. - -For some features it may give you an error message telling you that you need to -install something else. For example, if it tells you you need ``requests``:: - - pip install requests - -And so on. Alternatively, you can install the ``requirements-full.txt`` file -shipped with the full source tree to get everything. (or `see the file -online -<https://github.com/getnikola/nikola/blob/master/requirements-full.txt>`_) + pip install nikola -Longer version: - -#. Get `Nikola <http://getnikola.com/>`_ -#. Install dependencies. To do that, either: +Note that you need Python v2.6 or newer OR v3.3 or newer. - #. ``pip install -r requirements.txt`` (or ``requirements-full.txt`` - for extra stuff) and ``pip install .`` or... - #. Install your distribution's packages for all the things - mentioned below, if they exist, or... - #. Get all of these manually (but why?, use pip): +Some features require **extra dependencies**. You can install them all in bulk +by doing:: - #. Get Python, if you don't have it. - #. Get `doit <http://pydoit.org>`_ - #. Get `docutils <http://docutils.sf.net>`_ - #. Get `Mako <http://makotemplates.org>`_ - #. Get `Pillow <http://python-imaging.github.io/>`_ - #. Get `Pygments <http://pygments.org/>`_ - #. Get `unidecode <http://pypi.python.org/pypi/Unidecode/>`_ - #. Get `lxml <http://lxml.de/>`_ - #. Get `yapsy <http://yapsy.sourceforge.net>`_ - #. Get `PyRSS2Gen <http://www.dalkescientific.com/Python/PyRSS2Gen.html>`_ - #. Get `pytz <http://pytz.sourceforge.net/>`_ - #. Get `Logbook <http://pythonhosted.org/Logbook/>`_ - #. Get `blinker <http://pythonhosted.org/blinker/>`_ - #. Get `Setuptools <http://pythonhosted.org/setuptools/>`_ - #. If using Python 2, get `configparser <http://pypi.python.org/pypi/configparser/3.2.0r3>`_ + pip install nikola[extras] -#. run ``python setup.py install`` +Alternatively, you can install those packages one-by-one, when required (Nikola +will tell you what packages are needed) -After that, run ``nikola init --demo sitename`` and that will create a folder called -``sitename`` containing a functional demo site. +After that, run ``nikola init --demo sitename`` and that will run the setup +wizard, which will create a folder called ``sitename`` containing a functional +demo site. Nikola is packaged for some Linux distributions, you may get that instead. e.g. If you are running Arch Linux, there are AUR packages, available in Python 2/3 @@ -415,19 +387,17 @@ Nikola also has other commands besides ``build``:: nikola doit_auto automatically execute tasks when a dependency changes nikola dumpdb dump dependency DB nikola forget clear successful run status from internal DB + nikola github_deploy deploy the site to GitHub pages nikola help show help nikola ignore ignore task (skip) on subsequent runs - nikola import_blogger import a blogger dump - nikola import_feed import a RSS/Atom dump nikola import_wordpress import a WordPress dump nikola init create a Nikola site in the specified folder - nikola install_plugin install plugin into current site nikola install_theme install theme into current site nikola list list tasks from dodo file - nikola mincss apply mincss to the generated site + nikola new_page create a new page in the site nikola new_post create a new blog post or site page nikola orphans list all orphans - nikola run run tasks + nikola plugin manage plugins nikola serve start the test webserver nikola strace use strace to list file_deps and targets nikola tabcompletion generate script for tab-complention @@ -439,11 +409,11 @@ Nikola also has other commands besides ``build``:: The ``serve`` command starts a web server so you can see the site you are creating:: - $ nikola serve + $ nikola serve -b Serving HTTP on 127.0.0.1 port 8000 ... -After you do this, you can point your web browser to http://localhost:8000 and you should see +After you do this, a web browser opens at http://127.0.0.1:8000/ and you should see the sample site. This is useful as a "preview" of your work. By default, the ``serve`` command runs the web server on port 8000 on the IP address 127.0.0.1. @@ -466,9 +436,11 @@ It can be placed in a separate file by using the ``-2`` option, but it's general easier to keep it in a single location. The contents of your post have to be written (by default) in `reStructuredText <http://docutils.sf.net>`__ -but you can use a lot of different markups using the ``-f`` option. Currently -Nikola supports bbcode, wiki, markdown, html, txt2tags and textile in addition -to reStructuredText. +but you can use a lot of different markups using the ``-f`` option. + +Currently Nikola supports reStructuredText, Markdown, IPython Notebooks, HTML as input, +can also use Pandoc for conversion, and has support for BBCode, CreoleWiki, txt2tags, Textile +and more via `plugins <http://plugins.getnikola.com>`__. You can control what markup compiler is used for each file extension with the ``COMPILERS`` option. The default configuration expects them to be placed in ``posts`` but that can be @@ -487,7 +459,7 @@ The content of that file is as follows:: .. title: How to make money .. slug: how-to-make-money - .. date: 2012/09/15 19:52:05 + .. date: 2012-09-15 19:52:05 UTC .. tags: .. link: .. description: @@ -562,10 +534,21 @@ to your configuration:: How to make money how-to-make-money - 2012/09/15 19:52:05 + 2012-09-15 19:52:05 UTC + + However, starting with Nikola v7, you can now use ``.meta`` files and put + all metadata you want, complete with the explanations — they look just like + the beginning of our reST files. + + .. title: How to make money + .. slug: how-to-make-money + .. date: 2012-09-15 19:52:05 UTC + + Both file formats are supported; however, the new format is preferred, if + possible. If you are writing a multilingual site, you can also create a per-language -post file (for example: ``how-to-make-money.txt.es`` with the default TRANSLATIONS_PATTERN, see below). +post file (for example: ``how-to-make-money.es.txt`` with the default TRANSLATIONS_PATTERN, see below). This one can replace metadata of the default language, for example: * The translated title for the post or page @@ -574,20 +557,13 @@ This one can replace metadata of the default language, for example: The pattern used for finding translations is controlled by the TRANSLATIONS_PATTERN variable in your configuration file. -The default as in the example above is to append the language code to the -filename path to identify a translation of a file, so the German translation -of ``some_file.rst`` should be named ``some_file.rst.de``. This is because -the TRANSLATIONS_PATTERN variable is by default set to:: - - TRANSLATIONS_PATTERN = "{path}.{ext}.{lang}" - -However, if you don't want your Polish input files to be considered -Perl code (e.g. ``some_file.rst.pl``), you could use this pattern:: +The default is to put the language code before the file extension, +so the German translation of ``some_file.rst`` should be named +``some_file.de.rst``. This is because the TRANSLATIONS_PATTERN variable is by +default set to:: TRANSLATIONS_PATTERN = "{path}.{lang}.{ext}" -Note that this pattern will become the default in v7.0.0. - .. note:: Considered languages nikola will only look for translation of input files for languages @@ -596,7 +572,7 @@ Note that this pattern will become the default in v7.0.0. You can edit these files with your favourite text editor, and once you are happy with the contents, generate the pages as explained in `Getting Started`_ -Currently supported languages are +Currently supported languages are: * Basque * Bulgarian @@ -612,14 +588,16 @@ Currently supported languages are * French * German * Greek +* Hindi * Italian * Japanese * Norwegian Bokmål * Persian * Polish -* Portuguese +* Portuguese (Brasil) * Russian -* Slovenian +* Slovak +* Slovene * Spanish * Turkish * Urdu @@ -640,7 +618,7 @@ and ``PAGES`` configuration options:: # # That fragment could have an associated metadata file (whatever/thing.meta), # and optionally translated files (example for Spanish, with code "es"): - # whatever/thing.txt.es and whatever/thing.meta.es + # whatever/thing.es.txt and whatever/thing.es.meta # # This assumes you use the default TRANSLATIONS_PATTERN. # @@ -744,10 +722,10 @@ published immediately. Posts dated in the future are *not* deployed by default deployed site, you can set ``DEPLOY_FUTURE = True`` in your configuration. Generally, you want FUTURE_IS_NOW and DEPLOY_FUTURE to be the same value. -Retired Posts -~~~~~~~~~~~~~ +Private (formerly retired) Posts +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you add a "retired" tag to a post, then it will not be shown in indexes and feeds. +If you add a "private" tag to a post, then it will not be shown in indexes and feeds. It *will* be compiled, and if you deploy it it *will* be made available, so it will not generate 404s for people who had linked to it. @@ -792,15 +770,6 @@ All these posts get queued up according to your schedule, but note that you will anyway need to build and deploy your site for the posts to appear online. You can have a cron job that does this regularly. -An additional setting (``SCHEDULE_FORCE_TODAY = True``) lets you tell -Nikola to make the post today, if you run the ``new_post --schedule`` -after the scheduled hour has passed, and there is no other post -at/after the scheduled hour. Concretely, say, you run the ``nikola -new_post -s`` command at 10am on a Monday (with the schedule rule set -to the same as above), with no other post on Monday, at/after 7am, -setting ``SCHEDULE_FORCE_TODAY = True`` will have your post scheduled -to Monday, instead of being scheduled to Wednesday 7am. - Post Types ~~~~~~~~~~ @@ -865,11 +834,17 @@ commented. You surely want to edit these options:: # Data about this site - BLOG_TITLE = "Demo Site" - SITE_URL = "http://getnikola.com" + BLOG_AUTHOR = "Your Name" # (translatable) + BLOG_TITLE = "Demo Site" # (translatable) + SITE_URL = "http://getnikola.com/" BLOG_EMAIL = "joe@demo.site" - BLOG_DESCRIPTION = "This is a demo site for Nikola." + BLOG_DESCRIPTION = "This is a demo site for Nikola." # (translatable) +Some options are demarked with a (translatable) comment above or right next to +them. For those options, two types of values can be provided: + + * a string, which will be used for all languages + * a dict of language-value pairs, to have different values in each language Customizing Your Site --------------------- @@ -887,11 +862,11 @@ CSS tweaking with a `custom theme <theming.html>`__. If you want to use LESS_ or Sass_ for your custom CSS, or the theme you use - contains LESS or Sass code that you want to override, create a ``less`` or + contains LESS or Sass code that you want to override, you will need to install + the `LESS plugin <http://plugins.getnikola.com/#less>`__ or + `SASS plugin <http://plugins.getnikola.com/#sass>`__ create a ``less`` or ``sass`` directory in your site root, put your ``.less`` or ``.scss`` files - there and a targets file containing the files you want compiled. Any - ``.less`` or ``.scss`` files from the theme chain that you want to use will - need to be included in your files. + there and a targets file containing the list of files you want compiled. .. _LESS: http://lesscss.org/ .. _Sass: http://sass-lang.com/ @@ -931,7 +906,9 @@ Navigation Links Footer ``CONTENT_FOOTER`` is displayed, small at the bottom of all pages, I use it for the copyright notice. The default shows a text formed using ``BLOG_AUTHOR``, - ``BLOG_EMAIL``, the date and ``LICENSE``. + ``BLOG_EMAIL``, the date and ``LICENSE``. Note you need to use + ``CONTENT_FOOTER_FORMATS`` instead of regular str.format or %-formatting, + for compatibility with the translatable settings feature. BODY_END This option lets you define a HTML snippet that will be added at the bottom of body. @@ -975,8 +952,8 @@ Nikola has a built-in theme download/install mechanism to install those themes $ nikola install_theme -l Themes: ------- - base-jinja blogtxt + bootstrap3-gradients ⋮ ⋮ @@ -1032,6 +1009,34 @@ Other interesting ideas are using for that matter), using `lftp mirror <http://lftp.yar.ru/>`_ or unison, or Dropbox, or Ubuntu One. Any way you can think of to copy files from one place to another is good enough. +Deploying to GitHub +~~~~~~~~~~~~~~~~~~~ + +Nikola provides a separate command ``github_deploy`` to deploy your +site to GitHub pages. The command builds the site, commits the +output to a gh-pages branch and pushes the output to GitHub. + +The branch to use for committing the sources can be changed using the +``GITHUB_DEPLOY_BRANCH`` option in your config. For a +user.github.io/organization.github.io, this MUST be set to ``master``, +and the branch containing the sources must be changed to something +else, like ``deploy``, using the ``GITHUB_SOURCE_BRANCH`` option. The +remote name to which the changes are pushed is ``origin`` by default, +and can be changed using the ``GITHUB_REMOTE_NAME`` option. You also, +obviously, need to have ``git`` on your PATH, and should be able to +push to the repository specified as the remote. + +This command performs the following actions, when it is run: + +1. Ensure that your site is a git repository, and git is on the PATH. +2. Check for changes, and prompt the user to continue, if required. +3. Build the site +4. Clean any files that are "unknown" to Nikola. +5. Create a deploy branch, if one doesn't exist. +6. Commit the output to this branch. (NOTE: Any untracked source + files, may get committed at this stage, on the wrong branch!) +7. Push and deploy! + Comments and Annotations ------------------------ @@ -1219,9 +1224,6 @@ optipng jpegoptim Compress JPEG files using `jpegoptim <http://www.kokkonen.net/tjko/projects.html>`_ -tidy - Apply `tidy <http://tidy.sourceforge.net/>`_ to HTML files - typogrify Improve typography using `typogrify <https://github.com/mintchaos/typogrify>`_ @@ -1238,7 +1240,7 @@ different ones, or about other web servers, please share! #. Enable compression in Apache:: - AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css + AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript #. If even after you did the previous step the CSS files are not sent compressed:: @@ -1513,103 +1515,6 @@ and the authors Twitter user ID is found below. } -Extra Plugins -------------- - -These are plugins that may not be widely used or that are a bit too radical or -experimental for the general public. - -To enable them for your site please look for `ENABLED_EXTRAS` in your ``conf.py``. - -Planetoid -~~~~~~~~~ - -This plugin converts Nikola into the equivalent of `Planet <http://www.planetplanet.org/>`_ -a feed aggregator. It requires `PeeWee <https://github.com/coleifer/peewee>`_ and -`Feedparser <http://code.google.com/p/feedparser/>`_ to work. - -It has a configuration option: PLANETOID_REFRESH which is the number of minutes -before retrying a feed (defaults to 60). - -You need to create a ``feeds`` file containing the data of which feeds you want to -aggregate. The format is very simple:: - - # Roberto Alsina - http://feeds2.feedburner.com/PostsInLateralOpinionAboutPython - Roberto Alsina - -#. Lines that start with ``#`` are comments and ignored. -#. Lines that start with http are feed URLs. -#. URL lines have to be followed by the "real name" of the feed. - -After all that is in place, just run ``nikola build`` and you'll get -a planet. -If you run ``nikola build`` for the first time you need to actually issue -the command three times until the planet is build. - -There is a special theme for the planets called `site-planetoid`. To use -this set `THEME` in your ``conf.py`` to ``'site-planetoid'``. -This is special in the case that it redirects users to the original URL of the post -when they try to open a post. - -Local Search -~~~~~~~~~~~~ - -If you don't want to depend on Google or DuckDuckGo to implement search for you, -or just want it to work even if you are offline, enable this plugin and the -search will be performed client side. - -This plugin implements a Tipue-based local search for your site. - -To use it, enable local_search in ENABLED_EXTRAS in your sites conf.py - -After you build your site, you will have several new files in assets/css and assets/js -and a tipue_search.html that you can use as a basis for using this in your site. - -For more information about how to customize it and use it, please refer to the tipue -docs at http://www.tipue.com/search/ - -Tipue is under an MIT license (see MIT-LICENSE.txt) - -Here's a set of example settings for conf.py that should work nicely with the "bootstrap" theme:: - - SEARCH_FORM = """ - <span class="navbar-form pull-left"> - <input type="text" id="tipue_search_input"> - </span>""" - - BODY_END = """ - <script type="text/javascript" src="/assets/js/tipuesearch_set.js"></script> - <script type="text/javascript" src="/assets/js/tipuesearch.js"></script> - <script type="text/javascript"> - $(document).ready(function() { - $('#tipue_search_input').tipuesearch({ - 'mode': 'json', - 'contentLocation': '/assets/js/tipuesearch_content.json', - 'showUrl': false - }); - }); - </script> - """ - - EXTRA_HEAD_DATA = """ - <link rel="stylesheet" type="text/css" href="/assets/css/tipuesearch.css"> - <div id="tipue_search_content" style="margin-left: auto; margin-right: auto; padding: 20px;"></div> - """ - - ENABLED_EXTRAS = [ 'local_search' ] - - -The <div> in EXTRA_HEAD_DATA is a hack but it will migrate into the <body> 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 <http://plugins.getnikola.com/>`_. -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 <https://github.com/getnikola/plugins>`__ 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 <li><a class="addthis_button_twitter"></a> </ul> </div> - <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f7088a56bb93798"></script> + <script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f7088a56bb93798"></script> <!-- End of social buttons --> """ @@ -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"></div>""" - BODY_END = """<script src="http://graingert.co.uk/shareNice/code.js" - type="text/javascript"></script>""" + BODY_END = """<script src="http://graingert.co.uk/shareNice/code.js"></script>""" 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 = """ - <script type="text/javascript" src="/javascripts/jquery.socialshareprivacy.min.js"></script> - <script type="text/javascript"> + <script src="/javascripts/jquery.socialshareprivacy.min.js"></script> + <script> $(document).ready(function () { $('.share').socialSharePrivacy(); }); diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index faf2db1..20a0578 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -15,12 +15,12 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' from __future__ import unicode_literals @@ -40,7 +40,7 @@ templates_path = ['_templates'] source_suffix = '.txt' # The encoding of source files. -#source_encoding = 'utf-8-sig' +# source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' @@ -54,19 +54,19 @@ copyright = '2012-2014, The Nikola Contributors' # built documents. # # The short X.Y version. -version = '6.4.0' +version = '7.0.1' # The full version, including alpha/beta/rc tags. -release = '6.4.0' +release = '7.0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -74,27 +74,27 @@ exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all # documents. -#default_role = None +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False +# keep_warnings = False # -- Options for HTML output ---------------------------------------------- @@ -106,26 +106,26 @@ html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". -#html_title = None +# html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +# html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -135,48 +135,48 @@ html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -#html_extra_path = [] +# html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'Nikoladoc' @@ -186,13 +186,13 @@ htmlhelp_basename = 'Nikoladoc' latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', + # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', + # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. - #'preamble': '', + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples @@ -205,23 +205,23 @@ latex_documents = [ # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None +# latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -#latex_use_parts = False +# latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# latex_domain_indices = True # -- Options for manual page output --------------------------------------- @@ -234,7 +234,7 @@ man_pages = [ ] # If true, show URL addresses after external links. -#man_show_urls = False +# man_show_urls = False # -- Options for Texinfo output ------------------------------------------- @@ -249,15 +249,15 @@ texinfo_documents = [ ] # Documents to append as an appendix to all manuals. -#texinfo_appendices = [] +# texinfo_appendices = [] # If false, no module index is generated. -#texinfo_domain_indices = True +# texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' +# texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False +# texinfo_no_detailmenu = False primary_domain = None diff --git a/docs/theming.txt b/docs/theming.txt index b370948..bc5ad1f 100644 --- a/docs/theming.txt +++ b/docs/theming.txt @@ -1,6 +1,6 @@ .. title: Theming Nikola .. slug: theming -.. date: 2012/03/13 12:00 +.. date: 2012-03-13 12:00:00 UTC-03:00 .. tags: .. link: .. description: @@ -8,7 +8,7 @@ Theming Nikola ============== -:Version: 6.4.0 +:Version: 7.0.1 :Author: Roberto Alsina <ralsina@netmanagers.com.ar> .. class:: alert alert-info pull-right diff --git a/docs/upgrading-to-v6.txt b/docs/upgrading-to-v6.txt index ab89614..765f901 100644 --- a/docs/upgrading-to-v6.txt +++ b/docs/upgrading-to-v6.txt @@ -1,6 +1,6 @@ .. title: Upgrading to v6 .. slug: upgrading-to-v6 -.. date: 2013/08/23 23:00 +.. date: 2013-08-23 23:00:00 UTC-03:00 .. tags: .. link: .. description: @@ -8,7 +8,7 @@ Upgrading to v6 =============== -:Version: 6.4.0 +:Version: 7.0.1 .. class:: lead |
