From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/21690 Path: news.gmane.org!.POSTED!not-for-mail From: Carsten Fuchs Newsgroups: gmane.text.pandoc Subject: Re: Handling internal references when converting from HTML to reStructuredText Date: Sun, 16 Dec 2018 10:56:11 +0100 Message-ID: References: <64bcee56-e23f-4206-8e78-ded10e90a2c1@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1544954047 25683 195.159.176.226 (16 Dec 2018 09:54:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Dec 2018 09:54:07 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCGLRHE66UIBBPGC3DQAKGQEH4WA6RQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Dec 16 10:54:03 2018 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-wm1-f63.google.com ([209.85.128.63]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gYT7a-0006bD-Fd for gtp-pandoc-discuss@m.gmane.org; Sun, 16 Dec 2018 10:54:02 +0100 Original-Received: by mail-wm1-f63.google.com with SMTP id y85sf4294403wmc.7 for ; Sun, 16 Dec 2018 01:56:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1544954173; cv=pass; d=google.com; s=arc-20160816; b=PaiDsu0A2xo83eREzPVzhoEWnvFHCZehYPGtpZEL9YuaAqPbsze+98rsJy+tmLRxRb DpBnJuq2ZajP2rWXP3IxKQH23qqFg3oZnv63H3SsWmM5f9e22fvvI3dD+GSmWSGfLEDU 8SytONQQdGHTohMj2qIq7BdTBZlcVTfTY9lSMMS+JXFFZoHZ9CVntrwNFUlHiZQWn7BW 6lCReAy27z6WJZTODWcptnBQUcjYq9GLHHo86sm9NyW4Fh+R9AxxsbcI+Lg0fSg5cZI7 4CVHfdviqNlx1+N/JIBv7qfBRos71wddiNDXuydPesXDs3RA50M+PEpLeUQSiG4Owf6x C5kg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:sender:dkim-signature; bh=pCAoH5z/r3nTWi9ce9mzCHPVMG43SR31BEX3jZxC2GI=; b=cHIDwJoBTFy9eSSnA3XNfPTh7Khe3pDW6cuYSs1eFO2nmpH3PrfzsmFpWsmhiK9HOg ik6VdeaX0dIgwqSP/fgWQEFREs/Gr2JNItrNi6HtznQlNnxkvJNEwh9XtSTEkIXhoOGE ISpxXzDcoR/y7/C+Xl22GSFLnNX0ZYn6NqvvSbBr7ztUXtZS+/+iML3Z0rAbI09zwzaW lomADAbijbj//1rodLxZXSOe2fDMCoBdC6xmUad0gvbVQmfZnjPqbYZVHyH0OXttoABE GsdxnUfhMRznxSZTIZjwshxUMYcLR5Ad7mexlpnB1IHIA/ckNk+EalUVabUxLJWzdYb5 DQSA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.227.126.133 is neither permitted nor denied by best guess record for domain of carsten.fuchs-SDYpArl04Oc@public.gmane.org) smtp.mailfrom=carsten.fuchs-SDYpArl04Oc@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=pCAoH5z/r3nTWi9ce9mzCHPVMG43SR31BEX3jZxC2GI=; b=I8vaVmdaERZKRsugonydcQQZ5P4SGMlL3y6xfQ19BxyXZg+vHS81hcvNfve717uuPp X7mkVToulFpffC4f8jcNaYgzJtuHO2P2d6DvnuAH6q8MwGq28VHjJzO971rDZb+t7Tzq vMcVx7qhkiSg0ChLszsAuWVVDaLNijR1NLiUZigWnsbwu8JnH/3sr4TJ6AIYVOKcD+hz Zi15/K3ZQy6XyKzCOyPWmFH3vkQuOMUr18GM1ZKlVptk9QgfM/ePf/R7uZ+4Oz0C97O+ v5F2SnteEZNqKCc/+5TLmt3gLpX+kTOI3f5klgypsOOfeVR6NQ0JhTooRlrW85Tf32TP LKNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=pCAoH5z/r3nTWi9ce9mzCHPVMG43SR31BEX3jZxC2GI=; b=N1tkMI7ZA6ZDdLHx/xvjlPvRPh0pzTWakki98mJhhYfGprl37rJPr7crW5+h/u3CcD oFpRpPV9eG67FKErqTmz+2OTIVyZcpjQP8R0ZPaYnZB8A3F65CKsLkq58xDlHRUb1Yfb RI8HKyOpt3mDwMFf+6YYZGZ7auP6irFp72NxEQ8T9zV2e279rMJwkPEHZ/81U8p5+Cyg Od++BKPu8tWnOcDgEn/tm4QyHri3+UABSB9WDN3+KJQ32QlsBRiVB/p94x9O3b+NTg2F xMAEaOPX1t5EvV700rpO910ulpbCKFiRcec6EgzNWLlhPJLNAlFZIMeBli97jJkcYqU6 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AA+aEWZX5wEp9KkzJhHx9Idnxd3bUetHI5dxcQyhjGzJbH6qFMn+EkH+ dC7Q7+P2F2s3t+RLmAv7L2M= X-Google-Smtp-Source: AFSGD/U3gbw9GFJ+IXPkag7hQXmn+UEkYJjOZjXizCz51UcZKYA/kJ6bB4aPhFJ4hvppa1tZQABTEQ== X-Received: by 2002:a1c:1589:: with SMTP id 131mr25929wmv.2.1544954173221; Sun, 16 Dec 2018 01:56:13 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:adf:eac3:: with SMTP id o3ls2800583wrn.8.gmail; Sun, 16 Dec 2018 01:56:12 -0800 (PST) X-Received: by 2002:a05:6000:100d:: with SMTP id a13mr968922wrx.2.1544954172429; Sun, 16 Dec 2018 01:56:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544954172; cv=none; d=google.com; s=arc-20160816; b=D4TJOkF03O2SN5ofu/A9ex9Mv1jx9y5cFsfGRdY2B6qaKaEk3jUp8YDtIpfxFYP7fm J54Q5L4QcRdTke/Q8tUfAHGeHOrwdoP3dLuF7Nn6vsLDxx0PHPlsWLRjEhami2ozB4fj PJF3JvokLStDSRTZyqwfb1DqncGHjGrBEAyRRUe+58vY2pDKbNCqBorTyMj1LIFXbJcN KNhg/snWau/nz7+oT7dDYPexQwyz7UUxjruzAr4Y+jnidUwPwg8T2DTRiy8YdSQq40oi mMNPHIGLYlUlOWGoVBj95cxmhLrDW+K7gkCLDecvrbGixXPAk5vfwoUq+pF1NlkXw/nU sq4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject; bh=fBWyYqQbRDCKeRSpF3Iq9p9HiPOivPixktFo7Lw+XKY=; b=UGTe/SPhDPg7mejIob7FuP568JQAI4Rf7MCOtv6N7L5mxgMkEnH95hYsVBore1Zo3b 7m3kGeWiAoEnQkTNA0/N/G9tWoen+I3D8DigzJ2auu6w5kUILyk2wha/x1KtDy1KA7XE xVl836XuwY0r7QEMyuPBSmcYumXvxNb+DDZBsbxFVpUWo1f/9OgRrBCeQxmpg4Vtje7T 7Ld3YvC6E7XrzK7Xom2LlpN7XkKRUZ/VVpbUnxRKs1SyteITSRuKzwXn3ljY8W9IVWgz RrN319Ftcd3xTcXflp822EHCF4zxhm5ZDm1u+txsdI4bEo3Bcu8CN5346y5KEES+Do6V bMHQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.227.126.133 is neither permitted nor denied by best guess record for domain of carsten.fuchs-SDYpArl04Oc@public.gmane.org) smtp.mailfrom=carsten.fuchs-SDYpArl04Oc@public.gmane.org Original-Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.126.133]) by gmr-mx.google.com with ESMTPS id d6si490648wro.4.2018.12.16.01.56.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Dec 2018 01:56:12 -0800 (PST) Received-SPF: neutral (google.com: 212.227.126.133 is neither permitted nor denied by best guess record for domain of carsten.fuchs-SDYpArl04Oc@public.gmane.org) client-ip=212.227.126.133; Original-Received: from [192.168.1.57] ([188.107.92.195]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MI5YN-1gbTwq3hhv-00FFkF for ; Sun, 16 Dec 2018 10:56:11 +0100 In-Reply-To: Content-Language: de-DE X-Provags-ID: V03:K1:Kn238M4SeTx3QlnFnHGpNugmmQEsyQOvbSIkhfW/Ne+G9zX04tC biEWvsHdP7pkawWJePAwlBmNjtK5AZK6VZSQiD4MnDuqiTPADG12p7zOK2fxUnW+8pNbH6o 7luvf1fEPPgtDVcMdmkygATzLw5dD7icfSzxcSEW1hcisHmE7rbVSD3dx9pDcDrIQr8WTEA 9QHZhgvFZ5qp0o7vnb76w== X-UI-Out-Filterresults: notjunk:1;V03:K0:HSH/D0wOVqo=:8KHJKR80lR/eDoXSWeflmY s9jFCadb7b7iwDMXuoLIzujLfe3T13I8aglUoHv2bWXu0+1r5XfGE6zpP845dn15faILl+06D xRahHRMh6ltJU8ZGoaUwQUnreKfiFv/cRG9qG0PGmESitp+UjtUlv8nB97+Y0966fTEqiJHJV bzqZmi2Zp6FKuA9VBYdyxEzVnjrwlea5z0PjmpHOV3HwxwRxv/AJOo8gqOEWBpTxSVzLb5D4m gn6oSMlNg9Hcrxn5rWjJfVZBYEFOnNe28CcPtb/bkY1J/BN18v+t9vsY+T7iaU1EHedO8DhBF Prgct6f9j1ll/FzFsL4KcDu6JyoCDdCWViqiQSuBue878pQsWKmrkGXgxNAmrhq8p/65Xy7W/ fwXxB8E2m1gTJ8ZKCCLAP8TpOZM5/8LjyInhGCbb0c/GmSFKSier5RSFt/onZ4I6yapptlQqN ApigqekmoijJUTjdicwW1RbrTXwUxvQVfqUu1tEcpHimj2Zdnijim8eeS3MiJf7vEVoDmemlf Sr7hhrx+n862xBIUONkCrspADvETC74+3J456CdqBvm7pQsGvz9GUCxkvloMG5OTQbV3fI25X jwom/VzTvpvcCeABoU3jJ3HmU3XcfSBAu+vQdvOsXZJYyTRS+vHjOfkgDB/N56OqTGLDUk0T8 AOph5L2bR0UnHeyEmtSnAM733HKpQSmerWgY/JAXufHRYqI+jnG4Zcx4Rq9FRmIOD+zcfbzks M35RhIJOHoDGoAtVQHWohFZRUCSAjQy2xWF5/ikQ9d9MAqoBhZ07ocEp4/M= X-Original-Sender: carsten.fuchs-SDYpArl04Oc@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.227.126.133 is neither permitted nor denied by best guess record for domain of carsten.fuchs-SDYpArl04Oc@public.gmane.org) smtp.mailfrom=carsten.fuchs-SDYpArl04Oc@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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:21690 Archived-At: Hi John, that's awesome, many thanks for your help! Best regards, Carsten Am 16.12.18 um 01:53 schrieb John MacFarlane: > > Currently the RST writer doesn't really distinguish > between links with internal targets (#...) and those > with external targets. It won't produce > :ref:`foo` or `foo`_ for the former. > > This is something we might think about changing in > the RST writer. However, in the mean time you can > deal with this by using a lua filter. Simply > intercept Links with the targets you're interested > in, and produce a RawInline('rst', ___) with the > exact RST you want. > > Carsten Fuchs writes: > >> Dear Pandoc group, >> >> I have a set of HTML files that originated from a DokuWiki wiki. >> The HTML files have a few external links such as https://... and mostly >> internal links to each other. For example in file introduction.html: >> >> Refer to section > "modeleditor:mainwindow">The Main Window. >> >> where modeleditor/mainwindow.html is another local file of the same overall >> document (a former wiki page). >> When converting the above HTML to RST, I would like Pandoc to treat the >> link () as an internal link, so that the >> generated reStructuredText contains e.g. >> >> :ref:`modeleditor_mainwindow` or `the-main-window`_ >> >> The exact name of the target label is not important: even if it results in >> a broken internal reference, I can fix these in a separate pre- or >> postprocessing step. >> >> The question is: >> How do I prepare the link to have Pandoc treat it as an >> internal reference? >> I have tried modifying the target of a Link node with a Lua filter script, >> but the result is always an external link such as >> `The Main Window <#_the_main_window>`__ >> in the generated RST file. >> >> Is there something else I can try in a Lua filter or as an independent >> preprocessing step to have such links treated as internal references? >> >> Best regards, >> Carsten >> >> -- >> 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/64bcee56-e23f-4206-8e78-ded10e90a2c1%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >