From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31780 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rick Stanley Newsgroups: gmane.text.pandoc Subject: Re: man page indent Date: Mon, 21 Nov 2022 06:30:47 -0800 (PST) Message-ID: References: <329d7440-178e-40c1-b4fa-2dadaea66295n@googlegroups.com> <71b3adff-5bd5-44b7-8448-97f4d7a910ban@googlegroups.com> <293E7EEC-B348-44C3-9533-1004F7F53B0E@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2760_391301155.1669041047682" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39923"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCH5HJXPPEIJTF7OTMDBUBHTXOKDS-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Nov 21 15:30:53 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f57.google.com ([209.85.210.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ox7oz-000A6C-O3 for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 21 Nov 2022 15:30:53 +0100 Original-Received: by mail-ot1-f57.google.com with SMTP id v17-20020a9d5a11000000b0066dba7f9b2fsf5122584oth.8 for ; Mon, 21 Nov 2022 06:30:53 -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=M42bjYk7ZW976LLnLMad2gRGRjcwDb5ufJy30m8yHy0=; b=F5xFb81CZWLHbNKaOLXcFxYU5O7X2CzRw15YRko5seJ7gUiffsuNIGx6RS9M+RkZzS yv8/sjYtriKuLEUxQn9FODh5/rbvSRJLRVda8TB/WdDddho8mk8kw5UBDwMc9Y+X4Nq4 mK795/a5N0YoCQVgyhNrMHtnBfQYzOP7TqaQFjtPs7zh8Szapoi+IIS1ElNscgzge9hM AyE1ws/kulsLpt55pswrkaUbcYSbQSHa6omUV944ysl0fcoPWaMpqJjvvULfrNgrWFBj J5dS0fiGyNMXeizC7mlUEY6wUqEy7r7a37rfghklQTTJ4y0FujrbQhPHPF/hJn/NlSW+ Tr+g== 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=M42bjYk7ZW976LLnLMad2gRGRjcwDb5ufJy30m8yHy0=; b=RQUVvv1bKaVZypiZbIqniM9Va6E2TFf63j1qaV731P4WWqiUCypPa2Sf08uC30HhRp uptxm1Rkx4gKoCvll6WjQ5anE1YKzAJzDIGxA+XGug0HK7XWddkZJPuLG7Kjoy4fJVOE qolFBKyggRruGGcNe36LOXZBB+q37S/ajG4sEmlQa9HXMBslPq7XBTrEvcQfv9s0dg2+ SKENSesQ7MGHVLf93tnTy3dvpqmhEKI1UHZg4psuHkoJvsdVRA0WF+oHN28mManuduzS seRP5Ef4ll+kSQduFx4PTyvs50jj7E8OPrMnbs96jeXswTd5iPVjYyJLGYw6Ckppf+cT qFyg== 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=M42bjYk7ZW976LLnLMad2gRGRjcwDb5ufJy30m8yHy0=; b=g+ZNaR+oVuurJBQw31XVOorjXTEniXLhHYzUAd+SDjs9P7HdYuNob6IY0Fv7Q2i2LP HNMEFJs0OBAKv9N+3xrceZjbB2qXmETnteuxojzePHxANxCcLrrs6X47V20sD+a1hbXB DGloMFfTh+Ysl+094A/o4ZsFyTlBGK0MvBbFTsQVUKkJpt+Fwpl+TGX3OUXVDjy4I62m ykfloMv9R2s/C0GRzPBDzibXhLzhLFU+ncKnu0TqU1cdP8PLJWtQb3vV2anaMJK/5dek +CYFQ8OYb/U0Z6gTWi94z4+NczOjgtML2f0xvs21JBwGViZ1AzF7Nf5Mc6mJ9cXgVZcX 9Mag== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pmbVenJbl5KnxH5L5tXJDR28nd6GR8RvF4LNl6RUNOk9/elbQYu ad9aI3/Q2rDr6r7qVrNlA+I= X-Google-Smtp-Source: AA0mqf4YJkUDeXc+n6Em8WnJHldCWCBeA8B6jMYGD4CYSLnmJi0Gu/HIZnmK0a/+NqRgiDdw+1Cpkw== X-Received: by 2002:aca:ba83:0:b0:35a:1d11:dd37 with SMTP id k125-20020acaba83000000b0035a1d11dd37mr466643oif.208.1669041051430; Mon, 21 Nov 2022 06:30:51 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6871:5c1:b0:141:8ce4:295a with SMTP id v1-20020a05687105c100b001418ce4295als3699102oan.10.-pod-prod-gmail; Mon, 21 Nov 2022 06:30:48 -0800 (PST) X-Received: by 2002:a05:6871:4148:b0:136:d212:8df6 with SMTP id lb8-20020a056871414800b00136d2128df6mr13788964oab.244.1669041048700; Mon, 21 Nov 2022 06:30:48 -0800 (PST) In-Reply-To: <293E7EEC-B348-44C3-9533-1004F7F53B0E-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> X-Original-Sender: Rick.Stanley.Inc-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:31780 Archived-At: ------=_Part_2760_391301155.1669041047682 Content-Type: multipart/alternative; boundary="----=_Part_2761_1850993553.1669041047683" ------=_Part_2761_1850993553.1669041047683 Content-Type: text/plain; charset="UTF-8" Thanks! I'll have to live with it as is for now. On Sunday, November 20, 2022 at 11:57:32 PM UTC-5 fiddlosopher wrote: > Pandoc needs to do something to format code blocks differently from > ordinary paragraphs, since terminal pagers will use the same font for both. > So what it does is to put code blocks in indented paragraphs. I'm open to > reconsidering this, but we need SOME way to indicate that something is a > code block. > > Just looking around a bit: the perl man pages indent code blocks too, but > only 1 space from the main content. > > man 3 strcmp indents examples 4 spaces relative to the main content, but > the "Program Source" section is indented 0. > > man 3 gethostbyaddr also indents code examples 4 spaces. > > I'm not sure, based on my survey, whether there is in fact any standard > for this. > > > > On Nov 20, 2022, at 1:10 PM, Rick Stanley wrote: > > > > Command: pandoc sample.3.md -o sample.3 -f markdown -s -t man > > --- > > title: XXX > > section: 3 > > header: XXX > > footer: XXX 1.2.3.4 > > date: YYYY-MM-DD > > --- > > > > # NAME > > sample > > > > # SYNOPSIS > >   > > > > # DESCRIPTION > > Sample > > > > # EXAMPLES > > > > __Program Source__ > > > > > > ~~~~ > > > > #include > > #include > > > > int main(void) > > { > > > > printf("Test of markdown.\n"); > > > > return EXIT_SUCCESS; > > } > > ~~~~ > > > > > > On Sunday, November 20, 2022 at 3:36:44 PM UTC-5 fiddlosopher wrote: > > Sorry, I am not sure I follow. Please give a small example of the input > you're using (markdown?). > > > > I don't see any difference between the indentation of the man page for > pandoc and, say, emacs on my system. > > > > > On Nov 20, 2022, at 9:24 AM, Rick Stanley > wrote: > > > > > > In any Standard Library man page, that displays example code, the line > "Program Source" is indented by 4 spaces, and the source code is indented > by 8. > > > In creating my own man page, using pandoc, the "Program Source" line > is indented by 8, and my source is indented by 16 spaces. I would prefer > the same indentation for all my man pages. > > > > > > I don't have lua installed and would prefer not to use if if at all > possible. I am writing pure C. > > > > > > Thank you! > > > > > > On Sunday, November 20, 2022 at 11:57:59 AM UTC-5 fiddlosopher wrote: > > > Are you saying you want code blocks to be indented to the same level > as the man page's body text? > > > > > > You could achieve that with a lua filter that resets paragraph > indentation before each code block. Save this as unindent_code.lua: > > > > > > ``` > > > function CodeBlock(el) > > > return { pandoc.RawBlock("man", '.IP "" 0'), el } > > > end > > > ``` > > > > > > Then use --lua-filter unindent_code.lua on the command line when you > convert to man. > > > > > > > > > > > > > On Nov 20, 2022, at 6:12 AM, Rick Stanley > wrote: > > > > > > > > When using __Program Source__ in creating a man page, it indents 8 > spaces not 4. How to manage the indent level when using pandoc? > > > > > > > > -- > > > > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/cbe22587-8440-4e39-861f-e2ccdcb4dd7an%40googlegroups.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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/329d7440-178e-40c1-b4fa-2dadaea66295n%40googlegroups.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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/71b3adff-5bd5-44b7-8448-97f4d7a910ban%40googlegroups.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/b2423c5d-c87b-4d50-91c2-af83b1484b19n%40googlegroups.com. ------=_Part_2761_1850993553.1669041047683 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks!

I'll have to live with it as is for n= ow.

On Sunday, November 20, 2022 at 11:57:32 PM UTC-5 fiddlosopher wrot= e:
Pandoc nee= ds to do something to format code blocks differently from ordinary paragrap= hs, since terminal pagers will use the same font for both. So what it does= is to put code blocks in indented paragraphs. I'm open to reconsideri= ng this, but we need SOME way to indicate that something is a code block.

Just looking around a bit: the perl man pages indent code blocks too, = but only 1 space from the main content.

man 3 strcmp indents examples 4 spaces relative to the main content, bu= t the "Program Source" section is indented 0.

man 3 gethostbyaddr also indents code examples 4 spaces.

I'm not sure, based on my survey, whether there is in fact any stan= dard for this.


> On Nov 20, 2022, at 1:10 PM, Rick Stanley <rick.sta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>=20
> Command: pandoc sample.3.md -o sample.3 -f markdo= wn -s -t man
> ---
> title: XXX
> section: 3
> header: XXX
> footer: XXX 1.2.3.4
> date: YYYY-MM-DD
> ---
>=20
> # NAME
> sample
>=20
> # SYNOPSIS
> &nbsp;
>=20
> # DESCRIPTION
> Sample
>=20
> # EXAMPLES
>=20
> __Program Source__
>=20
>=20
> ~~~~
>=20
> #include <stdio.h>
> #include <stdlib.h>
>=20
> int main(void)
> {
>=20
> printf("Test of markdown.\n");
>=20
> return EXIT_SUCCESS;
> }
> ~~~~
>=20
>=20
> On Sunday, November 20, 2022 at 3:36:44 PM UTC-5 fiddlosopher wrot= e:
> Sorry, I am not sure I follow. Please give a small example of the = input you're using (markdown?).=20
>=20
> I don't see any difference between the indentation of the man = page for pandoc and, say, emacs on my system.=20
>=20
> > On Nov 20, 2022, at 9:24 AM, Rick Stanley <rick.sta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:=20
> >=20
> > In any Standard Library man page, that displays example code,= the line "Program Source" is indented by 4 spaces, and the sourc= e code is indented by 8.=20
> > In creating my own man page, using pandoc, the "Program = Source" line is indented by 8, and my source is indented by 16 spaces.= I would prefer the same indentation for all my man pages.=20
> >=20
> > I don't have lua installed and would prefer not to use if= if at all possible. I am writing pure C.=20
> >=20
> > Thank you!=20
> >=20
> > On Sunday, November 20, 2022 at 11:57:59 AM UTC-5 fiddlosophe= r wrote:=20
> > Are you saying you want code blocks to be indented to the sam= e level as the man page's body text?=20
> >=20
> > You could achieve that with a lua filter that resets paragrap= h indentation before each code block. Save this as unindent_code.lua:=20
> >=20
> > ```=20
> > function CodeBlock(el)=20
> > return { pandoc.RawBlock("man", '.IP "&quo= t; 0'), el }=20
> > end=20
> > ```=20
> >=20
> > Then use --lua-filter unindent_code.lua on the command line w= hen you convert to man.=20
> >=20
> >=20
> >=20
> > > On Nov 20, 2022, at 6:12 AM, Rick Stanley <rick.sta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:=20
> > >=20
> > > When using __Program Source__ in creating a man page, it= indents 8 spaces not 4. How to manage the indent level when using pandoc?= =20
> > >=20
> > > --=20
> > > You received this message because you are subscribed to = the Google Groups "pandoc-discuss" group.=20
> > > To unsubscribe from this group and stop receiving emails= from it, send an email to pando= c-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.=20
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/cb= e22587-8440-4e39-861f-e2ccdcb4dd7an%40googlegroups.com.=20
> >=20
> >=20
> > --=20
> > You received this message because you are subscribed to the G= oogle Groups "pandoc-discuss" group.=20
> > To unsubscribe from this group and stop receiving emails from= it, send an email to pandoc-dis= cus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.=20
> > To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/329d744= 0-178e-40c1-b4fa-2dadaea66295n%40googlegroups.com.=20
>=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 pandoc-discus..= .@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/71b3adff-5= bd5-44b7-8448-97f4d7a910ban%40googlegroups.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://groups.google.com/d= /msgid/pandoc-discuss/b2423c5d-c87b-4d50-91c2-af83b1484b19n%40googlegroups.= com.
------=_Part_2761_1850993553.1669041047683-- ------=_Part_2760_391301155.1669041047682--