Posts about nikola

Quick Nikola Feature: document APIs using pdoc

A user asked in the nikola-discuss if there was a way to use Nikola to document APIs. Well, there wasn't and now there is. I took pdoc and wrote a wrapper as a plugin for Nikola.

And now you can just document python modules using it in a couple of minutes.

Here is the documentation for the re module from stdlib as an example.

Yes, the output is not great, and it needs CSS, and many other fixes, but it's easy to improve now that it's there, as long as there is interest.

Changes in this blog

I have made a few changes in how this blog is generated and what features are enabled.

Similarity Plugin

I have enabled the similarity plugin and disabled the equivalent feature provided by Disqus. In general, it seems this plugin produces more whimsical connections which is a big plus. It may lead you to discover very random things I wrote. I know it reminded me of things I did not remember writing!

Continuous Import

I have enabled the continuous import plugin which will automatically merge some other aspects of my online presence with this blog. Currently it has support for goodreads (which I already mentioned before) and youtube (which I have not), so you will see short book reviews and random videos I make.

Examples: goodreads and youtube

This plugin can theoretically support anything that provides a RSS/Atom feed and lets you apply custom templates to the content so you end up with pretty posts in all cases. If you are interested in using it for some other service, feel free to ask me about it.

Front Page

For the first time ever, the front page of this site is no longer the blog, but a landing page.

Theme

At some point in the future I may switch to a more customized theme, but that's not in any specific roadmap, it will happen when it happens. In the meantime, this is now using the Lumen bootswatch and am experimenting with using FlowType for a more readable automatic font size.

Nikola v7 finally out!

I am thrilled to announce version 7 of Nikola, a static site and blog generator is out, with a bazillion features and bugfixes (see below).

You can get it at all the usual places, and here's the release announcement

