Giter Club home page Giter Club logo

plugins's Introduction

Extra Plugins for Nikola

The source repository of https://plugins.getnikola.com/ — Plugins for the Nikola static site generator.

How to get your Plugin to the Index

  1. Follow the Developer Documentation closely.

  2. Fork this repository and put your plugin there.

  3. Send a Pull Request.

    Note: even if you have commit rights (shared with Nikola or from another plugin you posted), please send a Pull Request for code review.

  4. Success! Your plugin is in the Index. Please note that it will appear on the website at midnight UTC, when the site is automatically rebuilt.

Developer Documentation

Anyone can develop plugins for Nikola. There are some specific files you need if you want them on the Index, though.

There is also a sample helloworld plugin available.

README.md

A Markdown-formatted file, describing your plugin, what it does, and how it works.

We aren’t using reST, which is a de-facto standard in the Python and Nikola community, for simplicity and historic reasons.

requirements.txt / requirements-nonpy.txt / requirements-plugins.txt (all optional)

If your plugin depends on something else, you need to add it to one of those files.

If your dependency is a Python package, put it in the requirements.txt file, which is then passed over to pip while installing your plugin. Inserting Nikola’s dependencies you also depend on is not mandatory, but suggested just in case those are not our dependencies anymore.

If you depend on a third-party piece of software that is not a Python package installable via pip, you need to provide a requirements-nonpy.txt file. The format is Human-friendly name::http://download/link. It will be shown in the Plugins index, and shown to the user while installing.

If you depend on another Nikola plugin, put it in the requirements-plugins.txt file, Nikola will install these when installing your plugin. The format is just the plugin name(s), each on a separate line.

conf.py.sample (optional)

If there are any config options you need for your plugin, put them here.

[plugin name].plugin

This is a standard ConfigParser-style ini file. It is parsed by yapsy and the Plugin Index.

[Core]
Name = plugin-name
Module = plugin-name
Tests = test-suite

[Nikola]
MinVersion = version-number
MaxVersion = version-number
Compiler = compiler-that-uses-extensions
PluginCategory = plugin-category

[Documentation]
Author = authors-name
Version = version-number
Website = https://plugins.getnikola.com/#plugin-name
Description = A short, one-line description

[Core]

In [Core], you need to provide the Name of your plugin and the Module your plugin resides in. We recommend to have them identical (just like the directory name and the name of this very config file).

Additional fields: If you have tests, put it in the /tests/ directory of this repository (not your plugin!) and put the test module name in a Tests field. Tests in /tests/ are run in CI (via GitHub Actions). Note that the GitHub Actions test runner does not interpret requirements-nonpy.txt files!

[Nikola]

If you require a specific version of Nikola, set MinVersion and MaxVersion accordingly. Those fields are not mandatory.

If the plugin is a compiler extension, you need to set the Compiler here. Otherwise, skip this field.

The PluginCategory field is mandatory, and it must contain the plugin category. Use 'Compiler' for compilers and the base class name for anything else.

[Documentation]

In which you need to put in the Author, Version, Website (of the plugin; you can just use the link to the Index as shown in the example; replacing plugin-name with the obvious thing) and a short Description.

[plugin name].py

This is where your plugin resides. Follow the Extending Nikola tutorial for instructions on how to write a plugin.

Please make sure your plugin has a valid open-source license, and that it has a license comment. For short licenses (MIT/BSD), include the entire license text; for longer licenses (Apache, GPL/LGPL), use the short declarations (Apache, GPL). If you don’t know which license to use, we recommend MIT (as seen in Nikola core).

plugins's People

Contributors

adamcavendish avatar arusahni avatar bennyslbs avatar bentasker avatar chillaranand avatar da2x avatar dwyatte avatar euphi avatar everlanes avatar evgeni avatar felixfontein avatar humitos avatar hx2a avatar ivanteoh avatar jesperdramsch avatar jjconti avatar kwpolska avatar lorenzo-rovigatti avatar magmax avatar matthew16550 avatar mattioofr avatar mte90 avatar pellenilsson avatar pieterdavid avatar punchagan avatar ralsina avatar uli-heller avatar wirew0rm avatar x1101 avatar xuhdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugins's Issues

Nikola object has no attribute 'doit' (plugin: tags)

Hi all,

I installed the tags plugin and its dependencies (requests and webassets), but now I encounter the following error:

nikola tags -l
Traceback (most recent call last):
  File "/home/username/.virtualenvs/nikolatest/local/lib/python2.7/site-packages/doit/doit_cmd.py", line 120, in run
    return command.parse_execute(args)
  File "/home/username/.virtualenvs/nikolatest/local/lib/python2.7/site-packages/doit/cmd_base.py", line 78, in parse_execute
    return self.execute(params, args)
  File "/home/username/.virtualenvs/nikolatest/local/lib/python2.7/site-packages/nikola/plugin_categories.py", line 102, in execute
    self._execute(options, args)
  File "/home/username/.emacs.d/my-elisp/plugins/tags/tags.py", line 331, in _execute
    nikola.scan_posts()
  File "/home/username/.virtualenvs/nikolatest/local/lib/python2.7/site-packages/nikola/nikola.py", line 1130, in scan_posts
    self.commands = utils.Commands(self.doit)
AttributeError: 'Nikola' object has no attribute 'doit'

Compilation exited abnormally with code 3 at Fri Sep 26 17:26:27

and I don't understand it.

I use Nikola v7.0.1, tags plugin v0.5 on Ubuntu 12.04.

Any hints ? Thanks !!

Needs a translation framework

So, I'll add one.

My idea is:

  • Setup a resource in transifex
  • Update the en.po file via string extraction so it's automatic
  • Add the translation modules to each zip file (since they are tiny)
  • Use a relative import in the plugins to access the messages

