docutils says that include directive argument is the path to the file to be included, relative to the document containing the directive.
Currently include directives fail because nikola attempts to look up referenced files from the current working directory.
How to reproduce:
.. include:: foo.rst
I am hesitant to "fix" this since it's an incompatible change in behaviour (plus, it means bad things happen when you chain includes). I may document it instead.
Current .. import:: directive behaviour is incompatible with docutils. Sphinx and others follow that convention, you're effectively making Nikola incompatible with Sphinx, docutils and others aswell.
Consider this usecase: I have bunch of blogposts in one VCS tracked directory and stories are stored in multiple VCS tracked directories. Within one directory I need to keep the .. import:: directives intact and relative to the document that includes others, because I also want to generate PDF from those stories and that requires compatiliblity with docutils.
Since sphinx and docutils don't work the same as each other, I can only improve that slightly. Also, compatibility to older versions of Nikola is sort of more important.
I am sorry that I can't magically fix it for you straight away, but indeed I can't.
Not sure what to do about this one. Maybe discuss it in the mailing list, I guess.
@ralsina any resolution on this one? IMO just documenting our behavior should suffice; any changes will break tons of blogs…
On a side note: does docutils have any sort of “if nikola/if sphinx” facility?
@Kwpolska I think documenting is enough, yes. I don't understand the question, tho.
.. if:: nikola
Nikola-specific reST goes here, like the include directive with site-root-relative paths
.. if:: sphinx
Sphinx-specific reST goes here, like the include directive with input-file-relative paths
(very unlikely to be a thing)
Actually, sphinx has such a thing. I could add it to Nikola :-)
Signed-off-by: Chris Warrick <email@example.com>