From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33310 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: A A Newsgroups: gmane.text.pandoc Subject: Re: Assigning identifiers to definition items Date: Sun, 12 Nov 2023 17:35:14 +0100 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000017abd80609f724d0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31084"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDJ77HUDRUCBBUP5YOVAMGQE6I62W7Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Nov 12 17:35:35 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pl1-f189.google.com ([209.85.214.189]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1r2DQr-0007ro-Sf for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 12 Nov 2023 17:35:34 +0100 Original-Received: by mail-pl1-f189.google.com with SMTP id d9443c01a7336-1cc2efd22ccsf41921145ad.1 for ; Sun, 12 Nov 2023 08:35:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699806932; cv=pass; d=google.com; s=arc-20160816; b=NE21qW287DJjYNrpk8FSjcp4aoHwHxUWBuKR95nxeRYjWq8X8OVnsFHG9UrCFymySh WCuAHPy9VvCGbW0Hwv5xlkTI29plr4R78vyvzOV7SKWYmsz2ut21EriTvE5mqZrGwB+5 Pa23zR2zw9UaagnULXILvCirdbUlCj/rdGBJVR7QvKj7rovqCEYwh2p//N1Z3cAkM7cB 8q/7XsytHAiSfwVX6jmFhOIwzmSOfQvwWXNMX+PjGw6s2v12kxTcwKL483JjoLjGaKQk EKdysZyvRSYtueuEH0ebFk4WtkIDLTVN1cKYji7btIdmttHBj9iba4DUVRcYmh8sgX9u u1MA== 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:sender:dkim-signature :dkim-signature; bh=98GvJeHc7DW6UFSnKQ0T3Gd7SeO7xVxIDCjuv0Fs0Vg=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=t++Bul9kzI/tmWoJCAO9x3dwvitZmphhlFTD+teqvWLh2TWNCz8McPL2JpriXVV/IY jVhn3NZjpr82yfoopkzlGVp1RRSqhhpXqWDM2spj0eF2Zbr3QOgISNWjRo+7rSd8D14K Racgl1BPGgSbuIkwAy2Rrerxf+4Rkj84APiAYCbUhFvIKExRygmmvXOF+KJb9c/GS36U gaUyX5F7mDTxNODdA0niP38pDXiPA0DVVfwBLHsdD18G1vAWsESUzi4Jb45eT7YKksYB cYon/FCv8xgj1tpGHsM+H6PRTFo1/tI6yF3Bg3KP+HBu2j1Q/iLq8ZK7EXARLjYfIDiV Ccqg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=flouyQTo; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1029 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1699806932; x=1700411732; 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:sender :from:to:cc:subject:date:message-id:reply-to; bh=98GvJeHc7DW6UFSnKQ0T3Gd7SeO7xVxIDCjuv0Fs0Vg=; b=K790xh7+Pt/K6UJXqGJ7WOFGXAwhIkXEnLnKAmgNyEz3CHOawXao4reBQ3F1VcqSrj VUNKeUGvqKBAwpFtOC5GAkykBM8LKF1XY4MdUoiKY5YfU72DQ3lBhrMV9sxblWu7RXmM 4FLbsqerjAt53kd1/nFaUeOUSg7nD2uvwWukWdBI8PutZmIG7ffGbOFj0ZptDovMj1F5 +1npHMZIkzkZdPeZHwQowmA1hD71u6d4EM5aovfW+oQhuzEAGjBla1UTVmF3UTDEBx+z aW1cXXCJ1A9yDJ3iIWzzBMW00q4dJX3aXwWVqp1ZdORju0WHSRbw DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699806932; x=1700411732; 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=98GvJeHc7DW6UFSnKQ0T3Gd7SeO7xVxIDCjuv0Fs0Vg=; b=ANgeAV8FKbghiq9WglzJz7zfjU+fpzoZY2S7O9mgkEoCK+Nw96ljPMjpCJMzp5DsWz OoNzSNPUa0sT6s6wuls+RpCSpWr0RyUzDAyZmtLaVkGpCEtsrWYD+NlWwq5kB2XNeBdL MzdBlNnA6+kqPpVbnFpib8c2VCF66CEnHn8mQnuS0UvZa8oJdNkBlDFE0j18rmiLLHih hAg1aHfJV7s56FIuTcyVphL0ymtVgBvcA252bLIg56MfMeckUk1C826hNOjjN0DYTF80 945C7fE9fg2Ts/+xEHYqusszRicYwT2FUFCTYXrKb/EHc4uBTjpo2xUmtIdoEFZ0dG X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699806932; x=1700411732; 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:sender:from:to:cc:subject:date :message-id:reply-to; bh=98GvJeHc7DW6UFSnKQ0T3Gd7SeO7xVxIDCjuv0Fs0Vg=; b=Cc6vwZlYmi88M9A8zfkrzciC8EG58EBxMJYZao5nxyHpZE+aUxsQ1RJLB+SQaa9nkO QP0tvWyqXBeiA5JLSPNMZ6HSQhN5cyPMPxEwRV8Nb1YpSH6GU3WolPp+pLfTPtmBakeO ExnFA33/rNr5nx2fukNtTWn7GqQjRQQEql0BCuCGNKlCatJblPjnLAlE6A5wfbZox75q MxFuBfSvzQciKJNGZiAMP+RjdBYMKD8XFfjjzBk6XynOWIYQywhSwhjMtrVMyRfbFB4D 7fCV6x Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YzYlMF+qBVHxZmmtxk+PlB29VsowQxV23RoFDyvnMuDITmXbzVv vHbhKBhpvyLaverezTC2myY= X-Google-Smtp-Source: AGHT+IF2lxKjekTWjAJ+MmCFQ4HAV/wiSlxhIxnWFdsnV6CPW+zV8TcTbFtDxH/Iyy5btlccGoCM4Q== X-Received: by 2002:a17:902:8302:b0:1cc:43d3:a323 with SMTP id bd2-20020a170902830200b001cc43d3a323mr4881624plb.25.1699806932275; Sun, 12 Nov 2023 08:35:32 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:903:1249:b0:1c7:5759:8752 with SMTP id u9-20020a170903124900b001c757598752ls3157057plh.2.-pod-prod-08-us; Sun, 12 Nov 2023 08:35:28 -0800 (PST) X-Received: by 2002:a17:902:c951:b0:1cc:688e:5b1e with SMTP id i17-20020a170902c95100b001cc688e5b1emr5830660pla.67.1699806927928; Sun, 12 Nov 2023 08:35:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699806927; cv=none; d=google.com; s=arc-20160816; b=zwDu1eLzWcAktfdOc+lRrVlJUocz5iV2NFssm+IzTdY8jYYs+eyDCsjxQz6zDHew5H UPaMVXRQxHzGBp2K9lJoiop0vG5MsPdU5y/WBRqWR/bTfL+ZNMAsPRFEfWvv05GSoKTk s3WXzQhbKCDkA2IHQ9Y9NF7eYO3dLraV7ZyFm5N8KpZJp0c8jZLJlTunj3G6onYNKG4I cc4Exb1SuDCBVbxaAfLohQD1tDO4i5wt10OIdqw/CFesf4NBfiTw3QmRZVzOiAQ+9/rb ThCeuZHZpDpI3BtxVieGrNRNq0CdT3oBFg50PoaMVf8ZpOVskUM2IVPXG9Fi/01/T/pf VeZg== 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=uRe1zISs9Z/nr27jG407/xRK/p7hn2RbUXd1etBbBwI=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=BX+1KMd2wYWZktjw/drZyw00RUM+8b5rZOBCU02uggv8SS0/pXvhIDqTReSVD6ay3l +PecxbA2uf3bHfpeOPSP47I5iS3zSWnm6yvpmTHMlCsSoc8Hbn1e/Lvj3PPD0aTJbetx x20+ag+eSSb1HaVwED0DuoAtONlkqki1NkyKzs/2sbYo+md5QxWLgPwl+Mb+R6STHB8U ODr0ehcZtETv2CQKACttFpIhCTjtrRphkX3d0roIIc7msKqVtGbuDES8K3Ik5vXfP1sp NWPboOnDt0pKn+3FJNFXgZ6cKr550kB16V653b/eK+EJpuDxfwdqPOQScid5Ef7fCakc XMRw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=flouyQTo; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1029 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com. [2607:f8b0:4864:20::1029]) by gmr-mx.google.com with ESMTPS id s10-20020a170902ea0a00b001ca2e935df2si153058plg.10.2023.11.12.08.35.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Nov 2023 08:35:27 -0800 (PST) Received-SPF: pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1029 as permitted sender) client-ip=2607:f8b0:4864:20::1029; Original-Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2806cbd43b8so3207803a91.3 for ; Sun, 12 Nov 2023 08:35:27 -0800 (PST) X-Received: by 2002:a17:90b:1d0c:b0:27d:4ede:75b0 with SMTP id on12-20020a17090b1d0c00b0027d4ede75b0mr4836283pjb.16.1699806927365; Sun, 12 Nov 2023 08:35:27 -0800 (PST) In-Reply-To: X-Original-Sender: amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=flouyQTo; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1029 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:33310 Archived-At: --00000000000017abd80609f724d0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks a lot, will be playing around with it. On Sun, 12 Nov 2023 at 11:50, 'William Lupton' via pandoc-discuss < pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> wrote: > 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 t= o > auto-add identifiers to definitions if their terms have identifiers. Usin= g > 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 t= hat >> 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 a= s >>>> 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 >>>>> from 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/CAMwawgNTwDo55QU5dZs= geXQpG9jAr1_RevLPdshEjFgqyF%3DgLQ%40mail.gmail.com?utm_medium=3Demail&utm_s= ource=3Dfooter >>>>> > [7] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> > [8] >>>>> https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxiyw7-04ghifFm= DDv3XH0rBVL-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/CAMwawgMn0hHWHAk7wAk= 0GYFrjgh%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, sen= d >>>>> 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%40l= ocalhost >>>>> . >>>> >>>> >>>>> -- >> You received this message because you are subscribed to the Google Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n >> 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 >> >> . >> > -- > 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/CAEe_xxjOecwEVJSiO%2BBQD= VHqc1zaDxHZuuzDSTDjZEmQna4xOg%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/CAMwawgNn46NLk5%3DFcWsL7gSVPkrmb7y6s0qBAVzWQ0dWPu09kA%40mail= .gmail.com. --00000000000017abd80609f724d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks a lot, will be playing around with it.