Things that could be done differently:

  • Could use gettext everywhere but it's sort of a pain
  • Could separate per-plugin resources but then we need to setup a resource for each plugin (and adding resources in transifex is annoying because you need a .po file already)

TODO list for webappp plugin

  • doesn't support 2-part posts
  • doesn't support translations
  • does insecure path manipulations
  • needs docs
  • needs a way to edit configuration
  • doesn't let you add custom metadata
  • custom widgets per field
  • recognize and offer our optional metadata
  • password protection

[orgmode] cannot render the org file with orgmode plugin

i got the error as below

Scanning posts........done!
. render_sources:../shelper.github.io/zh_cn/posts/test/index.org
. render_sources:../shelper.github.io/posts/test/index.org
. render_posts:timeline_changes
. render_posts:cache/posts/test.zh_cn.html
Cannot open load file: ox-html

TaskError - taskid:render_posts:cache/posts/test.zh_cn.html
PythonAction Error
Traceback (most recent call last):
File "/Users/zyuan/develop/nikola/plugins/orgmode/orgmode.py", line 73, in compile_html
subprocess.check_call(command)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py", line 561, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['emacs', '--batch', '-l', '/Users/zyuan/develop/nikola/plugins/orgmode/init.el', '--eval', '(nikola-html-export "/Users/zyuan/develop/nikola/posts/test.org" "/Users/zyuan/develop/nikola/cache/posts/test.zh_cn.html")']' returned non-zero exit status 255

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/doit/action.py", line 383, in execute
returned_value = self.py_callable(_self.args, *_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/nikola/post.py", line 485, in compile
self.is_two_file),
File "/Users/zyuan/develop/nikola/plugins/orgmode/orgmode.py", line 82, in compile_html
source, e.returncode))
Exception: Cannot compile posts/test.org -- bad org-mode configuration (return code 255)

Tags plugin does not support unicode tags

(blog)[20:33] humitos: nikola> nikola tags --merge "paraná,parana" posts/nikola/*.rst
Scanning posts...done!
Traceback (most recent call last):
  File "/home/humitos/.virtualenvs/blog/local/lib/python2.7/site-packages/doit/doit_cmd.py", line 121, in run
    return command.parse_execute(args)
  File "/home/humitos/.virtualenvs/blog/local/lib/python2.7/site-packages/doit/cmd_base.py", line 79, in parse_execute
    return self.execute(params, args)
  File "/home/humitos/.virtualenvs/blog/local/lib/python2.7/site-packages/nikola/plugin_categories.py", line 102, in execute
    self._execute(options, args)
  File "/home/humitos/Source/blog/nikola/plugins/tags/tags.py", line 329, in _execute
    elif options['merge'].count(',') > 0 and len(args) > 0:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)
(blog)[20:34] humitos: nikola>

wordpress-compiler issues

i have my wordpress blog since 2005, articles mostly written in plain HTML and tested a lot of plugins, using tags long before wp provided them etc... so this is really a stress test.

i also tried importing as Markdown: #137

cc @felixfontein

$ nikola import_wordpress --transform-to-html --install-wordpress-compiler davidakweblog.wordpress.2016-02-23.xml
[2016-02-23T09:18:33Z] INFO: compile_wordpress: Registered WordPress plugin wordpress_shortcode_gallery
[2016-02-23T09:18:33Z] INFO: compile_wordpress: Registered WordPress plugin wordpress_shortcode_code
[2016-02-23T09:18:33Z] INFO: compile_wordpress: Registered 2 WordPress plugins
[2016-02-23T09:18:34Z] INFO: init: Created empty site at new_site.
[2016-02-23T09:18:34Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/05/dashboard.jpg => new_site/files/blog/wp-content/uploads/2007/05/dashboard.jpg
[2016-02-23T09:18:35Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:18:35Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:18:35Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/05/screenshot7.jpeg => new_site/files/blog/wp-content/uploads/2007/05/screenshot7.jpeg
[2016-02-23T09:18:35Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:18:35Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:18:35Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/07/p1012766.JPG => new_site/files/blog/wp-content/uploads/2007/07/p1012766.JPG
[2016-02-23T09:18:35Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:18:36Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:18:36Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/07/p1012763.JPG => new_site/files/blog/wp-content/uploads/2007/07/p1012763.JPG
[2016-02-23T09:18:36Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:18:36Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:18:37Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29.png
[2016-02-23T09:18:37Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:18:37Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:18:37Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-300x187.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-300x187.png
[2016-02-23T09:18:37Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:18:38Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:18:38Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-1024x640.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-1024x640.png
[2016-02-23T09:18:38Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:18:38Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:18:39Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-150x150.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-150x150.png
[2016-02-23T09:18:39Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:18:39Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:18:39Z] WARNING: import_wordpress: Not going to import "Google " because it seems to contain no content.
[2016-02-23T09:18:39Z] WARNING: import_wordpress: Not going to import "Startseite" because it seems to contain no content.
[2016-02-23T09:18:39Z] WARNING: import_wordpress: Not going to import "NO TITLE" because it seems to contain no content.
[2016-02-23T09:18:39Z] WARNING: import_wordpress: Not going to import "NO TITLE" because it seems to contain no content.
[2016-02-23T09:18:39Z] WARNING: import_wordpress: Not going to import "NO TITLE" because it seems to contain no content.
[2016-02-23T09:18:39Z] WARNING: import_wordpress: Not going to import "Blog" because it seems to contain no content.
[2016-02-23T09:18:39Z] WARNING: import_wordpress: Not going to import "Impressum" because it seems to contain no content.
[2016-02-23T09:18:42Z] ERROR: import_wordpress: Cannot interpret post "posts/435-text-zu-ascii-art" (language ) with post format wp!
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/doit/doit_cmd.py", line 168, in run
    return command.parse_execute(args)
  File "/usr/local/lib/python3.5/site-packages/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugin_categories.py", line 124, in execute
    return self._execute(options, args)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py", line 332, in _execute
    self.import_posts(channel)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py", line 1015, in import_posts
    self.process_item_if_post_or_page(item)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py", line 1005, in process_item_if_post_or_page
    self.write_attachments_info(destination, attachments)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py", line 985, in write_attachments_info
    file.write(json.dumps(attachments).encode('utf-8'))
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/encoder.py", line 180, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'300' is not JSON serializable

source of the article from wordpress:

<pre>
  _____ _______  _______   ____       _    ____   ____ ___ ___ 
 |_   _| ____\ \/ /_   _| |___ \     / \  / ___| / ___|_ _|_ _|
   | | |  _|  \  /  | |     __) |   / _ \ \___ \| |    | | | | 
   | | | |___ /  \  | |    / __/   / ___ \ ___) | |___ | | | | 
   |_| |_____/_/\_\ |_|   |_____| /_/   \_\____/ \____|___|___|

</pre>

<!--more-->

So etwas kann man in stundenlanger Handarbeit basteln, aber einfacher geht es mit einem Generator.

Zu beachten ist dabei, dass man bei HTML den <code><pre> ... </pre></code> Tag braucht, da sonst immer nur ein Leerzeichen akzeptiert wird.

Und das sieht dann ziemlich scheisse aus!

Den Generator, um so etwas zu machen, findest du auf folgender Seite:

<a href="http://ascii.mastervb.net/" target="_blank">ascii.mastervb.net</a>

Hier gibt es noch ein paar mehr Schriftarten:

<a href="http://patorjk.com/software/taag/" target="_blank">patorjk.com/software/taag</a>

Auf der Seite kann man auch Bilder in ASCII umwandeln lassen, das hab ich aber nicht getestet und da gibt es auch tausende andere Seiten.

Viel Spass damit!

Something broke a bunch of tests

Probably the plugin initialization refactor.

>       for p in self.plugin_manager.getPluginsOfCategory('PostScanner'):
E       AttributeError: 'Nikola' object has no attribute 'plugin_manager'

Cant locate template for uri u'bootstrap_helper.tmpl'

Hi, I'm getting this after an upgrade, there's not special in my config, no custom stuff. Let me know if you need more output. I'm using Nikola v7.0.1 and Mako 1.0.0 in a Debian box. Thanks.

$ nikola build
Scanning posts....done!
[2014-08-17T02:59:30Z] WARNING: Nikola: robots.txt not ending up in server root, will be useless
. render_pages:output/posts/hope-x-ical-for-schedule/index.html

TaskError - taskid:render_pages:output/posts/hope-x-ical-for-schedule/index.html
PythonAction Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/doit/action.py", line 360, in execute
returned_value = self.py_callable(_self.args, _kwargs)
File "/usr/lib/python2.7/dist-packages/nikola/nikola.py", line 769, in render_template
template_name, None, local_context)
File "/usr/lib/python2.7/dist-packages/nikola/plugins/template/mako.py", line 108, in render_template
data = template.render_unicode(
_context)
File "/usr/lib/python2.7/dist-packages/mako/template.py", line 452, in render_unicode
as_unicode=True)
File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 803, in _render
*_kwargs_for_callable(callable, data))
File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 835, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 860, in exec_template
callable
(context, _args, *_kwargs)
File "/home/tiago/Hacking/git.acaia.ca/website-tiago/cache/.mako.tmp/base.tmpl.py", line 56, in render_body
__M_writer(unicode(base.html_headstart()))
File "/home/tiago/Hacking/git.acaia.ca/website-tiago/cache/.mako.tmp/base_helper.tmpl.py", line 113, in render_html_headstart
__M_writer(unicode(html_stylesheets()))
File "/home/tiago/Hacking/git.acaia.ca/website-tiago/cache/.mako.tmp/base_helper.tmpl.py", line 87, in html_stylesheets
return render_html_stylesheets(context)
File "/home/tiago/Hacking/git.acaia.ca/website-tiago/cache/.mako.tmp/base_helper.tmpl.py", line 225, in render_html_stylesheets
__M_writer(unicode(notes.css()))
AttributeError: 'Undefined' object has no attribute 'css'

Caption on "fotorama_directive"

How do you think I should implement "Captions" (http://fotorama.io/customize/captions/) in the fotorama_directive (#94)?

I mean, how the user should write the caption to associate with the images?

I was thinking on something like this:

.. fotorama::

  image0.jpg
  Caption for image0.jpg
  image1.jpg
  Caption for image1.jpg
  image2.jpg
  image3.jpg

But the thing is: how I can distinguish if the line is a caption or is a path? I can check if the filepath exists but maybe is a typo instead of a caption :)

Well, that's why I'm asking you guys.

[orgmode] fontify source block

The present orgmode plugin complain about htmlize.el no being present:

Cannot fontify src block (htmlize.el >= 1.34 required)

Adding something like this to init.el should do the job:

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(setq package-load-list '((htmlize t)))
(package-initialize)

(unless (package-installed-p 'htmlize)
  (package-refresh-contents)
  (package-install 'htmlize))

Now there is no complain about htmlize.el but unfortunatly the HTML produce is broken; here is an example:

# Code to fontify
(setq bwge/blog-src-directory "~/Dropbox/Blog")
# Without htmlize.el
<div class="highlight"><pre><span class="p">(</span><span class="nf">setq</span> <span class="nv">bwge/blog-src-directory</span> <span class="s">"~/Dropbox/Blog"</span><span class="p">)</span>
# With htmlize.el
<div class="highlight"><pre><span class="p">(</span><span class="nf">setq</span> <span class="nv">bwge/blog-src-directory</span> <span class="nv">&lt;span</span> <span class="nv">style=</span><span class="s">"font-style: italic;"</span><span class="nv">&gt;</span><span class="s">"~/Dropbox/Blog"</span><span class="nv">&lt;/span&gt;</span><span class="p">)</span>

plugin vcs issues

Just installed the vcs module following the instructions.

nikola installed via pip.

Arch Linux

don@dragon:~/tmp/www.duckland.org> uname -a
Linux dragon.home.duckland.org 4.0.5-1-ARCH #1 SMP PREEMPT Sat Jun 6 18:37:49 CEST 2015 x86_64 GNU/Linux
don@dragon:~/tmp/www.duckland.org> nikola version
Nikola v7.5.0


don@dragon:~/tmp/www.duckland.org> nikola plugin --list-installed
auto at /usr/lib/python3.4/site-packages/nikola/plugins/command/auto.py
bootswatch_theme at /usr/lib/python3.4/site-packages/nikola/plugins/command/bootswatch_theme.py
check at /usr/lib/python3.4/site-packages/nikola/plugins/command/check.py
console at /usr/lib/python3.4/site-packages/nikola/plugins/command/console.py
copy_assets at /usr/lib/python3.4/site-packages/nikola/plugins/task/copy_assets.py
copy_files at /usr/lib/python3.4/site-packages/nikola/plugins/task/copy_files.py
create_bundles at /usr/lib/python3.4/site-packages/nikola/plugins/task/bundles.py
deploy at /usr/lib/python3.4/site-packages/nikola/plugins/command/deploy.py
generate_rss at /usr/lib/python3.4/site-packages/nikola/plugins/task/rss.py
github_deploy at /usr/lib/python3.4/site-packages/nikola/plugins/command/github_deploy.py
gzip at /usr/lib/python3.4/site-packages/nikola/plugins/task/gzip.py
html at /usr/lib/python3.4/site-packages/nikola/plugins/compile/html.py
import_feed at /home/don/tmp/www.duckland.org/plugins/import_feed/import_feed.py
import_wordpress at /usr/lib/python3.4/site-packages/nikola/plugins/command/import_wordpress.py
init at /usr/lib/python3.4/site-packages/nikola/plugins/command/init.py
install_theme at /usr/lib/python3.4/site-packages/nikola/plugins/command/install_theme.py
ipynb at /usr/lib/python3.4/site-packages/nikola/plugins/compile/ipynb/
jinja at /usr/lib/python3.4/site-packages/nikola/plugins/template/jinja.py
less at /home/don/tmp/www.duckland.org/plugins/less/less.py
mako at /usr/lib/python3.4/site-packages/nikola/plugins/template/mako.py
markdown at /usr/lib/python3.4/site-packages/nikola/plugins/compile/markdown/
mdx_gist at /usr/lib/python3.4/site-packages/nikola/plugins/compile/markdown/mdx_gist.py
mdx_nikola at /usr/lib/python3.4/site-packages/nikola/plugins/compile/markdown/mdx_nikola.py
mdx_podcast at /usr/lib/python3.4/site-packages/nikola/plugins/compile/markdown/mdx_podcast.py
new_page at /usr/lib/python3.4/site-packages/nikola/plugins/command/new_page.py
new_post at /usr/lib/python3.4/site-packages/nikola/plugins/command/new_post.py
orphans at /usr/lib/python3.4/site-packages/nikola/plugins/command/orphans.py
pandoc at /usr/lib/python3.4/site-packages/nikola/plugins/compile/pandoc.py
php at /usr/lib/python3.4/site-packages/nikola/plugins/compile/php.py
plugin at /usr/lib/python3.4/site-packages/nikola/plugins/command/plugin.py
redirect at /usr/lib/python3.4/site-packages/nikola/plugins/task/redirect.py
render_archive at /usr/lib/python3.4/site-packages/nikola/plugins/task/archive.py
render_galleries at /usr/lib/python3.4/site-packages/nikola/plugins/task/galleries.py
render_indexes at /usr/lib/python3.4/site-packages/nikola/plugins/task/indexes.py
render_listings at /usr/lib/python3.4/site-packages/nikola/plugins/task/listings.py
render_pages at /usr/lib/python3.4/site-packages/nikola/plugins/task/pages.py
render_posts at /usr/lib/python3.4/site-packages/nikola/plugins/task/posts.py
render_sources at /usr/lib/python3.4/site-packages/nikola/plugins/task/sources.py
render_tags at /usr/lib/python3.4/site-packages/nikola/plugins/task/tags.py
rest at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/
rest_chart at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/chart.py
rest_doc at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/doc.py
rest_gist at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/gist.py
rest_listing at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/listing.py
rest_media at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/media.py
rest_post_list at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/post_list.py
rest_slides at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/slides.py
rest_soundcloud at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/soundcloud.py
rest_thumbnail at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/thumbnail.py
rest_vimeo at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/vimeo.py
rest_youtube at /usr/lib/python3.4/site-packages/nikola/plugins/compile/rest/youtube.py
robots at /usr/lib/python3.4/site-packages/nikola/plugins/task/robots.py
rst2html at /usr/lib/python3.4/site-packages/nikola/plugins/command/rst2html/
sass at /home/don/tmp/www.duckland.org/plugins/sass/sass.py
scale_images at /usr/lib/python3.4/site-packages/nikola/plugins/task/scale_images.py
scan_posts at /usr/lib/python3.4/site-packages/nikola/plugins/misc/scan_posts.py
serve at /usr/lib/python3.4/site-packages/nikola/plugins/command/serve.py
sitemap at /usr/lib/python3.4/site-packages/nikola/plugins/task/sitemap/
smtp at /usr/lib/python3.4/site-packages/nikola/plugins/loghandler/smtp.py
status at /usr/lib/python3.4/site-packages/nikola/plugins/command/status.py
stderr at /usr/lib/python3.4/site-packages/nikola/plugins/loghandler/stderr.py
upgrade_metadata at /home/don/tmp/www.duckland.org/plugins/upgrade_metadata/upgrade_metadata.py
vcs at /home/don/tmp/www.duckland.org/plugins/vcs/vcs.py
version at /usr/lib/python3.4/site-packages/nikola/plugins/command/version.py

The error is throws is this:

don@dragon:~/tmp/www.duckland.org> nikola vcs
Scanning posts......done!
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/doit/doit_cmd.py", line 165, in run
    return command.parse_execute(args)
  File "/usr/lib/python3.4/site-packages/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/usr/lib/python3.4/site-packages/nikola/plugin_categories.py", line 124, in execute
    self._execute(options, args)
  File "/home/don/tmp/www.duckland.org/plugins/vcs/vcs.py", line 66, in _execute
    for s in wd.status():
  File "/usr/lib/python3.4/site-packages/anyvc/common/workdir.py", line 155, in parse_status_items
    for item in items:
  File "/usr/lib/python3.4/site-packages/anyvc/git/workdir.py", line 84, in status_impl
    wd = ls_files("tdmo")
  File "/usr/lib/python3.4/site-packages/anyvc/git/workdir.py", line 79, in ls_files
    state, name = item.split(" ", 1)
TypeError: 'str' does not support the buffer interface

My python-fu is not very good, but I am willing to test any changes...

Thanks!

d

wordpress_compiler fails on 7.6.2

$ nikola build
[2015-08-02T22:31:47Z] ERROR: yapsy: Unable to create plugin object: /tmp/wordpress-blog/plugins/wordpress_compiler/wordpress
Traceback (most recent call last):
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/yapsy/PluginManager.py", line 512, in loadPlugins
    plugin_info.plugin_object = self.instanciateElement(element)
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/yapsy/PluginManager.py", line 531, in instanciateElement
    return element()
  File "/tmp/wordpress-blog/plugins/wordpress_compiler/wordpress/wordpress.py", line 117, in __init__
    super().__init__()
TypeError: super() takes at least 1 argument (0 given)
Scanning posts.....Cannot find 'wordpress' compiler; it might require an extra plugin -- do you have it installed?
$

@felixfontein do you know what is happening here?

Snippets plugin

Hello,

I'm thinking on a snippets plugins, a directive for .rst that receive some attributes and replace them in a HTML template. Something like:

.. snippet:: bootstrap-button
   :id: donate-button
   :class: btn btn-lg btn-primary
   :href: /en/donations/payment-methods

   Donate

And, the plugin should have a folder containing all the HTML templates with some placeholders. In this case, it should have a bootstrap-button.html with this on it:

   <div style="text-align: center; margin-top: 25px; margin-bottom: 25px;">
     <a class="${class}" href="${href}">
       ${content}
     </a>
   </div>

What do you think? Is it a good idea? Do you have a better idea to implement this?

import_page encoding problem

$ nikola import_page http://en.wikipedia.org/wiki/Information_extraction
[2016-02-29T20:39:33Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): en.wikipedia.org
[2016-02-29T20:39:34Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): en.wikipedia.org
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/doit/doit_cmd.py", line 168, in run
    return command.parse_execute(args)
  File "/usr/local/lib/python3.5/site-packages/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugin_categories.py", line 124, in execute
    return self._execute(options, args)
  File "/Users/davidak/code/Webseite/plugins/import_page/import_page.py", line 61, in _execute
    self._import_page(url)
  File "/Users/davidak/code/Webseite/plugins/import_page/import_page.py", line 68, in _import_page
    title = doc.find('*//title').text_content().decode('utf-8')
AttributeError: 'lxml.etree._ElementUnicodeResult' object has no attribute 'decode'

Python 3.5.1
Nikola vv7.7.6

@ralsina

import_wordpress issue

i have my wordpress blog since 2005, articles mostly written in plain HTML and tested a lot of plugins, using tags long before wp provided them etc... so this is really a stress test.

i also tried importing as HTML: #136

$ nikola import_wordpress davidakweblog.wordpress.2016-02-23.xml
[2016-02-23T09:53:50Z] INFO: init: Created empty site at new_site.
[2016-02-23T09:53:50Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/05/dashboard.jpg => new_site/files/blog/wp-content/uploads/2007/05/dashboard.jpg
[2016-02-23T09:53:50Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:53:50Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:53:51Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/05/screenshot7.jpeg => new_site/files/blog/wp-content/uploads/2007/05/screenshot7.jpeg
[2016-02-23T09:53:51Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:53:51Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:53:52Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/07/p1012766.JPG => new_site/files/blog/wp-content/uploads/2007/07/p1012766.JPG
[2016-02-23T09:53:52Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:53:52Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:53:53Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/07/p1012763.JPG => new_site/files/blog/wp-content/uploads/2007/07/p1012763.JPG
[2016-02-23T09:53:53Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:53:53Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:53:53Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29.png
[2016-02-23T09:53:53Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:53:53Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:53:54Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-150x150.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-150x150.png
[2016-02-23T09:53:54Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:53:54Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:53:55Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-300x187.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-300x187.png
[2016-02-23T09:53:55Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:53:55Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:53:55Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-1024x640.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-1024x640.png
[2016-02-23T09:53:55Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): davidak.de
[2016-02-23T09:53:55Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): www.davidak.de
[2016-02-23T09:53:55Z] WARNING: import_wordpress: Not going to import "Google " because it seems to contain no content.
[2016-02-23T09:53:55Z] WARNING: import_wordpress: Not going to import "Startseite" because it seems to contain no content.
[2016-02-23T09:53:55Z] WARNING: import_wordpress: Not going to import "NO TITLE" because it seems to contain no content.
[2016-02-23T09:53:55Z] WARNING: import_wordpress: Not going to import "NO TITLE" because it seems to contain no content.
[2016-02-23T09:53:55Z] WARNING: import_wordpress: Not going to import "NO TITLE" because it seems to contain no content.
[2016-02-23T09:53:55Z] WARNING: import_wordpress: Not going to import "Blog" because it seems to contain no content.
[2016-02-23T09:53:55Z] WARNING: import_wordpress: Not going to import "Impressum" because it seems to contain no content.
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/doit/doit_cmd.py", line 168, in run
    return command.parse_execute(args)
  File "/usr/local/lib/python3.5/site-packages/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugin_categories.py", line 124, in execute
    return self._execute(options, args)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py", line 332, in _execute
    self.import_posts(channel)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py", line 1015, in import_posts
    self.process_item_if_post_or_page(item)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py", line 996, in process_item_if_post_or_page
    out_folder_slug = self.import_postpage_item(item, wordpress_namespace, 'posts', attachments)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py", line 938, in import_postpage_item
    rewrite_html)
  File "/usr/local/lib/python3.5/site-packages/nikola/plugins/basic_import.py", line 130, in write_content
    doc = html.document_fromstring(content)
  File "/usr/local/lib/python3.5/site-packages/lxml/html/__init__.py", line 755, in document_fromstring
    "Document is empty")
lxml.etree.ParserError: Document is empty

import_jekyll don't find posts

the import plugin searches the posts in a directory named 'source' or at a path defined in the config.

rel_path = self._jekyll_config.get('source', 'source')

but there is no such directory. maybe there was in earlier versions, i have jekyll 3.1.2 installed.

structure of new projects look like this:

my-awesome-site
├── _config.yml
├── _includes
│   ├── footer.html
│   ├── head.html
│   ├── header.html
│   ├── icon-github.html
│   ├── icon-github.svg
│   ├── icon-twitter.html
│   └── icon-twitter.svg
├── _layouts
│   ├── default.html
│   ├── page.html
│   └── post.html
├── _posts
│   └── 2016-03-02-welcome-to-jekyll.markdown
├── _sass
│   ├── _base.scss
│   ├── _layout.scss
│   └── _syntax-highlighting.scss
├── about.md
├── css
│   └── main.scss
├── feed.xml
└── index.html

and no 'source' parameter in config:

# Site settings
title: Your awesome title
email: [email protected]
description: > # this means to ignore newlines until "baseurl:"
  Write an awesome description for your new site here. You can edit this
  line in _config.yml. It will appear in your document head meta (for
  Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://yourdomain.com" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username:  jekyll

# Build settings
markdown: kramdown

my workaround changes the search path:

-         posts_path = os.path.join(self._jekyll_path, rel_path, '_posts')
+         posts_path = os.path.join(self._jekyll_path, '_posts')

import_tweets

I'm planning to implement import_tweets. Version V0.1 will:

  • read from Twitter provided json files for a user
  • present each tweet asking the user if adding it or not
  • have a non-interactive parameter
  • have a parameter to filter replies
  • generate rst posts, one per day with tweets
  • (probably) download images and include them in the posts

Ideas or suggestions?

Webapp: 500 Internal Server Error

Traceback (most recent call last):
  File "/usr/local/bin/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/local/bin/bottle.py", line 1732, in wrapper
    rv = callback(*a, **ka)
  File "/home/elia/nikola/plugins/webapp/webapp.py", line 98, in edit
    return render('edit_post.tpl', context)
  File "/home/elia/nikola/plugins/webapp/webapp.py", line 176, in render
    return lookup.get_template(template_name).render_unicode(**context)
  File "/usr/local/lib/python2.7/dist-packages/mako/template.py", line 452, in render_unicode
    as_unicode=True)
  File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 803, in _render
    **_kwargs_for_callable(callable_, data))
  File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 835, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mako/runtime.py", line 860, in _exec_template
    callable_(context, *args, **kwargs)
  File "base_tpl", line 30, in render_body
  File "edit_post_tpl", line 67, in render_content
AttributeError: 'NoneType' object has no attribute 'items'

This is what happens when I try to edit a post or a page.

typo in README

Note that the Travis CI test runner does not interpret requirements-nonpy.txt fies!

Note the "fies" . (I didn't make a PR because it's too ugly to have 1 merge commit for a typo fix)

Something went wrong with metadata update

Traceback (most recent call last):
  File "/home/ralsina/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit-0.28.0-py2.7.egg/doit/doit_cmd.py", line 165, in run
    return command.parse_execute(args)
  File "/home/ralsina/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit-0.28.0-py2.7.egg/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/home/ralsina/Desktop/proyectos/nikola/master/nikola/plugin_categories.py", line 114, in execute
    self._execute(options, args)
  File "/home/ralsina/Desktop/proyectos/static/plugins/upgrade_metadata/upgrade_metadata.py", line 80, in _execute
    with io.open(fname, 'r', encoding='utf-8') as fh:
IOError: [Errno 2] No existe el archivo o el directorio: 'posts/new-nikola-feature-wordpresscom-importer.txt.meta'

The files that actually exist:

(nikola)ralsina@yoga:~/Desktop/proyectos/static$ ls posts/new-nikola-feature-wordpresscom-importer.* -1
posts/new-nikola-feature-wordpresscom-importer.meta
posts/new-nikola-feature-wordpresscom-importer.meta.es
posts/new-nikola-feature-wordpresscom-importer.txt
posts/new-nikola-feature-wordpresscom-importer.txt.es

import_wordpress --no-downloads still creates empty folders

[2016-02-23T15:43:03Z] INFO: init: Created empty site at new_site.
[2016-02-23T15:43:03Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/05/dashboard.jpg => new_site/files/blog/wp-content/uploads/2007/05/dashboard.jpg
[2016-02-23T15:43:03Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/05/screenshot7.jpeg => new_site/files/blog/wp-content/uploads/2007/05/screenshot7.jpeg
[2016-02-23T15:43:03Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/07/p1012766.JPG => new_site/files/blog/wp-content/uploads/2007/07/p1012766.JPG
[2016-02-23T15:43:03Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2007/07/p1012763.JPG => new_site/files/blog/wp-content/uploads/2007/07/p1012763.JPG
[2016-02-23T15:43:03Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29.png
[2016-02-23T15:43:03Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-300x187.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-300x187.png
[2016-02-23T15:43:03Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-1024x640.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-1024x640.png
[2016-02-23T15:43:03Z] INFO: import_wordpress: Downloading http://davidak.de/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-150x150.png => new_site/files/blog/wp-content/uploads/2010/12/Bildschirmfoto-2010-12-14-um-19.47.29-150x150.png
new_site/files/blog/
└── wp-content
    └── uploads
        ├── 2007
        │   ├── 05
        │   └── 07
        └── 2010
            └── 12

Some of the things described in the README are temporarily false

  • install_plugin ignores the requirements files
  • the Extending Nikola page is outdated and a draft (cc @ralsina)
  • Travis ignores requirements.txt of plugins
  • conf.py.sample is ignored by install_plugin

And possibly:

  • There are no sample plugins (the README does not say a word about it, but it almost did)

odt plugin raises an exception

I tried odt plugin with Nikola 7.6.2 and a empty init site: https://plugins.getnikola.com/#odt

$ nikola build
Scanning posts...Traceback (most recent call last):
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/doit/doit_cmd.py", line 165, in run
    return command.parse_execute(args)
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/doit/cmd_base.py", line 380, in execute
    self, params, args)
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/__main__.py", line 282, in load_tasks
    self.nikola.gen_tasks('render_site', "Task", 'Group of tasks to render the site.'))
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/doit/loader.py", line 296, in generate_tasks
    for task_dict, x_doc in flat_generator(gen_result, gen_doc):
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/doit/loader.py", line 28, in flat_generator
    for item in gen:
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/nikola.py", line 1386, in gen_tasks
    for task in flatten(pluginInfo.plugin_object.gen_tasks()):
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/nikola.py", line 1380, in flatten
    for t in task:
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/plugins/task/indexes.py", line 51, in gen_tasks
    self.site.scan_posts()
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/nikola.py", line 1484, in scan_posts
    timeline = p.plugin_object.scan()
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/plugins/misc/scan_posts.py", line 98, in scan
    self.site.get_compiler(base_path)
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/post.py", line 143, in __init__
    default_metadata, self.newstylemeta = get_meta(self, self.config['FILE_METADATA_REGEXP'], self.config['UNSLUGIFY_TITLES'])
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/post.py", line 995, in get_meta
    meta.update(get_metadata_from_file(post.source_path, config, lang))
  File "/home/humitos/.virtualenvs/tmp-d115798aa0247311/local/lib/python2.7/site-packages/nikola/post.py", line 848, in get_metadata_from_file
    raise ValueError('Error reading {0}: Nikola only supports UTF-8 files'.format(source_path))
ValueError: Error reading posts/my_post.odt: Nikola only supports UTF-8 files

graphviz broken with python 3

  File "/home/ralsina/.virtualenvs/nikola/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 2103, in run_directive
    result = directive_instance.run()
  File "/home/ralsina/Desktop/proyectos/static/plugins/graphviz/graphviz.py", line 92, in run
    svg_data, errors = p.communicate(input=data)
  File "/usr/lib/python3.4/subprocess.py", line 960, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib/python3.4/subprocess.py", line 1602, in _communicate
    input_view = memoryview(self._input)
TypeError: memoryview: str object does not have the buffer interface

[orgmode] Issue with unicode filenames for posts

orgmode by @punchagan has received the following comment on its page (besides, that isn’t the best way to report issues, we need to rethink that):

When using Chinese title it will raise UnicodeEncodeError. The error was
occurred in function create_post: fd.write('..{0}: {1}\n'.format(k,v))
Change this line to fd.write(u'..{0}: {1}\n'.format(k,v)) solved the problem.But i still can't understand
why the same snippet in orgmode and reST,markdown..., only orgmode would
raise this error

Plugin dependencies

  • Find a sane way to implement it (a third file does not make much sense)
  • Make it nicely visible in the web app
  • Have the install_plugin option install the plugins
  • Make sure we do not break much by implementing it

Mustache TypeError

I am including the complete steps and output to reproduce.

(.venv)tritium@gesa:~/<redacted>$ mkdir temp
(.venv)tritium@gesa:~/<redacted>$ cd temp/
(.venv)tritium@gesa:~/<redacted>/temp$ nikola init -q .
[2016-02-27T05:27:15Z] INFO: init: Created empty site at ..
(.venv)tritium@gesa:~/<redacted>/temp$ nikola plugin -i mustache
[2016-02-27T05:27:29Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): plugins.getnikola.com
[2016-02-27T05:27:29Z] INFO: plugin: Downloading 'https://plugins.getnikola.com/v7/mustache.zip'
[2016-02-27T05:27:29Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): plugins.getnikola.com
[2016-02-27T05:27:29Z] INFO: plugin: Extracting: mustache into plugins/
(.venv)tritium@gesa:~/<redacted>/temp$ nikola new_post -t "Test post"
Creating New Post
-----------------

Title: Test post
Scanning posts......done!
[2016-02-27T05:27:49Z] INFO: new_post: Your post's text is at: posts/test-post.rst
(.venv)tritium@gesa:~/<redacted>/temp$ nikola build
Scanning posts......done!
.  render_tags:output/categories/index.html
.  render_galleries:output/galleries
.  render_galleries:output/galleries/index.html
.  render_galleries:output/galleries/rss.xml
.  copy_assets:output/assets/js/bootstrap.min.js
.  copy_assets:output/assets/js/jquery.colorbox-min.js
.  copy_assets:output/assets/js/flowr.plugin.js
.  copy_assets:output/assets/js/jquery.colorbox.js
.  copy_assets:output/assets/js/jquery.js
.  copy_assets:output/assets/js/jquery.min.js
.  copy_assets:output/assets/js/jquery.min.map
.  copy_assets:output/assets/js/bootstrap.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-tr.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-et.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-ru.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-bg.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-cs.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-pl.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-hr.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-lv.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-sr.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-kr.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-fi.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-bn.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-uk.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-de.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-fa.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-it.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-ar.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-zh-TW.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-gl.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-id.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-sk.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-es.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-ro.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-zh-CN.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-nl.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-fr.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-hu.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-si.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-my.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-lt.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-gr.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-ca.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-ja.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-no.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-pt-BR.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-sv.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-he.js
.  copy_assets:output/assets/js/colorbox-i18n/jquery.colorbox-da.js
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.ttf
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.eot
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.woff2
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.svg
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.woff
.  copy_assets:output/assets/css/bootstrap-theme.css.map
.  copy_assets:output/assets/css/bootstrap-theme.css
.  copy_assets:output/assets/css/colorbox.css
.  copy_assets:output/assets/css/docs.css
.  copy_assets:output/assets/css/bootstrap.css
.  copy_assets:output/assets/css/theme.css
.  copy_assets:output/assets/css/bootstrap-theme.min.css.map
.  copy_assets:output/assets/css/bootstrap.min.css
.  copy_assets:output/assets/css/bootstrap.min.css.map
.  copy_assets:output/assets/css/bootstrap-theme.min.css
.  copy_assets:output/assets/css/bootstrap.css.map
.  copy_assets:output/assets/css/images/loading.gif
.  copy_assets:output/assets/css/images/controls.png
.  copy_assets:output/assets/css/images/ie6/borderTopLeft.png
.  copy_assets:output/assets/css/images/ie6/borderTopRight.png
.  copy_assets:output/assets/css/images/ie6/borderBottomRight.png
.  copy_assets:output/assets/css/images/ie6/borderBottomCenter.png
.  copy_assets:output/assets/css/images/ie6/borderMiddleRight.png
.  copy_assets:output/assets/css/images/ie6/borderMiddleLeft.png
.  copy_assets:output/assets/css/images/ie6/borderBottomLeft.png
.  copy_assets:output/assets/css/images/ie6/borderTopCenter.png
.  copy_assets:output/assets/js/fancydates.js
.  copy_assets:output/assets/js/moment-with-locales.min.js
.  copy_assets:output/assets/js/html5.js
.  copy_assets:output/assets/xml/rss.xsl
.  copy_assets:output/assets/xml/atom.xsl
.  copy_assets:output/assets/css/nikola_ipython.css
.  copy_assets:output/assets/css/ipython.min.css
.  copy_assets:output/assets/css/ipython.min.css.map
.  copy_assets:output/assets/css/rst.css
.  copy_assets:output/assets/css/code.css
.  render_mustache:output/mustache-template.html
.  render_mustache:output/mustache.html
.  render_listings:output/listings/index.html
.  render_sources:output/posts/test-post.rst
.  render_archive:output/2016/index.html
.  render_archive:output/archive.html
.  render_posts:timeline_changes
.  render_posts:cache/posts/test-post.html
.  render_indexes:output/index.html
.  render_pages:output/posts/test-post.html
.  generate_rss:output/rss.xml
.  render_mustache:output/posts/test-post.json
########################################
TaskError - taskid:render_mustache:output/posts/test-post.json
PythonAction Error
Traceback (most recent call last):
  File "/home/tritium/<redacted>/.venv/lib/python3.5/site-packages/doit/action.py", line 383, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/home/tritium/<redacted>/temp/plugins/mustache/mustache/__init__.py", line 107, in write_file
    post.date.strftime(self.site.GLOBAL_CONTEXT['date_format']),
TypeError: strftime() argument 1 must be str, not TranslatableSetting



(.venv)tritium@gesa:~/<redacted>/temp$ nikola --version
Nikola vv7.7.6

upgrade_metadata fails for me

  • It fails to update old-style meta files that contain only a title.
  • It fails to update translated meta files when there is no matching translated text
  • A crash is triggered by a 2-file post where the post itself is translated but meta file is not:
$ ls -1 posts/desarrollando-aplicaciones-con-ubuntu-one.*
posts/desarrollando-aplicaciones-con-ubuntu-one.meta
posts/desarrollando-aplicaciones-con-ubuntu-one.txt
posts/desarrollando-aplicaciones-con-ubuntu-one.txt.es
[2015-09-09T00:02:38Z] INFO: upgrade_metadata:     posts/456.meta
[2015-09-09T00:02:38Z] INFO: upgrade_metadata:     posts/455.meta
[2015-09-09T00:02:38Z] INFO: upgrade_metadata:     posts/454.meta
Proceed with metadata upgrade? [y/n] y
Traceback (most recent call last):
  File "/home/ralsina/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit/doit_cmd.py", line 168, in run
    return command.parse_execute(args)
  File "/home/ralsina/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/home/ralsina/Desktop/proyectos/nikola/master/nikola/plugin_categories.py", line 127, in execute
    return self._execute(options, args)
  File "/home/ralsina/Desktop/proyectos/static/plugins/upgrade_metadata/upgrade_metadata.py", line 80, in _execute
    with io.open(fname, 'r', encoding='utf-8') as fh:
IOError: [Errno 2] No existe el archivo o el directorio: 'posts/desarrollando-aplicaciones-con-ubuntu-one.meta.es'

gallery_directive puts garbage in the output

The gallery_directive plugin puts too much cruft in the output. It should be rewritten so that only relevant bits are included. You can only see a duplicated footer, but the header and all the links/scripts/whatnot are also there…

We might need to refactor gallery templates — for example, create a special gallery_content.tmpl, and make gallery.tmpl just inherit from base and throw in gallery_content.tmpl.

//cc @ralsina

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.