groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Markdown to MOM Using Pandoc


From: Yves Cloutier
Subject: Re: [Groff] Markdown to MOM Using Pandoc
Date: Fri, 25 Jul 2014 11:11:45 -0400

Hello Ralph,

I'm not too familiar with troff/groff.  My only exposure is through Peter
Shaffter's MOM macros.

However the approach you are describing is-I suspect-what I am trying to
achieve with the Markdown->MOM writer script, but going a step further and
automating the addition of macros for most of the commonly used used
elements found in a document.

For example, to itendify something as a chapter header in Markdown, you
start the line with a hashtag (# Chapter 1).  For a section header, you
start with 2 hashtags (## This is a section title).  A paragraph is denoted
by a blank line between paragraphs.  a blockquote in Markdown is denoted by
a "greater-than" sign.  >This here is a blockquote

What my Markdown->MOM writer does is take the Markdown source document, and
whenever it sees a heading (# Chapter 1), it produces the following:

.HEADING 1 "Chapter1"

For level 2 header it produces:

.HEADING 2 "Section 1"

For paragraphs, it will produce:

.PP

For blockquotes, it will produce:

.BLOCKQUOTE
The blockquote text.
.BLOCKQUOTE OFF

etc...

Note that what I am generating are elements as defined by Peter's MOM
Macros - not pure troff/groff.

So in a sense, the "second pass", as you describe (and if I understood it
correctly) is automated by the Markdown->MOM writer script.

You write plain text, in Markdown, using very minimal tags, which then get
replaced by the corresponding MOM macros in the resulting document that it
produced.




On Fri, Jul 25, 2014 at 8:11 AM, Ralph Corderoy <address@hidden>
wrote:

> Hi Yves,
>
> > I have begun working on a custom writer for Pandoc to convert Markdown
> > into MOM, Peter's Groff macro set.
>
> This is a nice idea.  I see quite a few programs about that support
> various formats for backends, e.g. HTML and LaTeX, and often think
> having troff there too would raise its visibility.
>
> > Groff and MOM are extremely lightweight and comiling a document is
> > blazing fast. The only drawback is that writing in pure MOM---as with
> > writing in pure LaTeX/ConText---is that it can be distracting to have
> > to write so many tags while typing.
>
> True, though it can be useful to approach it the same way as identifying
> index entries;  as a separate pass.  Enter plain text, as if writing an
> email, using indentation, etc., to show types of content, and then go
> back and add macros and escapes, e.g. that \& after the final dot of
> `e.g.'.  What I find about the end result is it's still more readable
> that TeX because the mark-up isn't so noisy.
>
> Cheers, Ralph.
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]