From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/17913 Path: news.gmane.org!.POSTED!not-for-mail From: Gianmarco Giordano Newsgroups: gmane.text.pandoc Subject: Sphinx Documentation: Pandoc conversion of md document relative links to rst Date: Tue, 18 Jul 2017 05:03:06 -0700 (PDT) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_227_1678020428.1500379386059" X-Trace: blaine.gmane.org 1500379395 18892 195.159.176.226 (18 Jul 2017 12:03:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Jul 2017 12:03:15 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDDYJOOK4QDBB6XRW7FQKGQE2FBPGGQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jul 18 14:03:07 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-io0-f187.google.com ([209.85.223.187]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXRDS-0004GU-5p for gtp-pandoc-discuss@m.gmane.org; Tue, 18 Jul 2017 14:03:02 +0200 Original-Received: by mail-io0-f187.google.com with SMTP id f1sf2857292ioj.1 for ; Tue, 18 Jul 2017 05:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=FZyb9z+zPAL2Hk9NBa/dKyN/KCv0ViaZfBNFZY6SgHs=; b=lNswpuG421hVB2zIfEYsGZ5JKQwP19JjAmXAN7kifcOfbzT5syWHYe8oO0+ef+IG10 zXOS4TXh8uKweyjW3cdyOWouP75Nc/HT/Mhysf36WR6x7cnO5qtNQSRbJTvOrONoNhdC 6ZaP9493AMzYiDzsDUax2O7SGiLb4j1bhC8BRyWMWY9u7+1jXigd+cT4Q1uqhpDk+hjJ bIqVrR+QIZrNqkJFw8IVMHx56yVH0si0Rwe8GuIXmnOPoUMZuqFiq/6dp6Xz43Q1w2B2 FbskNmAiEJJwU/2inBOWTYfblzmZ9SJ2McQuoueqSK2lqfrgZV1enOq5eQkMkojUMmmj uyng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=FZyb9z+zPAL2Hk9NBa/dKyN/KCv0ViaZfBNFZY6SgHs=; b=ubcWVitodcX8ZYrZYmAxSUT7zNP8vPMGbR+EgVBhWmLNF1FVDYEcziJTp5n52VVw+3 16f2v+24XGXIXa3ydSFe9cudb3s8O/hvLenwSMizAiqI4M2kOS6VDWd/P1enVFaERYLc 7nz712iO1rM8brZsmSmbuxmHhscbr1qLsD9A/eWqAs1eNnqxCC21pBycVYhuQTDg7k7o F5i0+IMCOipktm6aDE0z4zE6XZYhS4179kip3dZqYhIfsWlSACKX6tz0U1dThzbAVTBe 9D3yVDGL0CIRTrnX5wd8ZMed1B7TFhNk61/eeHkaP5WBRC6LfXHYrkwH/ItsP7kYtOVf baLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=FZyb9z+zPAL2Hk9NBa/dKyN/KCv0ViaZfBNFZY6SgHs=; b=BKk8tu57QD59aDZUhcLBs5KVVGxMavjXXMllBZxg90imBpyLZYqnjyTSxv5IuGlpUE F3rjZIds+TZhiQcBv1/NCrliZCzdDnwJKiGjaUwfiqMXNTc3TspfJNMLQ1hWkgRVsqLh tw9CZ54WX19MO6snyFAvEePAwErDwcU+4jl2KKAGwlgP0Vn4846LUzMvTwQhYzc0kfv1 fwf2mNLxmJX++wiVZmS3sAP/WE1H10yKh9KW9IHhn2N7A3iKBS0RUpeMCVnfY5W9+sgH cUXBTxU/vs1pb8Dc55/Wr6K+hhAqvz+K05QhOgLfaFcz08vOZ4ZmwP/+wG8lYMZexLQ/ qPfA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AIVw112+3fqcJMYhlhrRo3K2kq918ZPeid+NH2o/SDLVDxoZcmy5PmKC rJjXJcAGBR3VGQ== X-Received: by 10.36.57.79 with SMTP id l76mr68175ita.8.1500379387592; Tue, 18 Jul 2017 05:03:07 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.36.20.143 with SMTP id 137ls5293962itg.17.canary-gmail; Tue, 18 Jul 2017 05:03:06 -0700 (PDT) X-Received: by 10.36.125.65 with SMTP id b62mr66943itc.5.1500379386484; Tue, 18 Jul 2017 05:03:06 -0700 (PDT) X-Original-Sender: GiordGiammy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:17913 Archived-At: ------=_Part_227_1678020428.1500379386059 Content-Type: multipart/alternative; boundary="----=_Part_228_347379807.1500379386059" ------=_Part_228_347379807.1500379386059 Content-Type: text/plain; charset="UTF-8" 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`__ ** 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` * * 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`__ ** 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`:doc: ** working* *converted rst link -----> `myLinkName`: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. ------=_Part_228_347379807.1500379386059 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 pha= se where we want to use pandoc to convert our md's to rst files.
<= div>Currently I'm calling pandoc simply this way for all the files:

=C2=A0pandoc -s myfile= .md -o myfile.rst

Th= e problem is that relative links to md docs are converted as if they were a= bsolute reference links, and the system search for the "my_relative_fi= le" page inside the=C2=A0
html build folder (this would work= if the link had a .html extension at the end, but the md files linkiing co= mes without extension and we can't argue with that).
Examples= :


md link =C2= =A0 =C2=A0 =C2=A0-----> =C2=A0 =C2=A0 =C2=A0 =C2=A0[myLinkName](my_relat= ive_file) =C2=A0 =C2=A0 =C2=A0 =C2=A0 working
=
=C2=A0
converted rst link =C2=A0= =C2=A0 -----> =C2=A0 =C2=A0 `myLinkName<my_relative_file>`__ =C2= =A0 =C2=A0 =C2=A0 =C2=A0not working



Now, I have setted Sphinx s= o that the default role is :any: =C2=A0so deleting the last 2 unders= cores makes the thing work:

md link =C2=A0 =C2=A0= =C2=A0-----> =C2=A0 =C2=A0 =C2=A0 =C2=A0[myLinkName](my_relative_file) = =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0working
converted rst link =C2=A0 =C2=A0 -----> =C2=A0 =C2= =A0 `myLinkName<my_relative_file>` =C2=A0 =C2=A0 =C2=A0=C2=A0<= b>=C2=A0working



And, without the default role :any:, there are oth= er solutions that works, for example:

=C2=A0=C2=A0=
  1. =C2=A0 =C2=A0 =C2=A0Adding .html to the url
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 md link =C2=A0 =C2= =A0 =C2=A0-----> =C2=A0 =C2=A0 =C2=A0 =C2=A0[myLinkName](my_relative_fil= e) =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0working
<= div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 converte= d rst link =C2=A0 =C2=A0 -----> =C2=A0 =C2=A0 `myLinkName<my_relative= _file.html>`__ =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0working=

=C2=A0

=C2=A0 =C2=A0 =C2=A0 =C2=A02. =C2=A0 =C2=A0 Replacing the under= scores with the role :doc: or := any:, at the beginning or at the end of the link:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 md link =C2=A0 =C2=A0 =C2=A0-----= > =C2=A0 =C2=A0 =C2=A0 =C2=A0[myLinkName](my_relative_file) =C2=A0 =C2= =A0 =C2=A0 =C2=A0=C2=A0working
=C2=A0
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 converted rst link =C2=A0 =C2=A0 -----> =C2=A0 =C2= =A0 `myLinkName<my_relative_file>`:doc: =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0working

=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0converted rst link =C2=A0 =C2=A0 ----->= ; =C2=A0 =C2=A0 `myLinkName<my_relative_file>`:any: =C2=A0 =C2=A0 =C2= =A0=C2=A0=C2=A0working=C2=A0<= /div>


Now I= don't know if the fact that pandoc doesn't distinguish between rel= ative, absolute links etc. is intended or not or if (and accept my appologi= es
if this is the case) I'm missing something with pandoc.

So the working syntaxies that I've writte= n are part of a possible solution for my problem, which consist in a parsin= g solution to remove or replace the=C2=A0
double underscore (solu= tion with or without default role :any:), but I'd like not to been forc= ed 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
<= br>
=C2=A0

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@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.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_228_347379807.1500379386059-- ------=_Part_227_1678020428.1500379386059--