From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18288 Path: news.gmane.org!.POSTED!not-for-mail From: gw2286-WLbs8XpHrcb2fBVCVOL8/A@public.gmane.org Newsgroups: gmane.text.pandoc Subject: Using Pandoc for general text processing, e.g. writing a Ctags emitter: source text info in the AST Date: Wed, 11 Oct 2017 10:35:55 -0700 (PDT) Message-ID: <9c830d97-68ca-4cda-8892-3cad8b2c975d@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_12740_1682684528.1507743355558" X-Trace: blaine.gmane.org 1507743360 26219 195.159.176.226 (11 Oct 2017 17:36:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Oct 2017 17:36:00 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDU5N352VEMBB7FM7HHAKGQE4DFJP4I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Oct 11 19:35:55 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oi0-f55.google.com ([209.85.218.55]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2Kv7-0005VZ-GY for gtp-pandoc-discuss@m.gmane.org; Wed, 11 Oct 2017 19:35:49 +0200 Original-Received: by mail-oi0-f55.google.com with SMTP id 14sf1793246oii.2 for ; Wed, 11 Oct 2017 10:35:57 -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=e0xMyiU7UQeJMCGYC4ByuJ4QL+ZOLZNoIoDzMUB9mUc=; b=aZZ1CiwamXA4pQFSjvUKmLK/ubAK5lNizaTFJur3R5J4jFZs45+XFhAFnbwMEhLkTv E+PGAArpxaKtWQHb+9VPQp+SWWhXwYkab9D12nr8SrDO4fbg9WVMt5bUCX/eaDpK7oxf L+L/+RrZ8sWGJiY0EHyIgECXC3ClX0vDdiDnWUaz7ElmXaFo7Zil8Zi/yF/cNTINtAUl puI76eiOS8UV0X7ltvHCaazIc2nC6CguKz3OYpSHAvohg9fmPvPxHNqyzZTsbDfjalDP 2Zqsd4j3YwePMBTpW8Be+IrHABsVtlX5Zefq2s5bY0ai/gdzOmtlze91B3alDEaNYRTL aEQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=columbia-edu.20150623.gappssmtp.com; s=20150623; 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=e0xMyiU7UQeJMCGYC4ByuJ4QL+ZOLZNoIoDzMUB9mUc=; b=AKgXytKzIuB4oeBznyrMxB8PBFizzoktCBfr6oR1L1OmeRrAbrV7Fhg1Cr++0Uxux0 DRSfsFR2+0izmP7cZ3O5gIlfYzBT94DmxixQEXuJbVuBqS2IBSJbsFKdfcT3dQI0wnsm q1XXr6VOKSlZ87JqAKKdEtafckB2Pdl1nw6c5K9Uymtl8Gnv5EalIfNcAe/cfgA66dP4 XQ0u6lxJFNJDUve5WfSEiyyzcSHGDc87gLMLjiliTLCnv810YdJGAV1rMtxpt9n4bRN9 LseTaLdTI+E4WU9pdX7YTBXuy8X6SXLWpECRhnNDcQ1aWciB+VwxOnM7r0Lz3dJKqME4 LoTg== 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=e0xMyiU7UQeJMCGYC4ByuJ4QL+ZOLZNoIoDzMUB9mUc=; b=OK0fWZTXr5X3wQVoWM6+KnUykzzrhRhrwgQjpoQD1kdGlOAhm3Rp7AZeRA8xq215Gt IVNn3sh8WBL0AmzgCbFRx7dg+ncFnvjzwbdqBxblaHdBz6rMF3EwatpPNICSzOS1BkVt f56pq8EiH2VVdaFJS6a0Sqktk/LJIn4iWLiYc82gsjiugGEgwenCpivkUlozT4zt9riO JjfZD5yuP53jcCDg5ZdfCuhFQxRMY8Cg+2U7OFpK1wFAXxEvfRcwcvUlCdhxiMhITPZv SAkBbpIDB0UfIc0jNqS36DhlfsNDI5Oee3gQu316b2YtVuszaVR0iiyNCqnD3VcwBchI AOxQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AMCzsaUaVm5eWoY39wqSPEbHWgI4f/GYTaVWeu53xOIO2k2+tU/2yBeC wvGeSy4PwmI98D2JPNoVBjA= X-Google-Smtp-Source: AOwi7QDK5T7Ko0M99y95GNODAxTYq0bG2IovjNxiiycyAngtL0N3r1F8fAkBXDXrJeRRAmsjDU1+xg== X-Received: by 10.157.54.53 with SMTP id w50mr78554otb.2.1507743356909; Wed, 11 Oct 2017 10:35:56 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.12.144 with SMTP id b16ls589620otb.5.gmail; Wed, 11 Oct 2017 10:35:56 -0700 (PDT) X-Received: by 10.157.14.201 with SMTP id 67mr62775otj.4.1507743356028; Wed, 11 Oct 2017 10:35:56 -0700 (PDT) X-Original-Sender: gw2286-WLbs8XpHrcb2fBVCVOL8/A@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:18288 Archived-At: ------=_Part_12740_1682684528.1507743355558 Content-Type: multipart/alternative; boundary="----=_Part_12741_232693706.1507743355558" ------=_Part_12741_232693706.1507743355558 Content-Type: text/plain; charset="UTF-8" I'm interested in using Pandoc to write a generic Ctags emitter. However, I'm finding this is difficult because it seems impossible to connect a node to its original source code in the current API(s). Is there any way to access the line number in the source file where a node first appears, from the Haskell API or the JSON formatted output? If not, is this something that would be feasible to track and expose? Or, to stretch the idea a bit, would it be totally crazy to extend Pandoc with the ability to attach this kind of metadata to each node, or perhaps allow a reader to attach *arbitrary* metadata? In the latter case, the structure of the node-level metadata would be a matter of convention, and writers would be free to simply ignore it. I'm asking about both the feasbility of implementation ("would it be possible without having to rewrite huge amounts of code?") and the desirability of implementation ("is this something the Pandoc project is interested in?"). For what it's worth, I don't envision this being useful solely for Ctags tag generation, although IMO a "format-agnostic" tag generator for dozens of markup formats that comes "for free" out of a single implementation seems like a good enough prize on its own, so long as you can easily add, say, "linenrStart", "linenrEnd", and/or "verbatimSource" attributes to the reader. You could also use this ability to create Pandoc-based code/text formatters and linters that introspect on the contents of nodes, or automatically inject a "view source for this section on GitHub" link into top-level headings. -- 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/9c830d97-68ca-4cda-8892-3cad8b2c975d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_12741_232693706.1507743355558 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm interested in using Pandoc to write a generic Ctag= s emitter. However, I'm finding this is difficult because it seems impo= ssible to connect a node to its original source code in the current API(s).=

Is there any way to access the line number in the source file where= a node first appears, from the Haskell API or the JSON formatted output? I= f not, is this something that would be feasible to track and expose?
Or, to stretch the idea a bit, would it be totally crazy to extend Pandoc = with the ability to attach this kind of metadata to each node, or perhaps a= llow a reader to attach *arbitrary* metadata? In the latter case, the struc= ture of the node-level metadata would be a matter of convention, and writer= s would be free to simply ignore it.

I'm asking about both the f= easbility of implementation ("would it be possible without having to r= ewrite huge amounts of code?") and the desirability of implementation = ("is this something the Pandoc project is interested in?").
For what it's worth, I don't envision this being useful solely fo= r Ctags tag generation, although IMO a "format-agnostic" tag gene= rator for dozens of markup formats that comes "for free" out of a= single implementation seems like a good enough prize on its own, so long a= s you can easily add, say, "linenrStart", "linenrEnd", = and/or "verbatimSource" attributes to the reader. You could also = use this ability to create Pandoc-based code/text formatters and linters th= at introspect on the contents of nodes, or automatically inject a "vie= w source for this section on GitHub" link into top-level headings.
=

--
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/9c830d97-68ca-4cda-8892-3cad8b2c975d%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_12741_232693706.1507743355558-- ------=_Part_12740_1682684528.1507743355558--