From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32372 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Layout Hooks in a JSON => PDF Pipeline Date: Tue, 21 Mar 2023 16:26:53 +0000 Message-ID: References: <9b05df21-d6cc-4312-963b-d706b24e4f38n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6035"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBXVV46QAMGQED5N3W5I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Mar 21 17:27:15 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f190.google.com ([209.85.208.190]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1peepO-0001Ol-3p for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 21 Mar 2023 17:27:14 +0100 Original-Received: by mail-lj1-f190.google.com with SMTP id k10-20020a2eb74a000000b0029a4ab232c6sf3484549ljo.17 for ; Tue, 21 Mar 2023 09:27:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679416033; cv=pass; d=google.com; s=arc-20160816; b=KK87avlKIox2ciyft8fUzRhoR42mNMC/j/cpnEpqoZkmG9mwTeaswL/6Lu++/u6dFV jGbGWsPLqA4C8jII5Xc5sJwcFxXelDoyF20g5fcDYaNCE5sKNc0dVwgqpVjXnZ2/9RaW beLufF39xP7sUovXL0AdFuP6om5UHNBWwCWhbMsq7MD3uwfFk7gopygjtyHLXkILEmvC Yo64+aS5J36u07rO7J4QVh1Sz4/4us/oQmVbDULhxSqb0Ot6eOV5brtoSCSEU5VB9NTT dCPzfEpZyS+i8kBx5L3dj/E609S0WPJhVJW9Wg2fNVRtBSwd2oNU1bvIkcYulzepuNKv TzfA== 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=QhnVvE7kYKWkixBNcOO+8V4kfvCJZtGxdGBs/hnHeZE=; b=AL4sLz7vTcbFHJElApDJmF+8csr85gvQ6k27EWbXkQE7h39t4B+tHgZgi9AutlCRcM 8DbJfhSLde+lhTqnZr7Jprf3nFHv/MjPmGq9YWBu6V/7gLzCQz+hfSj5c5EIgjCRRvfa RIg+MG36Ri6vqM6dCCjpA4pPgIK+LHpNfxzxryj2/5umD5WFjUChLHrkoGzvuyIHPp5A e9fmGdTjvcdtvldTI4L2hNsvZosBndkuLRX6Ua9b+YfnHlKt3E+wOc2O2vScxFr2/RJo cUSwycG5vh+hBkbabLeOHE8lKI+YyVWQ8/GQQBBMNsQiFBuRFkP+vlF8DGVTO9O7xz27 YTxg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=oUwDXsw8; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1679416033; 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=QhnVvE7kYKWkixBNcOO+8V4kfvCJZtGxdGBs/hnHeZE=; b=lizlewOy6W0tljEKAJBmnQwj/6pADx8X/G9QNr2PKwJ/LBAzq7umOG8S7eqcNs5ibW IAQLNjgXuh1ShP8kVy/V+QVK9+M8fyIfcl3PhSlfpOrfXgFW2FrE0029lTKAixhsq+dg pKfN5ONECfDydnO3C2xa8fbjnB4/kjdVJ4u+ogDFPQ5Mr0fBctPh/I1in8tc/ZI9kAXb ca3Htu48PAWbWzbrN8pzuJmsp+Z/795qXfSMw4toIjROzmR60lcAibWzq9P0DkvDLGv8 F756xbvcGzPWrJqPmtkT+Euzw/1iXGF X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679416033; 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=QhnVvE7kYKWkixBNcOO+8V4kfvCJZtGxdGBs/hnHeZE=; b=ejSs66iIYRSOVs51eoiM78i5YrLg+qq1bDtOH5iAeCLzC3qQnYxg4PP4M1uj/VKQ7Y /waVeDZAyQhFJrtHvsZcAA5tJNiXHbN5FXnPkx8872hak0tLbwZQwdZXM1ZP5RKRXAt1 RDQ4DEObHzdE6APwuxx4frhAFd+d6BbmrbSH5hY0V2qBpV7/ydrMg2RwBJYTBjIGYCXC lVKKYRQXuN430ODexsBOkwIZ7vWq8NQalWRILsrLyDbcSH1iexV9vvE7bfGuVss4 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKUfTZII9vI8VqapklYd6+8AK9lTkBEwUym6J47SnffRtYExQHnF Ik5wQNHnHz+IgkhYq7tu4FE= X-Google-Smtp-Source: AK7set9OgZ6sRp7Bcy56Usgjo8NeOkyJUvE6MygkeXeE5FUxP3TZkh2ISCE9g/FrxTwsU5kcULVroQ== X-Received: by 2002:a2e:9d82:0:b0:293:39fe:b712 with SMTP id c2-20020a2e9d82000000b0029339feb712mr1075485ljj.3.1679416033607; Tue, 21 Mar 2023 09:27:13 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6512:368f:b0:4e8:6261:7dc1 with SMTP id d15-20020a056512368f00b004e862617dc1ls557303lfs.2.-pod-prod-gmail; Tue, 21 Mar 2023 09:27:08 -0700 (PDT) X-Received: by 2002:ac2:5291:0:b0:4d8:5238:ae97 with SMTP id q17-20020ac25291000000b004d85238ae97mr1089463lfm.36.1679416028915; Tue, 21 Mar 2023 09:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679416028; cv=none; d=google.com; s=arc-20160816; b=yCRUVvQx1GA5pRByADr9cYBE1+s9hPuWin1Z0T1pp9R3hlU8tNL/XWZ4DRoyxKC0z2 MxKhn2Rm3Dkx1tRRVTfvgLvmwYXCEiOdAbqHRHUP9yC9ntoWvbjkm9z9wSL5Sszkp+Jk nKYj4tSSgQO7GgJ+lXBaaxLKfQqiUf1UiD0Pm7vRD5EGBB3nymOYJXvAEFXhRljFtd53 qOVhBS7Y9tJAvAK4U+Q4xycSoIrEIfNvma4ofUav7UHSjBaNE3yqCFvFtCJ4J8L6a/QI vRW359MBSon7Te1v3dovvTY03jrXx75Xnm/fLU40iCvUFe+rj86Cu5EOr/2nGxb0hP+4 MAaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=8K4h25do5pnLRvRdTy9HUHRjLb30psfHIO8yBNpsfJk=; b=tnYPDYkdlopxIkOPmc1y/ODQ6w5vX/sY5IN/BQer/LR7iGg1yQQOpExW1YYxrsFUdT OrPYxEL8G2UHnjaGH7eLnT36NONovRakO96H1KKekf0K6xIZDL9eC7wB+4s07CU7Pe29 GKvLD14/ZbncG/99jJvfJiTK2hh2MBWqYdT0K+CIofqjtIrKKyCM0cEpr/nK9scopHaZ EAes7LUVwqlRRRvI5JFwUsU3fq6f9Ff9Jyv2DpZvAqEaMuxbjYTQEmGdIJgycDLkr7i7 nWi4K/AT9b9d3xC/81l5kF6uCRKGqqKQi6EZydcBdatkfqtea9UjSQ0eJqm7YMk+ryQo lpgA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=oUwDXsw8; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout02.posteo.de (mout02.posteo.de. [185.67.36.66]) by gmr-mx.google.com with ESMTPS id h6-20020a05651c158600b00295a255ee26si556330ljq.6.2023.03.21.09.27.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 09:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) client-ip=185.67.36.66; Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 24E2224072B for ; Tue, 21 Mar 2023 17:27:08 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pgxnt0JFdz6ttB for ; Tue, 21 Mar 2023 17:26:57 +0100 (CET) Content-Disposition: inline In-Reply-To: X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=oUwDXsw8; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:32372 Archived-At: If you are sure to convert this custom JSON format to LaTeX only, so yes. S= eparating the importation and the conversion tasks as I suggested would eas= e adding support for different input or output file formats in the future. Le Tuesday 21 March 2023 =C3=A0 09:12:39AM, Matan Bendix Shenhav a =C3=A9cr= it : > Thanks for clarifying! Reading the docs on filters, if I understand corre= ctly > the idea is something like this: >=20 > =C2=A0=C2=A0=C2=A0 Input =3D> Reader =3D> AST =3D> Filter =3D> AST =3D> W= riter =3D> Output >=20 > But if I need to write a custom reader anyway, why would I need to encode > additional transformations in a filter? Couldn't I just encode it into th= e AST > when I read it in in the first place? >=20 > On Tuesday, March 21, 2023 at 2:31:14=E2=80=AFPM UTC+1 Bastien DUMONT wro= te: >=20 > Your custom reader can store the required information in divs, spans = or > attributes (for the elements that support it). Then, when writing to = LaTeX, > you can use a custom filter to convert this information to LaTeX code= . >=20 > A word of caution: in your figure, the LaTeX engine comes after Pando= c > (Pandoc outputs a TeX file taking account of the custom template; the= n this > TeX file is processed by the LaTeX engine). >=20 > Le Tuesday 21 March 2023 =C3=A0 05:31:48AM, Matan Bendix Shenhav a = =C3=A9crit : > > I'm looking to implement a web app which allows users to write arti= cles > which > > automatically get typeset into newspapers. I will be consuming JSON= data > and > > want to output PDFs, and want to understand how to provide limited > control of > > element positioning (especially of images) through some sort of lay= out > hooks. > > > > Articles will be written in a simple linear rich-text format, but s= ome > limited > > settings would allow users to control elements of positioning, in > particular > > whether images would appear inline inside a column or blown up to f= ull > page > > width. > > > > Editing is highly contained to keep things simple. Users select a > collection of > > articles and pick their preferred order, and the application can de= cide > the > > details of how to position them. The output is a section of the > newspaper, N > > pages long, as a PDF. > > > > The web editor will output the content in some sort of JSON format > (probably > > extending [1]this API), but if necessary I can easily convert this = into > HTML > > (and indeed, I will have to anyway for the use to view the content = in the > > editor). > > > > If I understand correctly, the Pandoc pipeline should be something = like > this: > > > > Screenshot from 2023-03-21 13-25-28.png > > > > My main question is about provide element-level hooks to allow to i= nput > JSON to > > influence output layout. As a simple example, let's say the user ad= ds > some > > images into the markup. Some images should be inline, while others = should > be > > full page width or even full page. > > > > How do I implement such hooks in this sort of Pandoc pipeline? > > > > Thank you for your time! > > =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > > > > -- > > 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, s= end an > email > > to [2]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [3][1]https://groups.googl= e.com/ > d/msgid/ > > pandoc-discuss/9b05df21-d6cc-4312-963b-d706b24e4f38n%[2] > 40googlegroups.com. > > > > References: > > > > [1] [3]https://editorjs.io/base-concepts/#what-is-clean-data > > [2] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [3] [4]https://groups.google.com/d/msgid/pandoc-discuss/ > 9b05df21-d6cc-4312-963b-d706b24e4f38n%40googlegroups.com?utm_medium= =3Demail& > utm_source=3Dfooter >=20 >=20 >=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= 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/m= sgid/ > pandoc-discuss/f2109e96-b0b2-42da-b19a-0312a41f5952n%40googlegroups.com. >=20 > References: >=20 > [1] https://groups.google.com/d/msgid/ > [2] http://40googlegroups.com/ > [3] https://editorjs.io/base-concepts/#what-is-clean-data > [4] https://groups.google.com/d/msgid/pandoc-discuss/9b05df21-d6cc-4312-9= 63b-d706b24e4f38n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > [5] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [6] https://groups.google.com/d/msgid/pandoc-discuss/f2109e96-b0b2-42da-b= 19a-0312a41f5952n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter --=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/ZBnazYB5dmXAFMFb%40localhost.