Here's the new features, the bugfixes list would make the post too long :-)

  • Added UNSLUGIFY_TITLES option for making titles fetched via the filename regexp prettier (Issue #1282)
  • New dependencies: natsort (natural sorting in galleries) and dateutil (replaces pytz)
  • Nikola.commands are now the user-friendly wrappers from console (Issue #1177)
  • Add a github_deploy command to deploy to GitHub pages (Issue #1208)
  • Remove tidy filter (it was broken due to tidy being ancient) (Issue #1164)
  • Added GENERATE_RSS setting to allow disabling RSS in Nikola (Issue #1236)
  • Link listings raw sources if COPY_SOURCES is True (Issue #1214)
  • Much more powerful nikola plugin command (Issue #1189)
  • More powerful console mode allows access to all nikola commands (Issue #830)
  • New `ROBOTS_EXCLUSIONS` option listing resources to exclude from sitemap and include in new generated /robots.txt (Issue #804)
  • Generate sitemapindex containing RSS and sitemap files (Issue #804)
  • Support hooks in templates, for use by plugins (Issue #896)
  • Use readline if available (Issue #1238)
  • Replaced READ_MORE_LINK with INDEX_READ_MORE_LINK and RSS_READ_MORE_LINK (Issue #1222)
  • Added reading_time, remaining_reading_time, paragraph_count, remaining_paragraph_count tags for READ_MORE_LINK (Issue #1220)
  • Add canonical link in listings.
  • Added support for new meta files that are the same format as 1-file metadata, allowing for greater flexibility (Issue #954)
  • Colorbox is now internationalized (Issue #1205)
  • Added LOGO_URL and SHOW_BLOG_TITLE=True settings to facilitate showing off logos (Issue #1122)
  • Create automatic story index pages for subfolders, too (Issue #793)
  • New Slovak translation by Tomáš Prékop
  • Created a MarkdownExtension plugin class (Issue #1175)
  • The base theme produces properly sectioned and semantic HTML5 (Issues #1123, #1137)
  • The base theme comes with a new stylish look by default (Issue #1137)
  • The base theme supports Right-to-Left by using ::dir(rtl) CSS4 rules and <html dir="rtl"> tags where valid (Issue #1146)
  • Bootstrap 2 updated to 2.3.2 (via Issue #1137)
  • Added FORCE_ISO8601 setting that currently makes new_post use ISO 8601 dates (via Issue #1156)
  • Added support for TZ specified in post date (Issue #1118)
  • Make nikola init ask about the site’s settings (Issue #1080)
  • Use natural sorting for files and folders list in listings and galleries (Issue #1144)
  • Added invariance testing (Issue #672)
  • Plugins can inject templates in the system (Issue #1139)
  • nikola import_wordpress now has a --qtranslate option, to parse posts in the qtranslate wordpress plugin format and turn them into multilingual Nikola posts (Issue #1072)
  • nikola console allows for interpreter choice via -b, -i, -p; moreover, support for bpython is not deprecated anymore (Issue #1126)
  • retired tag for posts has been replaced with private (via Issue #686)
  • Changed the default TRANSLATIONS_PATTERN to "{path}.{lang}.{ext}". (Issues #990, #829)
  • Backwards compatibility with v5 is broken. Added backwards-incompatible changes. (Issue #829)
  • Added a CONTENT_FOOTER_FORMATS config option. It is used to format the CONTENT_FOOTER variable properly, for compatibility with the Translatable Settings feature. The variable takes a dict, the keys of which are languages, and values are (args, kwargs). (Issue #1112)
  • Certain settings are now translatable. As of now, the settings are: BLOG_AUTHOR, BLOG_TITLE, BLOG_DESCRIPTION, LICENSE, CONTENT_FOOTER, SOCIAL_BUTTONS_CODE, SEARCH_FORM, BODY_END, EXTRA_HEAD_DATA, NAVIGATION_LINKS, READ_MORE_LINK (the up-to-date list is available in SITE.TRANSLATABLE_SETTINGS) (Issues #851, #1057, #1061, #1112)
  • New Post.author() returns meta 'author' or BLOG_AUTHOR (Issue #1117)
  • Ship base-jinja, bootstrap-jinja, bootstrap3-jinja with Nikola (Issue #1104)
  • Invert HIDE_SOURCELINK and HIDE_UNTRANSLATED_POSTS into SHOW_SOURCELINK and SHOW_UNTRANSLATED_POSTS (Issue #1076)
  • Remove old messages left over for backwards compatibility: (Issues #829, #1105)
    • "More posts about", replaced by "More posts about %s"
    • "Posted", replaced by "Posted:"
    • "Also available in", replaced by "Also available in:"
  • Remove old "sl_SI", "tr_TR" locale aliases (use "sl" and "tr") (Issue #829, #1105)
  • New option RSS_PLAIN to optionally strip HTML from RSS feeds (Issue #1107)
  • Support content key in compilers' create_post (Issue #1098)
  • Use setuptools’ extras feature. Use pip install nikola[extras] to install Nikola with extras (requirements-extras.txt, formerly requirements-full.txt -- note the name change!) (Issue #1089)

Nikola Logo Contest!

So you have design skills? Want to make a little money while doing a good thing? Then join the contest! there is a 200 US dollars guaranteed prize, and the contest will be judged by a group of Nikola developers.

Some guidance:

  • The name Nikola comes from Nikola Tesla, so think concepts connected to that
    • The Wardenclyffe tower
    • Tesla Coils
    • Lightning
    • Electricity
    • Early 20th century
  • I hope the logo works well in a variety of formats so, keep it simple. B/W is good.
  • A drawing without the word Nikola is good, but a good design with the word in it could be good also.

The contest lasts a week, you have 4 days for the qualifying round.

And remember: it has to be better than these

Nikola is now more compatible with Sphinx

Sometimes, you need to use the same text in more than one place. For example, you may want to use fragments of your software manuals in your software's site.

If you are part of the Python-verse then it's likely that your docs are written using Sphinx. Ǹikola and Sphinx share roots in reStructuredText so they are already compatible in many important ways.

However, Sphinx adds a whole bunch of extensions to reStructuredText and Sphinx users use them. So, what's a dev to do? He'll write code. So I wrote a nikola plugin which adds support for a large chunk of the Sphinx-specific markup.

How big a chunk? Quite big since it adds support for over 35 extensions, roles and directives (no, toctree is not one of them yet).

This way, you may be able to enjoy a good documentation-specific tool and a (if I may say so myself) good website tool from common sources.

Enjoy!

Preview of Nikola Webapp

I have already made a few attempts at turning Nikola, a static site and blog generator into a webapp, with varied success. One of the bigger problems was, I think, one of scale. I was thinking of something to replace http://wordpress.com ... something where everyone could host his own blog in very low cost infrastructure.

But then again... why not try to replace all those self-hosted wordpress instances out there? So, here's the webapp plugin!

It's very early stages, no support for pages, only supports markdown, no configuration changes, and you can't even really delete things. But hey, you can post, which is 95% of the usage this will get.

UPDATE: if you are running Nikola from github master, you can install this using the plugins repo: http://plugins.getnikola.com/#webapp and it supports a lot more than on the video above.

Trivial Nikola Deployment Using Pancake.io and Backlift

So, you want to publish a site and want to do it now? As in, really right now? And for free? And you are a Nikola user.

If you are a Dropbox user, open an account at Pancake.io Then set your OUTPUT_DIR to something like /home/yourname/Dropbox/Apps/Pancake.io and build. That's it. No deploy step.

Or open an account at Backlift and set OUTPUT_DIR to /home/yourname/Dropbox/Backlift/foo where foo is your site's name as configured in Backlift. Build. No deploy step.

Or open an account on DropPages.com or KISSr or Site44.com or just use a Dropbox public folder.

Each of these services has advantages and disadvantages, from lame URLs to costing money, but hey, for a quick thing they are cool. You can always upgrade to the real thing later.