On Sun, 12 No= v 2023 at 11:50, 'William Lupton' via pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> wrote:
BTW, sorry for failing to read your original message pro= perly!

Right. The auto-identifiers.lua filter is not ye= t 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 thei= r terms have identifiers. Using this input (based on Bastien's):
<= div>
[Term 1]{#t1}

: Definiti= on 1

: Definition 2

Term 2

: Definition 1

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


gi= ves this HTML:

<dl>=
<dt><span id=3D"t1">Term 1</span></dt>= ;
<dd>
<p><span id=3D"t1-def1"></span&= gt;Definition 1</p>
</dd>
<dd>
<p><span= id=3D"t1-def2"></span>Definition 2</p>
</dd= >
<dt>Term 2</dt>
<dd>
<p>Definition 1&= lt;/p>
</dd>
</dl>
<p>Here Term 1 has <a h= ref=3D"#t1-def2">this meaning</a>.</p>

<= /div>

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


Hey William,
=
I'd be interested in getting a hold of that filter you m= entioned, I can see how it would greatly reduce the amount of bookkeeping r= equired here.

I did check in=C2=A0https://github.com/pand= oc/lua-filters as well as the link you provided but couldn't find i= t. I could also technically make my own filter or post-process the resultin= g document using JS 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:
N= evermind sorry. Please disregard my last reply. The anchor link works fine.=

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

Ok, thanks for tha= t, 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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxjOecwEVJSi= O%2BBQDVHqc1zaDxHZuuzDSTDjZEmQna4xOg%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/CAMwawgNn46NLk5%3DFcWsL7gSVPkrmb7y6s0qB= AVzWQ0dWPu09kA%40mail.gmail.com.
--00000000000017abd80609f724d0--