From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31755 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Laurent Duperval Newsgroups: gmane.text.pandoc Subject: Re: Filter for inline syntax extensions Date: Mon, 14 Nov 2022 06:29:08 -0800 (PST) Message-ID: References: <87edyle8l2.fsf@zeitkraut.de> <87r0y6561e.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4356_2119562119.1668436148502" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16758"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDPOD4HJ3YBBBNVBZGNQMGQEFALG6KY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Nov 14 15:29:15 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f59.google.com ([209.85.160.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ouaSX-0004Bg-JV for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 14 Nov 2022 15:29:13 +0100 Original-Received: by mail-oa1-f59.google.com with SMTP id 586e51a60fabf-13b781f3394sf5412558fac.8 for ; Mon, 14 Nov 2022 06:29:13 -0800 (PST) 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-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=KAgL8aZndPjvAtV52zfDwXtQRviYWdLo0OFH2S6YYro=; b=K2BPmFf4bEr37MWOvxe8jGcSEaGugwXLKCgRrdZwil5Y2KJ48hAuAKSHMUKY4qBCAZ 3WkHUGWBmaPshq1OJKw/zsnkpZt/SxOfRbbXswTDP1s5UiHFPSgQk1C1U7PMbazX4e0A FuOZaZhJx82AOmxATEqDovTCkNhRKZnPiXu9vBfr8rj5Wno6uW+pchNHc7iVOwQ9R2yy rk2Hxs+/uvExAVpb+m3B9nOJYw5UrmHtSHAJI34rvzc1q/qjmeVNIUoKHljwRrT1wOL0 QDFKlwasl4+/bb7S6YBrlLwT/xqf+LGnQlN5dV069gdIMSqQhdCFhGC2A6gNMGRaWS2z Bkhg== 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-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=KAgL8aZndPjvAtV52zfDwXtQRviYWdLo0OFH2S6YYro=; b=NvguE4AQintKB/7fzCFz5WKRxmFoIbUpZWoWrREZBa01opfx42Klgz4WF2uNcQs/y5 9oFBcNiLcOOIAuIpx+xQQzoahrRyOb8cEeOHRVQROZ3pCRKHHgNO+pvubIs4BWQWrZz0 jMnxMdDCytDhg89zTL1txSJ+KKyrn05RkuTIFQ1xrGTUIxxNIlG3c1Md4L8q5cPSEPdG pDI5THqeF4Vd9wkvdNH+11vOhtGgp9ahSkcrFSENuJ0x3YrCZPrzzMwO/Bp8fiyObJ5w OWf7LOOSLZn3krRmHQOetM7rR6Dat6NwLdLg6QwlZErjQVg15o925Sw2O0rf9XfA8Bs5 3Kjg== 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-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=KAgL8aZndPjvAtV52zfDwXtQRviYWdLo0OFH2S6YYro=; b=SytcGIlZLm1iAmtZxg3FhQ740CYTBbEFHZTwO6jEHtZySRfR9WYunqRy5741BjKU22 kTVWbE7NvJ5XzbykZc3kXOXW1yqQJze42WntNsixHvnTpyvCvYVfg4VZUVYYaU8Wqj3v 64UihkVNKk30D5wiV0vYcm1O+PdW3bqR+m95VZ5VpxyHKQaAc2Ubzs5vH874azmN2NkF GVZs43J7JpuTtFhJLuL5N8JL2Qxqd+nFRz3ql3ECth3PV8YzBU1erjo3y9EGAs94uRmB 9If84Ll1Myl4BIxAydtS49e8GP9PfPbQhh0Be9wfXG5wWxLAIhQiT8pVTyemElYI/Mbh Dzhg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pkm8tbP5RryPWhsGUzPlkxLBXCUJt8MukMiVVMNXxiluWCRyORO 7NyPNsZSL5XqybS3d1mXeCw= X-Google-Smtp-Source: AA0mqf4KCsGiDuxryJ4zFriQ+IV+j9Zb79Av6p8tUr/Rvq6ZDchS+wSfAgGBvMoTg7wS6RxTl1oxxA== X-Received: by 2002:a05:6871:4507:b0:13b:612a:122c with SMTP id nj7-20020a056871450700b0013b612a122cmr7076113oab.3.1668436152427; Mon, 14 Nov 2022 06:29:12 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:55c:b0:354:d7cd:c5e5 with SMTP id i28-20020a056808055c00b00354d7cdc5e5ls3411226oig.3.-pod-prod-gmail; Mon, 14 Nov 2022 06:29:09 -0800 (PST) X-Received: by 2002:a05:6808:b0c:b0:35a:ce21:ecf0 with SMTP id s12-20020a0568080b0c00b0035ace21ecf0mr5895189oij.10.1668436149486; Mon, 14 Nov 2022 06:29:09 -0800 (PST) In-Reply-To: <87r0y6561e.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: lduperval-Re5JQEeQqe8AvxtiuMwx3w@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.io gmane.text.pandoc:31755 Archived-At: ------=_Part_4356_2119562119.1668436148502 Content-Type: multipart/alternative; boundary="----=_Part_4357_860463313.1668436148502" ------=_Part_4357_860463313.1668436148502 Content-Type: text/plain; charset="UTF-8" Hmmm... Something isn't working. This is my Input: # Testing highlights ==highlight== ==highlight== This is the text portion of the content.xml output: Testing highlights highlight highlight I will need to dig in to understand what's (not) happening. When I export with PDF it works. I use Typora which seems to have its own PDF export engine that recognizes the highlighting. I have to install a complete LaTeX package to test the PDF output from a vanilla Pandoc export. For now, though, it looks like the LUA file isn't taken into consideration. L On Monday, November 14, 2022 at 2:50:13 AM UTC-5 Albert Krewinkel wrote: > Hi Laurent, > > Laurent Duperval writes: > > > I'm using the highlight.lua approach from here (https:// > > gist.github.com/tarleb/a0646da1834318d4f71a780edaf9f870) and it works > > when exporting to PDF but not when exporting to ODT or DOCX. I'm not > > sure why. I would relly like a way to make this work reliably with > > ODT. > > This depends on the pandoc writers for each format. As noted in my > original message, support for other formats requires more work. > > The additional work to get support for ODT and docx is rather minimal > though: change lines 27-29 to > > local function markup_inlines (inlines) > local attr = {class='mark', ['custom-style']='Highlighted'} > return pandoc.Span(inlines, attr) > end > > The text can then be style via the 'Highlighted' character style. > > -- > 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/a6a7faa7-3c96-4661-a907-9ba357a41d04n%40googlegroups.com. ------=_Part_4357_860463313.1668436148502 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hmmm...

Something isn't working.
This is my Input:

# Testing highlight= s

=3D=3Dhighlight=3D=3D

=3D=3Dhighlight=3D=3D

<= /div>
This is the text portion of the content.xml output:
<office:body>
<office:text>
<text:h text:s= tyle-name=3D"Heading_20_1" text:outline-level=3D"1"><text:bookmark-st= art text:name=3D"testing-highlights" />Testing highlights<text:bookma= rk-end text:name=3D"testing-highlights" /></text:h>
<text:p = text:style-name=3D"First_20_paragraph">highlight</text:p>
<t= ext:p text:style-name=3D"Text_20_body">highlight</text:p>
<t= ext:p text:style-name=3D"Text_20_body"></text:p>
</office:te= xt>
</office:body>

I will need to dig = in to understand what's (not) happening.

When I ex= port with PDF it works. I use Typora which seems to have its own PDF export= engine that recognizes the highlighting.

I h= ave to install a complete LaTeX package to test the PDF output from a vanil= la Pandoc export. For now, though, it looks like the LUA file isn't taken i= nto consideration.

L

On Monday, Novembe= r 14, 2022 at 2:50:13 AM UTC-5 Albert Krewinkel wrote:
Hi Laurent,

Laurent Duperval <ldup...= @gmail.com> writes:

> I'm using the highlight.lua approach from here (https://
> gist.github.com/tarleb/a0646da1834318d4f= 71a780edaf9f870) and it works
> when exporting to PDF but not when exporting to ODT or DOCX. I'= ;m not
> sure why. I would relly like a way to make this work reliably with
> ODT.

This depends on the pandoc writers for each format. As noted in my
original message, support for other formats requires more work.

The additional work to get support for ODT and docx is rather minimal
though: change lines 27-29 to

local function markup_inlines (inlines)
local attr =3D {class=3D'mark', ['custom-style']= =3D'Highlighted'}
return pandoc.Span(inlines, attr)
end

The text can then be style via the 'Highlighted' character styl= e.

--=20
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 &= 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/a6a7faa7-3c96-4661-a907-9ba357a41d04n%40googlegroups.= com.
------=_Part_4357_860463313.1668436148502-- ------=_Part_4356_2119562119.1668436148502--