#211 Paths in included files should be relative

sandbox
closed-invalid
nobody
None
5
2015-04-17
2012-11-15
Anonymous
No

Paths in included files should be relative to the directory of the included document.
For the moment they are relative to the directory of the master document.

I observed this behaviour while including source code in subdocuments.

Related

Bugs: #211

Discussion

  • Günter Milde
    Günter Milde
    2015-03-23

    • status: open --> pending-works-for-me
    • Group: --> sandbox
     
    • Tony Narlock
      Tony Narlock
      2015-03-25

      I do notice that sphinx include's seem to be relative to the root of the
      project.

      In docutils, is the intended behavior is to include relative to the cwd of
      the file being processed?

      On Mon, Mar 23, 2015 at 1:22 AM, "Günter Milde" milde@users.sf.net wrote:

      • status: open --> pending-works-for-me
      • Group: --> sandbox
      • Comment:

      I cannot reproduce.
      Added tests for the indirect inclusion of code and literal files in the
      Docutils test suite.

      With

      .. include:: mycode.py
      :code: python

      paths are relative to the included document!

      Maybe you are using a Sphinx directive?

      Status: pending-works-for-me
      Group: sandbox
      Created: Thu Nov 15, 2012 08:59 AM UTC by Anonymous
      Last Updated: Wed Aug 20, 2014 04:44 PM UTC
      Owner: nobody

      Paths in included files should be relative to the directory of the
      included document.
      For the moment they are relative to the directory of the master document.

      I observed this behaviour while including source code in subdocuments.

      Sent from sourceforge.net because docutils-develop@lists.sourceforge.net
      is subscribed to https://sourceforge.net/p/docutils/bugs/

      To unsubscribe from further messages, a project admin can change settings
      at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is
      a mailing list, you can unsubscribe from the mailing list.


      Dive into the World of Parallel Programming The Go Parallel Website,
      sponsored
      by Intel and developed in partnership with Slashdot Media, is your hub for
      all
      things parallel software development, from weekly thought leadership blogs
      to
      news, videos, case studies, tutorials and more. Take a look and join the
      conversation now. http://goparallel.sourceforge.net/


      Docutils-develop mailing list
      Docutils-develop@lists.sourceforge.net
      https://lists.sourceforge.net/lists/listinfo/docutils-develop

      Please use "Reply All" to reply to the list.

       

      Related

      Bugs: #211

      • David Goodger
        David Goodger
        2015-03-25

        I do notice that sphinx include's seem to be relative to the root of the
        project.

        That would be a bug.

        In docutils, is the intended behavior is to include relative to the cwd of
        the file being processed?

        Yes. See the spec for the "include" directive (http://docutils.sourceforge.net/docs/ref/rst/directives.html#include): "The directive argument is the path to the file to be included, relative to the document containing the directive."

         
        • Tony Narlock
          Tony Narlock
          2015-03-25

          This is docutils list, but for sake of posterity / clearing ambiguity,
          should someone come about this issue in the future:

          The sphinx include directive has a different behavior if you prepend "/" to
          a file path.

          "include (include reStructuredText from another file) – in Sphinx, when
          given an absolute include file path, this directive takes it as relative to
          the source directory" [1]_

          There is a difference between doing /mycode.py and mycode.py in
          sphinx's include.

          • mycode.py preserve's docutils behavior of being being relative to
            current file's path.
          • /mycode.py would be relative to the sphinx source directory

          For future questions relating to behavior of sphinx, you can visit the
          sphinx website at http://sphinx-doc.org/.

          .. [1] http://sphinx-doc.org/rest.html, March 25, 2015

          On Wed, Mar 25, 2015 at 12:48 PM, David Goodger goodger@users.sf.net
          wrote:

          I do notice that sphinx include's seem to be relative to the root of the
          project.

          That would be a bug.

          In docutils, is the intended behavior is to include relative to the cwd of
          the file being processed?

          Yes. See the spec for the "include" directive (
          http://docutils.sourceforge.net/docs/ref/rst/directives.html#include):
          "The directive argument is the path to the file to be included, relative to
          the document containing the directive."


          Status: pending-works-for-me
          Group: sandbox
          Created: Thu Nov 15, 2012 08:59 AM UTC by Anonymous
          Last Updated: Mon Mar 23, 2015 08:22 AM UTC
          Owner: nobody

          Paths in included files should be relative to the directory of the
          included document.
          For the moment they are relative to the directory of the master document.

          I observed this behaviour while including source code in subdocuments.

          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/docutils/bugs/211/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Bugs: #211

  • Günter Milde
    Günter Milde
    2015-03-23

    I cannot reproduce.
    Added tests for the indirect inclusion of code and literal files in the Docutils test suite.

    With

    .. include:: mycode.py
       :code: python
    

    paths are relative to the included document!

    Maybe you are using a Sphinx directive?

     
  • Günter Milde
    Günter Milde
    2015-04-17

    • status: pending-works-for-me --> closed-invalid
     
  • Günter Milde
    Günter Milde
    2015-04-17

    For the moment they are relative to the directory of the master document.

    This is not Docutils behaviour. Instead,

    Paths in included files are relative to the directory of the included document. This is the intended and tested Docutils behaviour.