public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* man page indent
@ 2022-11-20 14:12 Rick Stanley
       [not found] ` <cbe22587-8440-4e39-861f-e2ccdcb4dd7an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Rick Stanley @ 2022-11-20 14:12 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 133 bytes --]

When using __Program Source__ in creating a man page, it indents 8 spaces 
not 4.  How to manage the indent level when using pandoc?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: man page indent
       [not found] ` <cbe22587-8440-4e39-861f-e2ccdcb4dd7an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-11-20 16:57   ` John MacFarlane
       [not found]     ` <EDFA0264-8B4A-4319-8477-265C3AD6ADC7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: John MacFarlane @ 2022-11-20 16:57 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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.stanley.inc-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-discuss+unsubscribe-/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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: man page indent
       [not found]     ` <EDFA0264-8B4A-4319-8477-265C3AD6ADC7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2022-11-20 17:24       ` Rick Stanley
       [not found]         ` <329d7440-178e-40c1-b4fa-2dadaea66295n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Rick Stanley @ 2022-11-20 17:24 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2061 bytes --]

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...-/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-discuss+unsubscribe-/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.

[-- Attachment #1.2: Type: text/html, Size: 3226 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: man page indent
       [not found]         ` <329d7440-178e-40c1-b4fa-2dadaea66295n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-11-20 20:36           ` John MacFarlane
       [not found]             ` <B263931A-0B66-4575-B91A-DC32A61BEE0F-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: John MacFarlane @ 2022-11-20 20:36 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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.stanley.inc-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...-/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-discuss+unsubscribe-/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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: man page indent
       [not found]             ` <B263931A-0B66-4575-B91A-DC32A61BEE0F-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2022-11-20 21:10               ` Rick Stanley
       [not found]                 ` <71b3adff-5bd5-44b7-8448-97f4d7a910ban-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2022-11-20 21:22               ` Rick Stanley
  1 sibling, 1 reply; 8+ messages in thread
From: Rick Stanley @ 2022-11-20 21:10 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3366 bytes --]

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...-/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-discuss+unsubscribe-/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.

[-- Attachment #1.2: Type: text/html, Size: 5293 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: man page indent
       [not found]             ` <B263931A-0B66-4575-B91A-DC32A61BEE0F-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2022-11-20 21:10               ` Rick Stanley
@ 2022-11-20 21:22               ` Rick Stanley
  1 sibling, 0 replies; 8+ messages in thread
From: Rick Stanley @ 2022-11-20 21:22 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3037 bytes --]

Debian testing
pandoc 2.17.1.1

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...-/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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/77ecc0cb-707f-4f48-a703-353f20523775n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 4833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: man page indent
       [not found]                 ` <71b3adff-5bd5-44b7-8448-97f4d7a910ban-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-11-21  4:57                   ` John MacFarlane
       [not found]                     ` <293E7EEC-B348-44C3-9533-1004F7F53B0E-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: John MacFarlane @ 2022-11-21  4:57 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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.stanley.inc-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...-/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-discuss+unsubscribe-/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/293E7EEC-B348-44C3-9533-1004F7F53B0E%40gmail.com.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: man page indent
       [not found]                     ` <293E7EEC-B348-44C3-9533-1004F7F53B0E-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2022-11-21 14:30                       ` Rick Stanley
  0 siblings, 0 replies; 8+ messages in thread
From: Rick Stanley @ 2022-11-21 14:30 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 5000 bytes --]

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...-/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.

[-- Attachment #1.2: Type: text/html, Size: 7964 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-21 14:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-20 14:12 man page indent Rick Stanley
     [not found] ` <cbe22587-8440-4e39-861f-e2ccdcb4dd7an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-20 16:57   ` John MacFarlane
     [not found]     ` <EDFA0264-8B4A-4319-8477-265C3AD6ADC7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-11-20 17:24       ` Rick Stanley
     [not found]         ` <329d7440-178e-40c1-b4fa-2dadaea66295n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-20 20:36           ` John MacFarlane
     [not found]             ` <B263931A-0B66-4575-B91A-DC32A61BEE0F-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-11-20 21:10               ` Rick Stanley
     [not found]                 ` <71b3adff-5bd5-44b7-8448-97f4d7a910ban-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-21  4:57                   ` John MacFarlane
     [not found]                     ` <293E7EEC-B348-44C3-9533-1004F7F53B0E-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-11-21 14:30                       ` Rick Stanley
2022-11-20 21:22               ` Rick Stanley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).