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 <rick.sta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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
> &nbsp;
>
> # DESCRIPTION
> Sample
>
> # EXAMPLES
>
> __Program Source__
>
>
> ~~~~
>
> #include <stdio.h>
> #include <stdlib.h>
>
> 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 <rick.sta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <rick.sta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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...-/JYPxA39Uh5TLH3MbocFFw@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...-/JYPxA39Uh5TLH3MbocFFw@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...@googlegroups.com.
> 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-/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.