* Sphinx Documentation: Pandoc conversion of md document relative links to rst
@ 2017-07-18 12:03 Gianmarco Giordano
0 siblings, 0 replies; only message in thread
From: Gianmarco Giordano @ 2017-07-18 12:03 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 3145 bytes --]
Hi to everyone who may answer,
I'm building a Sphinx documentation application having, as input, a
collection of md files.
Before the real building we have a preprocessing phase where we want to use
pandoc to convert our md's to rst files.
Currently I'm calling pandoc simply this way for all the files:
*pandoc -s myfile.md -o myfile.rst*
The problem is that relative links to md docs are converted as if they were
absolute reference links, and the system search for the "my_relative_file"
page inside the
html build folder (this would work if the link had a .html extension at the
end, but the md files linkiing comes without extension and we can't argue
with that).
Examples:
*md link -----> [myLinkName](my_relative_file) *
*working*
*converted rst link -----> `myLinkName<my_relative_file>`__ ** not
working*
Now, I have setted Sphinx so that the default role is *:any: * so deleting
the last 2 underscores makes the thing work:
*md link -----> [myLinkName](my_relative_file) *
*working*
*converted rst link -----> `myLinkName<my_relative_file>` *
* working*
And, without the default role *:any:*, there are other solutions that
works, for example:
1. *Adding .html to the url*
* md link -----> [myLinkName](my_relative_file)
**working*
* converted rst link ----->
`myLinkName<my_relative_file.html>`__ ** working*
2. *Replacing the underscores with the role **:doc: *or *:any:*,
at the beginning or at the end of the link:
* md link -----> [myLinkName](my_relative_file)
**working*
* converted rst link ----->
`myLinkName<my_relative_file>`:doc: ** working*
*converted rst link ----->
`myLinkName<my_relative_file>`:any: ** working*
Now I don't know if the fact that pandoc doesn't distinguish between
relative, absolute links etc. is intended or not or if (and accept my
appologies
if this is the case) I'm missing something with pandoc.
So the *working* syntaxies that I've written are part of a possible
solution for my problem, which consist in a parsing solution to remove or
replace the
double underscore (solution with or without default role :any:), but I'd
like not to been forced to implement it if there is something I didn't see
in pandoc
to resolve which are relative and which are absolute links.
Thank you in advance
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/cb91e632-4178-4082-9139-809e01a4e9f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 5824 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-18 12:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-18 12:03 Sphinx Documentation: Pandoc conversion of md document relative links to rst Gianmarco Giordano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).