From: Michal U. <xev...@us...> - 2022-05-03 16:11:29
|
--- ** [patches:#193] reST: include directive should support root-relative paths** **Status:** open **Group:** None **Created:** Tue May 03, 2022 04:03 PM UTC by Michal Urbanski **Last Updated:** Tue May 03, 2022 04:03 PM UTC **Owner:** nobody I'm building a static website using restructuredtext and I'm really annoyed by the lack of support for root-relative paths. I have already implemented multiple directive plugins for my website build process, some of which use external files in a different format. They use the convention that if a path begins with /, they are relative to the root directory of the project. IMO the requirement for relative paths is very limiting - I could have a directory with files intended for inclusion but: - I would need to use `../../` which is very ugly - relative paths are different depending on the current file path - this is very fragile and limits An additional argument is that C and C++ have been using #include for like 40 years and relative paths (while sometimes useful) are only for specific cases. The leading convention is to use root-relative paths. I could implement another plugin for it but ... copy-pasting docutils own code only to change few lines is definitely smelly. --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/patches/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Adam T. <aa-...@us...> - 2022-05-03 17:40:39
|
`/` in a (posix) filesystem denotes the actual root, surely? Using it as a marker for "project root" seems odd. Perhaps you could look at `tools/buildhtml.py`, or at `Sphinx`? Both allow for consistency in the CWD for when the documentation is rendered, perhaps allieviating your concern about fragility. I don't undertand how the relative path requirements are limiting, please could you provide some more context? A (P.S. this should be moved to "Feature Requests" -- @milde are you able to do that? I don't think I can move it, or at least there doesn't seem to be a button.) --- ** [patches:#193] reST: include directive should support root-relative paths** **Status:** open **Group:** None **Created:** Tue May 03, 2022 04:03 PM UTC by Michal Urbanski **Last Updated:** Tue May 03, 2022 04:03 PM UTC **Owner:** nobody I'm building a static website using restructuredtext and I'm really annoyed by the lack of support for root-relative paths. I have already implemented multiple directive plugins for my website build process, some of which use external files in a different format. They use the convention that if a path begins with /, they are relative to the root directory of the project. IMO the requirement for relative paths is very limiting - I could have a directory with files intended for inclusion but: - I would need to use `../../` which is very ugly - relative paths are different depending on the current file path - this is very fragile and limits An additional argument is that C and C++ have been using #include for like 40 years and relative paths (while sometimes useful) are only for specific cases. The leading convention is to use root-relative paths. I could implement another plugin for it but ... copy-pasting docutils own code only to change few lines is definitely smelly. --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/patches/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: Michal U. <xev...@us...> - 2022-05-03 19:16:10
|
> Using it as a marker for "project root" seems odd. Why do you think so? Absolute paths make no sense for any such project. `tools/buildhtml.py` and Sphinx - I'm using a different framework for building static websites. In addition, Sphinx is intended for documentation only and what I write resembles a virtual book. What I need is a format that supports somewhat rich text that is able to be transformed into HTML. reST with its extensibility (directive plugins) is the best thing I could find. I want support for root-relative paths because it would allow me to write many articles referring to common parts that have fixed location within the repository. I can then change/reorder pages and not worry that changing their paths breaks include directive. --- ** [patches:#193] reST: include directive should support root-relative paths** **Status:** open **Group:** None **Created:** Tue May 03, 2022 04:03 PM UTC by Michal Urbanski **Last Updated:** Tue May 03, 2022 05:32 PM UTC **Owner:** nobody I'm building a static website using restructuredtext and I'm really annoyed by the lack of support for root-relative paths. I have already implemented multiple directive plugins for my website build process, some of which use external files in a different format. They use the convention that if a path begins with /, they are relative to the root directory of the project. IMO the requirement for relative paths is very limiting - I could have a directory with files intended for inclusion but: - I would need to use `../../` which is very ugly - relative paths are different depending on the current file path - this is very fragile and limits An additional argument is that C and C++ have been using #include for like 40 years and relative paths (while sometimes useful) are only for specific cases. The leading convention is to use root-relative paths. I could implement another plugin for it but ... copy-pasting docutils own code only to change few lines is definitely smelly. --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/patches/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |