From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31921 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: SmallCaps with Commonmark reader Date: Sat, 24 Dec 2022 21:51:07 +0100 Message-ID: References: <87edso7vwm.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000017d92e05f09910d2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11492"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBQ6MTWOQMGQEOZZJD5I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Dec 24 21:51:20 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f62.google.com ([209.85.161.62]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p9BUE-0002iU-6b for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 24 Dec 2022 21:51:18 +0100 Original-Received: by mail-oo1-f62.google.com with SMTP id v23-20020a056820005700b004ce347d4d15sf850910oob.18 for ; Sat, 24 Dec 2022 12:51:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671915077; cv=pass; d=google.com; s=arc-20160816; b=jrvx1aJ8AUe0HX50qP+ZFu96cvOHjra84B6jTphHAI8UyEYM4zsSzQuEqBC9tLScIB P2iWMbzXBfQfTBJQxWQo+EKUqWO4pf0vhOyXCAVNq/Q6vzqIvphWfaTkCTgIFO5YelXO S4Z6r8eMKIAmMGQBo9LjTV+rbSmgBzbF9U3PNiImIu09iHv82tPwSu6sm8jvBdb+Ikqd r83h6fy2aJY1zXJ55+TPkiUBQMS0Uo9v8LPUyek0cTbIPUJAoNNgY5kqTjuNEG13kq1H dVwpgEK1fxK2SE7kRF6TQm1qvoPus2zYM4xXwcYS2aeVrWoQOfp0TlewOURD0uJxJzNx /E8w== 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=buvZtxubgeNESC9lBMu2HYWkbu/lrpWqIxulseQCN+I=; b=Lcefn6D3BYX30aXuzh/rAMmepdtR/Ao7yvU7X5ZLw4M1VNN+sknT7G4NW12ob1ocDZ S296doocik5qUlsyZ1fmHj13/FRHYSW4q4cvN1MkRg80RDy6LQKodwHfmTEhphod4+LO Z7HoakM0hKCzdGccPMUdUluXCJTlTlZCWhXBTYfrGA3wwXR/oOAVy6CatHgLS0uAjsNE ojsOkTaf/ChTEASZ4hRGeLW2FadKDjjit0CTWohW67EwMYDhz1lWcMLaUOomrQp936dF /9SLjq68baJ9rkM7LG0WcJ+WlVRDX/za/4knhkYfdzeilGdNQqnveHfo8cluFHkyhxyt eHDA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MTxwl56k; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1129 as permitted sender) smtp.mailfrom=melroch-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=20210112; 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=buvZtxubgeNESC9lBMu2HYWkbu/lrpWqIxulseQCN+I=; b=RyIwN/xn20wMEJhrNEMQqQy+xc2C5aluRUUYjfyiktmNK3rRnsfYcgkWdGsJ71hHXy qCAJkvyQVVruegh/PLOQxcnkHLhBNGz3kBK2DHL8UhFOk9P0JoV+TK2RsIwinlWRze12 f+eiq7OF5/zX9IO9087iWyXYZ0RWOuMirsIy1HOfSI92vtkMpgWVgM22Yv1I1BKcR284 S6D4SOLmtLaIDrZf+3Ly3hXOtHUD5yi3hABypWLrne5kw0PHUhIrzRDLxIkGQ5ofALS2 QLMUC9cm8bqiLkWk+sOitYdYMbMacj/5VuGTfrngO6Q6Kf+yh88pRC8essqCb02Gm2Zn 14EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=buvZtxubgeNESC9lBMu2HYWkbu/lrpWqIxulseQCN+I=; b=FEq7p+yir7Qo0dlIDk2C+zwsNhQ9y1K2UjH70Rj7OX35Ue/9HbHvaveEPBKpKwHCnM 3ZdtQTYICH96IRD4lBL9G8rrpASwm3Y5vLDYL8xYEVS4zC178GLTTN8qtwa923T/rLIG S1b5DTsJ9Fm9YXG00aV5pQ7S4HFyROVIK4IVLfo4W6DXaBz1OAJVr1XLl6ccZ32Ebq0V Rgs1lkRLgr3pYcMnyIIh/mY2nRa7ZPVhxzT7kZqEUYrzBFD1fWyqUOBKGlhGV1bazAFv RnYrUsqyIwoZ1AGsFAVno1N6wyiRLsibqbbpgZX96t4ksGSVeoYVJvUd5KHBTsvU9P/e lSbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=buvZtxubgeNESC9lBMu2HYWkbu/lrpWqIxulseQCN+I=; b=a//0EH/3nSHp5vjK51dcUfRXgU02h1bqlxfvplEM7vpx0abbBnQtzws3Uq1Ttnaoyl 7ynWNEzRHazstrihXFNMsXPtl5IPoWPD8bEh0gs12+0sE1PVH6YpNz8Z5Bzt6ievAHMA N9jq4JslL+D/2g0zdjKxUeIc2ai7ikbqrW3w22rzXfGBZfGxJpR7hPIT26ECI8MbnSnK sKPO1tc03cBit+GP1eyrege6w0L4zcrWhy7agLge86Cx9Rz27pwZF8DYBgtU5e6ZuPW0 BfczY6xb1mL5SActTGaoiG0goVPJvYfppE5hcsN0HooxVs Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2kphlq5hNQTgkSo52TRdDAObFn+fV3j7AYpAMRfnw7BCCn0xgxWL F0WYjMhd9R4jCRtn/pVMD6U= X-Google-Smtp-Source: AMrXdXsyDj7xZaXMFXA/fN9Uq6rlrTZ+60dWsOetXDP1r+BVdUTWpZKCriNTMnO3wvZYb9UQxrrcAg== X-Received: by 2002:a9d:75ca:0:b0:670:594f:aa07 with SMTP id c10-20020a9d75ca000000b00670594faa07mr927139otl.282.1671915077058; Sat, 24 Dec 2022 12:51:17 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:503:0:b0:363:b56:297 with SMTP id 3-20020aca0503000000b003630b560297ls2130564oif.1.-pod-prod-gmail; Sat, 24 Dec 2022 12:51:14 -0800 (PST) X-Received: by 2002:aca:170c:0:b0:35e:909b:5ee5 with SMTP id j12-20020aca170c000000b0035e909b5ee5mr6419401oii.8.1671915074724; Sat, 24 Dec 2022 12:51:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671915074; cv=none; d=google.com; s=arc-20160816; b=dSKh+5vr/jIHI9EMaN7Wn3h4X5L0cP4aq9FvLRPh0R7j2yUZj/OT4GAFkx6pqX8z8O sTPKV70XQ0NaootTMR6tFcyzwxXFNL8lksJc/GEtYfAwA7OUgALQteQFsTzksOBe/ylR hwCqvH8PJde24YIc7GgHEGUcNZwNVonw4cTtgBzGnTSj9vB35trZnbYKAV4m6Nv4fO5k 7sEF/oxYNV7+tnqotpwdwpaNcidlKP26e3IyWyCMf9gtj9wG4jagNyjmuIv9D+7bDRID rVZt9L3caUm9pZDnqkitqM8w3ysXXYnSWpwDobq4EELYmpH1Crg/4XX74o5IYDVsqFOD VSOg== 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=u+mDTEq8Gg2llRqAJ2YbKMhIXqgEdq/GEWB02aOO6WI=; b=Vyzt081lSrPvkbKrmFiCYAF+3ZFL+P8zI09o8BYacF5fLpd5GFh5LxL223bg62N+D+ iDGemYDRUBGSEK+RbqF4Wml4rnczd+nTIKjIry08xRcbZQZPRvsrDOJvkU9c1GDeQDQo TP2QPuDfIAWe6WmiGuPPgK8GlnuG4b6/rnxxXnXfyu7lAHoaboeRNTsOWpECVWJLuF6F 3qx8JCP4x8OI24J1Ld4UBCn+2k3cTxHMScEYKhMreze7VnO9Z1e1qPsGUWUj20fY08Dl 3ZNQufsFO48vgFYK09HxE4mP3evIwH441jYD3xoOHo4LHmxcK3gzp41THP8MxDhZl0iC nqvg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MTxwl56k; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1129 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com. [2607:f8b0:4864:20::1129]) by gmr-mx.google.com with ESMTPS id h124-20020acab782000000b00359a21e3ffesi841057oif.2.2022.12.24.12.51.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Dec 2022 12:51:14 -0800 (PST) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1129 as permitted sender) client-ip=2607:f8b0:4864:20::1129; Original-Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-45ef306bd74so108346897b3.2 for ; Sat, 24 Dec 2022 12:51:14 -0800 (PST) X-Received: by 2002:a81:17ca:0:b0:46f:bd6:957d with SMTP id 193-20020a8117ca000000b0046f0bd6957dmr322901ywx.383.1671915074212; Sat, 24 Dec 2022 12:51:14 -0800 (PST) In-Reply-To: <87edso7vwm.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MTxwl56k; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1129 as permitted sender) smtp.mailfrom=melroch-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:31921 Archived-At: --00000000000017d92e05f09910d2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I use the same trick to allow me to use shorter classes `.sc` and `.u` for smallcaps and underline. Den l=C3=B6r 24 dec. 2022 14:51Albert Krewinkel skrev: > > Gabriel L writes: > > > Is there a way with commonmark reader to parse smallcaps as real > > SmallCaps instead of Spans ? [...] > > > > I'd like to have the same behaviour as markdown reader: > > > > ``` > >> echo '[foo]{.smallcaps}' | pandoc -f markdown -t native > > [ Para [ SmallCaps [ Str "foo" ] ] ] > > ``` > > The simplest way would be to use a short Lua filter. Save the below in a > file `smallcaps.lua` and pass that file to pandoc via the `--lua-filter` > parameter. > > ``` lua > function Span (span) > if span.classes:includes 'smallcaps' then > return pandoc.SmallCaps(span.content) > end > end > ``` > > > -- > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > > -- > 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/87edso7vwm.fsf%40zeitkra= ut.de > . > --=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/CADAJKhBBg3h61iA2VQq0Sd9pbkhH74zecrpUTGJSugOH647NbQ%40mail.g= mail.com. --00000000000017d92e05f09910d2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I use the same trick to allow me to use shorter classes `= .sc` and `.u` for smallcaps and underline.

Den l=C3=B6r 24 dec. 2022 14:51Al= bert Krewinkel <albert+p= andoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> skrev:
<= br> Gabriel L <gabriel.lewertowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Is there a way with commonmark reader to parse smallcaps as real
> SmallCaps instead of Spans ? [...]
>
> I'd like to have the same behaviour as markdown reader:
>
> ```
>> echo '[foo]{.smallcaps}' | pandoc -f markdown -t native > [ Para [ SmallCaps [ Str "foo" ] ] ]
> ```

The simplest way would be to use a short Lua filter. Save the below in a file `smallcaps.lua` and pass that file to pandoc via the `--lua-filter` parameter.

``` lua
function Span (span)
=C2=A0 if span.classes:includes 'smallcaps' then
=C2=A0 =C2=A0 return pandoc.SmallCaps(span.content)
=C2=A0 end
end
```


--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe=C2=A0 e836 388d c0b2 1f63 1124

--
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@googlegroups.= com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-disc= uss/87edso7vwm.fsf%40zeitkraut.de.

--
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://groups.= google.com/d/msgid/pandoc-discuss/CADAJKhBBg3h61iA2VQq0Sd9pbkhH74zecrpUTGJS= ugOH647NbQ%40mail.gmail.com.
--00000000000017d92e05f09910d2--