groff
[Top][All Lists]
Advanced

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

[groff_www] Macro for codeblocks?


From: NRK
Subject: [groff_www] Macro for codeblocks?
Date: Sun, 5 Sep 2021 07:10:12 +0600

Hi,

Recently I've thought about using groff for writing static website. One
problem I've ran into is doing codeblocks. What I'm trying to do is
this:

.HTML <pre><code>
fun() {
  echo "hello" > /dev/null 2>&1;
}
.HTML </code></pre>

However this doesn't preserve the indendation and newlines are not
properly preserved either. The output I'm trying to achieve is _exactly_
the following:

<pre><code>
fun() {
  echo &quot;hello&quot; &gt; /dev/null 2&gt;&amp;1;
}
</code></pre>

It should escape anything that needs escaping but preserve indendation
and newlines properly.

- NRK



reply via email to

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