From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33309 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'William Lupton' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Assigning identifiers to definition items Date: Sun, 12 Nov 2023 10:50:01 +0000 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000060a1850609f25147" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4882"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBZ63YKVAMGQEIQHJ6PA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Nov 12 11:50:22 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f184.google.com ([209.85.208.184]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1r282n-00012z-CC for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 12 Nov 2023 11:50:21 +0100 Original-Received: by mail-lj1-f184.google.com with SMTP id 38308e7fff4ca-2c82f76f9c4sf18686051fa.1 for ; Sun, 12 Nov 2023 02:50:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699786220; cv=pass; d=google.com; s=arc-20160816; b=vU2HgCxhpaO3Pxjj99Nkw45H51GgUUui0kFa/iogTcIMxEj4o43pis3J7TF9Id1/kK ohEsew4NzR9qsjGQduIBXlZIOjpXs68xv4Dm3jlZP/8b4usK+oZQY6maZzOQCns1GVLE CchJs8wJvSnqktUyJL4juYAYJsQyY/qENLeGMjyoL6riq17848ryzws5ltdLVdW+MDpy JgMBrbizgX1u4e+iumC6T7n8oJ5eX0kHtcon0DbOqQ5xNjxCHW1Dey5QrBOtr1fmuA1r ZFuw2UeYDi79mb8QP5JHocUPpdbbCUHg/3ynnhCQohA8zxW7q8KzR2/+yfMMuYzqn98P bOIQ== 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:to:subject:message-id:date :from:in-reply-to:references:mime-version:dkim-signature; bh=FLM9gE1q4l7mpGNR/L1lolaPDaAOzLDGqsdQ4KUASP4=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=sy7PB87CYRjWHnM/qbVkIjGahurNDee2uxJS9k9lx7qniN4eInIaVhcZhqscGggztN BYck7bzoFD9568F4nHIuXLww1TYhQaPRBfrxMzaZUjgi2NRPaL0w4jAdbmzsShOnq/pM OLhks3Dvh0nBNC5qzsR/r00dtE2zfIeBeItAdePz+5CbUfcK1/rKPT+8bfXitjcwm3CD hXgUgkW/4luWrSxXQZ5UhYmLPEY19ctqvXWozDGvFciDcUnnIX5PxRq65TQb+ku1Vv66 IGWCj4AzFXN0e/yuMN0Z0rZ/kuN11JXupm/TjGi7eD/jV335zuJW6EA4BZmKJKa6XLE0 N7PA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=Yqt66bZr; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62d as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1699786220; x=1700391020; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=FLM9gE1q4l7mpGNR/L1lolaPDaAOzLDGqsdQ4KUASP4=; b=RquKqcslOw2Q8vVovR2nDbtZEyG0mzdAZQpOU8D/ra8R/4tUj075eovbc3bO3KhOth XOSQzDBdWXL4wVT2AnkS2JesKXY2pI335QR5FwYtBovA8FX44A86YphVqMdrXrt/ZQg2 II4Ov1oRHf/P49ewyVronnt94LDeq0xVAa0sIaPfPEfwGk0fqVwg0gd32IaBOsQRoKRQ dpF4uMiKg74Gb5A7g4IWL/9m1OvNCCKMJfllGtYz4lGHxCAVfNIEH8XfhEB/VtwU1QB0 6ZRFj4txfR31O3OoHRah+pIVtnHcVKDMebLp8ptDde5pvaFI7/iybzcLzNU X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699786220; x=1700391020; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FLM9gE1q4l7mpGNR/L1lolaPDaAOzLDGqsdQ4KUASP4=; b=sixpt1A9cumaPU6W7mzvMWufsTRKIQBrHgc3VFx/qG9wgfvqWSX4N+avHxmaqXx1d0 xydAGYu73VTDpe2VoOQBaLQob8+1NEONgslC73yNASl8MSGS6ZZ4+ihVujzKbTAWO3BJ kFPCeQyck4rOFHUeSjFE6ZvAcOLOE3fCxLWA2LXDYq6iOm2ihxQv4hRLOu+u8Ei3IR5I LnM+CYqYCx8XSgSf9YVCmcGQnnKHOJjZ9VLnOELUkpcgBfTXYcff0sh22wzx6CZtnLAE p/gl42YELj8Wu X-Gm-Message-State: AOJu0YygqBDLCD1lUYCRKTnLwIOFL4PdYk6u1uYkfs8c6k36izeB0eY/ w9SvZJMHmg+W8LMgsMMwMMQ= X-Google-Smtp-Source: AGHT+IF7rTbvIKk4h3+Q9po3ofGVRTH4H1iDM3aUsncuEU33Kbf84cI1hXEv0sduwa/Uy5KP7P1GDQ== X-Received: by 2002:a05:651c:c85:b0:2c5:1f57:1ef5 with SMTP id bz5-20020a05651c0c8500b002c51f571ef5mr3736148ljb.39.1699786219856; Sun, 12 Nov 2023 02:50:19 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:9b53:0:b0:2bf:f55d:1df9 with SMTP id o19-20020a2e9b53000000b002bff55d1df9ls233467ljj.1.-pod-prod-05-eu; Sun, 12 Nov 2023 02:50:13 -0800 (PST) X-Received: by 2002:ac2:522f:0:b0:503:2d9d:8226 with SMTP id i15-20020ac2522f000000b005032d9d8226mr2471391lfl.17.1699786213483; Sun, 12 Nov 2023 02:50:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699786213; cv=none; d=google.com; s=arc-20160816; b=iM/ygbDjEeMcznmrNPrMYeqVRZd4fv5hNAX8X1yzIFuJTad8v+sSjjXSawxqdrMQN1 b44Ry9bDiLwQidVwUizKXrbnIRVFZjqOuLOpneFIA3o5JrgwsmcFGWAXIcjXKhzhoj2b djAHtqPKqbnCixzSLnXPKiAF44kJJ0FJGu0z1fcda5yTl6g//WO/M+P+0KBUinh8nNHi QnORT9Bn6cqFsz+yss/2NjfLtim95/EqALaPPxwrB5WYZQQwmXz1AZUaEHzlDOrA6ymZ tJaiGpBbVMJJQwZQldqwMkjoEewgDic9Fu0N5fCoD5jMvZzkvVeoWg93aFc30zRczEUW KNgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wVWP53/3MVextuLlvfskQhZFljufvdb+QdSKHP4UwKU=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=UH1DXcFRMP/aKYKHDfkguDvyoO7sbu8JrGyeZO3Vr0XMFFDhvqJfa/Vg5HGn5jEbmJ FOjjmCSU/DtBuTZ7Igp4sHP7Qb/DHVzjrv7blseiBQcH0DJBOIq7LdehEjCmCSkVa29e RGIG73kFQPOrK9ZqCGQcFgPqU7UQ0Axp6QSujhDzFFqjoiXd0IxrMjN9oAgGmNy55wIL OzQNrN5ree4t+1mFQNmjeZc6vIziBGpL67TJeUv9a4SQXygNdUJiu/8Yj67keb57VLBj ahtCt/JLkXRVXo4TlqRg6sf1gMqBe3wna1wUNUe9u8dzupFDzpxPhZm8sT5ScXtenTeI db8Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=Yqt66bZr; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62d as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org Original-Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com. [2a00:1450:4864:20::62d]) by gmr-mx.google.com with ESMTPS id u17-20020a056512129100b004ffa201cad8si144322lfs.9.2023.11.12.02.50.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Nov 2023 02:50:13 -0800 (PST) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62d as permitted sender) client-ip=2a00:1450:4864:20::62d; Original-Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9dd6dc9c00cso547980766b.3 for ; Sun, 12 Nov 2023 02:50:13 -0800 (PST) X-Received: by 2002:a17:906:140d:b0:9bf:2f84:5de7 with SMTP id p13-20020a170906140d00b009bf2f845de7mr2949154ejc.4.1699786212280; Sun, 12 Nov 2023 02:50:12 -0800 (PST) In-Reply-To: X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=Yqt66bZr; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62d as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org X-Original-From: William Lupton 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.io gmane.text.pandoc:33309 Archived-At: --00000000000060a1850609f25147 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable BTW, sorry for failing to read your original message properly! Right. The auto-identifiers.lua filter is not yet in pandoc-ext, but I'll look into adding it. Note that it doesn't remove the need to add an identifier (it just derives the identifier from the content). I think that auto-defined identifiers are only appropriate for terms, not for definitions, but you could use a filter such as the one shown below to auto-add identifiers to definitions if their terms have identifiers. Using this input (based on Bastien's): [Term 1]{#t1} : Definition 1 : Definition 2 Term 2 : Definition 1 Here Term 1 has [this meaning](#t1-def2). gives this HTML:
Term 1

Definition 1

Definition 2

Term 2

Definition 1

Here Term 1 has this meaning.

The filter: function DefinitionList(list) local changed =3D false for _, item in ipairs(list.content) do local term =3D item[1] local defs =3D item[2] if (#term > 0 and term[1].tag =3D=3D 'Span' and #term[1].attr.identifier > 0) then local term_id =3D term[1].attr.identifier for i, def in ipairs(defs) do if #def > 0 then local def_id =3D string.format('%s-def%s', term_id, i) def[1].content:insert( 1, pandoc.Span({}, pandoc.Attr(def_id))) changed =3D true end end end end if changed then return list end end On Sun, 12 Nov 2023 at 10:27, A A wrote: > Hey William, > > I'd be interested in getting a hold of that filter you mentioned, I can > see how it would greatly reduce the amount of bookkeeping required here. > > I did check in https://github.com/pandoc/lua-filters as well as the link > you provided but couldn't find it. I could also technically make my own > filter or post-process the resulting document using JS but if you have th= at > filter on hand that would be very helpful. > > Regards, > > Amine > > On Sun, 12 Nov 2023 at 11:13, A A wrote: > >> Nevermind sorry. Please disregard my last reply. The anchor link works >> fine. >> >> On Sun, 12 Nov 2023 at 11:05, A A wrote: >> >>> Ok, thanks for that, but when I try to convert something like the >>> following: >>> >>> [USA]{#usa} >>> : United States of America >>> >>> The resulting HTML looks like this: >>> >>>
USA
>>>
>>> United States of America >>>
>>> >>> The hash symbol gets dropped which basically makes that span useless as >>> the target of an anchor link. I think I=E2=80=99m probably still doing = something >>> wrong but I=E2=80=99m not sure what. >>> >>> On Sat, 11 Nov 2023 at 23:57, Bastien DUMONT bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org >>> wrote: >>> >>> Same thing, but on the definition: >>>> >>>> Term 1 >>>> >>>> : Definition 1 >>>> >>>> : [Definition 2]{#t1-def2} >>>> >>>> Term 2 >>>> >>>> : Definition 1 >>>> >>>> Here Term 1 has [this meaning](#t1-def2). >>>> >>>> You will not get the id on the
element directly, but on a >>>> inside
. >>>> >>>> Le Saturday 11 November 2023 =C3=A0 10:57:48PM, A A a =C3=A9crit : >>>> > Thanks William, this will certainly come in handy, however I was >>>> asking about >>>> > linking to specific *definitions*, not *terms*, i.e. in the case >>>> where I have >>>> > multiple definitions for a single term, I'd like to be able to link >>>> to only one >>>> > of them from another definition or from the main body of my >>>> document.... >>>> > >>>> > On Mon, 6 Nov 2023 at 16:02, 'William Lupton' via pandoc-discuss <[1= ] >>>> > pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> wrote: >>>> > >>>> > You can use [2]bracketed spans to do this manually, as in: >>>> > >>>> > [Term 1]{#term-1} >>>> > ... >>>> > Reference to [Term 1](#term-1). >>>> > >>>> > We use an auto-identifiers.lua filter that I could probably add >>>> to [3] >>>> > pandoc-ext. This will auto-derive the identifiers from the span >>>> content. >>>> > This allows you to write this: >>>> > >>>> > [Term 1]{} >>>> > ... >>>> > Reference to [Term 1](). >>>> > >>>> > or this (the t: is used as a prefix): >>>> > >>>> > [Term 1]{#t:} >>>> > ... >>>> > Reference to [Term 1](#t:). >>>> > >>>> > The latter example generates this HTML. >>>> > >>>> >
Term 1
>>>> > ... >>>> >

Reference to Term 1.

>>>> > >>>> > On Mon, 6 Nov 2023 at 12:14, A A <[4]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>>> wrote: >>>> > >>>> > >>>> > Pandoc will convert the following markdown: >>>> > >>>> > Term 1 >>>> > >>>> > : Definition 1 >>>> > >>>> > : Definition 2 >>>> > >>>> > Term 2 >>>> > >>>> > : Definition 1 >>>> > >>>> > To the following HTML: >>>> > >>>> >
>>>> >
Term 1
>>>> >
>>>> >

Definition 1

>>>> >
>>>> >
>>>> >

Definition 2

>>>> >
>>>> >
Term 2
>>>> >
>>>> >

Definition 1

>>>> >
>>>> >
>>>> > >>>> > How easy/straightforward is it to assign identifiers to >>>> specific >>>> > definition items in markdown? For example such that the >>>> resulting HTML >>>> > looks like the following: >>>> > >>>> >
>>>> >
Term 1
>>>> >
>>>> >

Definition 1

>>>> >
>>>> >
>>>> >

Definition 2

>>>> >
>>>> >
Term 2
>>>> >
>>>> >

Definition 1

>>>> >
>>>> >
>>>> > >>>> > -- >>>> > You received this message because you are subscribed to the >>>> Google >>>> > Groups "pandoc-discuss" group. >>>> > To unsubscribe from this group and stop receiving emails fro= m >>>> it, send >>>> > an email to [5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> > To view this discussion on the web visit [6] >>>> https://groups.google.com/d >>>> > /msgid/pandoc-discuss/ >>>> > CAMwawgNTwDo55QU5dZsgeXQpG9jAr1_RevLPdshEjFgqyF%3DgLQ% >>>> 40mail.gmail.com. >>>> > >>>> > -- >>>> > 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 [7]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> > To view this discussion on the web visit [8] >>>> https://groups.google.com/d/ >>>> > msgid/pandoc-discuss/ >>>> > CAEe_xxiyw7-04ghifFmDDv3XH0rBVL-WszRX44%3D27Q_OP%2BXSnA% >>>> 40mail.gmail.com. >>>> > >>>> > -- >>>> > 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 [9]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> > To view this discussion on the web visit [10] >>>> https://groups.google.com/d/msgid/ >>>> > pandoc-discuss/ >>>> > CAMwawgMn0hHWHAk7wAk0GYFrjgh%3Do5R3yhZjB5kSpcNxWhvb%3DA% >>>> 40mail.gmail.com. >>>> > >>>> > References: >>>> > >>>> > [1] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>> > [2] https://pandoc.org/MANUAL.html#extension-bracketed_spans >>>> > [3] https://github.com/pandoc-ext >>>> > [4] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >>>> > [5] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>> > [6] >>>> https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgNTwDo55QU5dZsg= eXQpG9jAr1_RevLPdshEjFgqyF%3DgLQ%40mail.gmail.com?utm_medium=3Demail&utm_so= urce=3Dfooter >>>> > [7] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>> > [8] >>>> https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxiyw7-04ghifFmD= Dv3XH0rBVL-WszRX44%3D27Q_OP%2BXSnA%40mail.gmail.com?utm_medium=3Demail&utm_= source=3Dfooter >>>> > [9] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>> > [10] >>>> https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgMn0hHWHAk7wAk0= GYFrjgh%3Do5R3yhZjB5kSpcNxWhvb%3DA%40mail.gmail.com?utm_medium=3Demail&utm_= source=3Dfooter >>>> >>>> -- >>>> 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 view this discussion on the web visit >>>> https://groups.google.com/d/msgid/pandoc-discuss/ZVAG4DKHakT2qzn6%40lo= calhost >>>> . >>> >>> >>>> -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgMH_vudUviXZa8odQ-= jyn5Snk3YYGzx4K9to2RBQ_dpOA%40mail.gmail.com > > . > --=20 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 e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAEe_xxjOecwEVJSiO%2BBQDVHqc1zaDxHZuuzDSTDjZEmQna4xOg%40mail= .gmail.com. --00000000000060a1850609f25147 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
BTW, sorry for failing to read your original message = properly!

Right. The auto-identifiers.lua filter is not= yet in pandoc-ext, but I'll look into adding it. Note that it doesn= 9;t remove the need to add an identifier (it just derives the identifier fr= om the content).

I think that auto-defined identifiers a= re only appropriate for terms, not for definitions, but you could use a fil= ter such as the one shown below to auto-add identifiers to definitions if t= heir terms have identifiers. Using this input (based on Bastien's):

[Term 1]{#t1}

: Defin= ition 1

: Definition 2

Term 2

: Definition 1

He= re Term 1 has [this meaning](#t1-def2).


gives this HTML:

<dl&= gt;
<dt><span id=3D"t1">Term 1</span></dt= >
<dd>
<p><span id=3D"t1-def1"></sp= an>Definition 1</p>
</dd>
<dd>
<p><s= pan id=3D"t1-def2"></span>Definition 2</p>
<= /dd>
<dt>Term 2</dt>
<dd>
<p>Definition= 1</p>
</dd>
</dl>
<p>Here Term 1 has <= a href=3D"#t1-def2">this meaning</a>.</p>

The filter:

function DefinitionList(list)
=C2=A0 =C2=A0 local changed= =3D false
=C2=A0 =C2=A0 for _, item in ipairs(list.content) do
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 local term =3D item[1]
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 local defs =3D item[2]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (#term > 0 = and term[1].tag =3D=3D 'Span' and
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 #term[1].attr.identifier > 0) then
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 local term_id =3D term[1].attr.identifier
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for i, def in ipairs(defs) do
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if #def > 0 then
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local de= f_id =3D string.format('%s-def%s', term_id, i)
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 def[1].content:insert(=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 1, pandoc.Span({}, pandoc.Attr(def_id)))
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 changed =3D true
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
=C2=A0 =C2=A0 =C2=A0 =C2=A0 end
= =C2=A0 =C2=A0 end
=C2=A0 =C2=A0 if changed then
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 return list
=C2=A0 =C2=A0 end
end


On Sun, 12 N= ov 2023 at 10:27, A A <ami= ne.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hey William,

I&#= 39;d be interested in getting a hold of that filter you mentioned, I can se= e how it would greatly reduce the amount of bookkeeping required here.

I did check in=C2=A0https://github.com/pandoc/lua-filters= as well as the link you provided but couldn't find it. I could also te= chnically make my own filter or post-process the resulting document using J= S but if you have that filter on hand that would be very helpful.

Regards,

Amine

On Sun, 12 Nov= 2023 at 11:13, A A <amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Nevermind sorry. Pl= ease disregard my last reply. The anchor link works fine.

On Sun, 12 Nov 202= 3 at 11:05, A A <amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
=

Ok, thanks for that, but when I try = to convert something like the following:

[US=
A]{#usa}
: United States of America

The resulting HTML looks lik= e this:

<=
;dt><span id=3D"usa">USA</span></dt>
<dd>
United States of America
</dd>

The hash symbol gets dropped= which basically makes that span useless as the target of an anchor link. I= think I=E2=80=99m probably still doing something wrong but I=E2=80=99m not= sure what.

On Sat, 11 Nov 2023 at 23:57, Bastien DUM= ONT b= astien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org wrote:

Same thing, but on the definition:

Term 1

: Definition 1

: [Definition 2]{#t1-def2}

Term 2

: Definition 1

Here Term 1 has [this meaning](#t1-def2).

You will not get the id on the <dd> element directly, but on a <sp= an> inside <dd>.

Le Saturday 11 November 2023 =C3=A0 10:57:48PM, A A a =C3=A9crit :
> Thanks William, this will certainly come in handy, however I was askin= g about
> linking to specific *definitions*, not *terms*, i.e. in the case where= I have
> multiple definitions for a single term, I'd like to be able to lin= k to only one
> of them from another definition or from the main body of my document..= ..
>
> On Mon, 6 Nov 2023 at 16:02, 'William Lupton' via pandoc-discu= ss <[1]
> p= andoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> wrote:
>
>=C2=A0 =C2=A0 =C2=A0You can use=C2=A0[2]bracketed spans to do this manu= ally, as in:
>
>=C2=A0 =C2=A0 =C2=A0[Term 1]{#term-1}
>=C2=A0 =C2=A0 =C2=A0...
>=C2=A0 =C2=A0 =C2=A0Reference to [Term 1](#term-1).
>
>=C2=A0 =C2=A0 =C2=A0We use an auto-identifiers.lua filter that I could = probably add to [3]
>=C2=A0 =C2=A0 =C2=A0pandoc-ext. This will=C2=A0auto-derive the identifi= ers=C2=A0from the span content.
>=C2=A0 =C2=A0 =C2=A0This allows you to write this:
>
>=C2=A0 =C2=A0 =C2=A0[Term 1]{}
>=C2=A0 =C2=A0 =C2=A0...
>=C2=A0 =C2=A0 =C2=A0Reference to [Term 1]().
>
>=C2=A0 =C2=A0 =C2=A0or this (the t: is used as a prefix):
>
>=C2=A0 =C2=A0 =C2=A0[Term 1]{#t:}
>=C2=A0 =C2=A0 =C2=A0...
>=C2=A0 =C2=A0 =C2=A0Reference to [Term 1](#t:).
>
>=C2=A0 =C2=A0 =C2=A0The latter example generates this HTML.
>
>=C2=A0 =C2=A0 =C2=A0<dt><span id=3D"t:term-1">Ter= m 1</span></dt>
>=C2=A0 =C2=A0 =C2=A0...
>=C2=A0 =C2=A0 =C2=A0<p>Reference to <a href=3D"#t:term-1&= quot;>Term 1</a>.</p>
>
>=C2=A0 =C2=A0 =C2=A0On Mon, 6 Nov 2023 at 12:14, A A <[4]amine.aboufirass@gmail= .com> wrote:
>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Pandoc will convert the following mar= kdown:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Term 1
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: Definition 1
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: Definition 2
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Term 2
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: Definition 1
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0To the following HTML:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dl>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dt>Term 1</dt>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<p>Definition 1</p>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<p>Definition 2</p>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dt>Term 2</dt>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<p>Definition 1</p>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</dl>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0How easy/straightforward is it to ass= ign identifiers to specific
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0definition items in markdown? For exa= mple such that the resulting HTML
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0looks like the following:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dl>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dt>Term 1</dt>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dd id=3D"def-1-term-1"&= gt;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<p>Definition 1</p>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<p>Definition 2</p>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dt>Term 2</dt>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<p>Definition 1</p>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</dd>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</dl>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0You received this message because you= are subscribed to the Google
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Groups "pandoc-discuss" gro= up.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0To unsubscribe from this group and st= op receiving emails from it, send
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0an email to [5]pandoc-discuss= +unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0To view this discussion on the web vi= sit [6]https://groups.google.com/d
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/msgid/pandoc-discuss/
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0CAMwawgNTwDo55QU5dZsgeXQpG9jAr1_RevLP= dshEjFgqyF%3DgLQ%40mail.gmail.com.
>
>=C2=A0 =C2=A0 =C2=A0--
>=C2=A0 =C2=A0 =C2=A0You received this message because you are subscribe= d to the Google Groups
>=C2=A0 =C2=A0 =C2=A0"pandoc-discuss" group.
>=C2=A0 =C2=A0 =C2=A0To unsubscribe from this group and stop receiving e= mails from it, send an
>=C2=A0 =C2=A0 =C2=A0email to [7]pandoc-discuss+unsubscribe@goog= legroups.com.
>=C2=A0 =C2=A0 =C2=A0To view this discussion on the web visit [8]http= s://groups.google.com/d/
>=C2=A0 =C2=A0 =C2=A0msgid/pandoc-discuss/
>=C2=A0 =C2=A0 =C2=A0CAEe_xxiyw7-04ghifFmDDv3XH0rBVL-WszRX44%3D27Q_OP%2B= XSnA%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to the Google Gro= ups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email
> to [9]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit [10]https://groups.g= oogle.com/d/msgid/
> pandoc-discuss/
> CAMwawgMn0hHWHAk7wAk0GYFrjgh%3Do5R3yhZjB5kSpcNxWhvb%3DA%40mail.gmail.com= .
>
> References:
>
> [1] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://pandoc.org/MANUAL.html#exte= nsion-bracketed_spans
> [3] https://github.com/pandoc-ext
> [4] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [5] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [6] http= s://groups.google.com/d/msgid/pandoc-discuss/CAMwawgNTwDo55QU5dZsgeXQpG9jAr= 1_RevLPdshEjFgqyF%3DgLQ%40mail.gmail.com?utm_medium=3Demail&utm_source= =3Dfooter
> [7] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [8] ht= tps://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxiyw7-04ghifFmDDv3XH0r= BVL-WszRX44%3D27Q_OP%2BXSnA%40mail.gmail.com?utm_medium=3Demail&utm_sou= rce=3Dfooter
> [9] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [10] h= ttps://groups.google.com/d/msgid/pandoc-discuss/CAMwawgMn0hHWHAk7wAk0GYFrjg= h%3Do5R3yhZjB5kSpcNxWhvb%3DA%40mail.gmail.com?utm_medium=3Demail&utm_so= urce=3Dfooter

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ZVAG4DKH= akT2qzn6%40localhost.


--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgMH_vudUviXZa= 8odQ-jyn5Snk3YYGzx4K9to2RBQ_dpOA%40mail.gmail.com.

--
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 view this discussion on the web visit https://group= s.google.com/d/msgid/pandoc-discuss/CAEe_xxjOecwEVJSiO%2BBQDVHqc1zaDxHZuuzD= STDjZEmQna4xOg%40mail.gmail.com.
--00000000000060a1850609f25147--