Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include directive broken #932

Closed
laurivosandi opened this issue Nov 25, 2013 · 9 comments
Closed

Include directive broken #932

laurivosandi opened this issue Nov 25, 2013 · 9 comments

Comments

@laurivosandi
Copy link

Hi,

docutils says that include directive argument is the path to the file to be included, relative to the document containing the directive.

http://docutils.sourceforge.net/docs/ref/rst/directives.html#including-an-external-document-fragment

Currently include directives fail because nikola attempts to look up referenced files from the current working directory.

How to reproduce:

  1. Create file foo.rst in posts/
  2. Create bar.rst in posts/ and insert .. include:: foo.rst
  3. Issue nikola build
@ralsina
Copy link
Member

ralsina commented Nov 26, 2013

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.

@laurivosandi
Copy link
Author

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.

@laurivosandi
Copy link
Author

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.

@ralsina
Copy link
Member

ralsina commented Nov 26, 2013

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.

@ralsina
Copy link
Member

ralsina commented Apr 18, 2014

Not sure what to do about this one. Maybe discuss it in the mailing list, I guess.

@ralsina ralsina added this to the Whenever milestone Apr 18, 2014
@Kwpolska
Copy link
Member

@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 Kwpolska modified the milestones: 7.5.2, Whenever Jun 11, 2015
@ralsina
Copy link
Member

ralsina commented Jun 11, 2015

@Kwpolska I think documenting is enough, yes. I don't understand the question, tho.

@Kwpolska
Copy link
Member

pseudocode:

.. 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)

@ralsina
Copy link
Member

ralsina commented Jun 11, 2015

Actually, sphinx has such a thing. I could add it to Nikola :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants