public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Nicolas Hillegeer <nicolashillegeer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
Cc: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: How to turn off hyphenation when writing roff/man pages? Variables nor metadata works
Date: Sat, 6 Jul 2019 00:22:59 +0200	[thread overview]
Message-ID: <CACqJ-1e6EMt2z2P_k9SkFYrDEaHathk-N0-9nCZrAhmH6uBjDQ@mail.gmail.com> (raw)
In-Reply-To: <874l41n25d.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 5873 bytes --]

On Thu, 4 Jul 2019 at 19:24, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

>
> Try
>
> --metadata hyphenate=false
>
> False should also work.  I just tested with both.
> Don't set --variable too, as this will override the
> metadata value, and variables are just strings, so you
> can't get a boolean false value.
>

That worked. Thank you!


> If this doesn't work, check that you're using the most
> recent version of pandoc.
>
> The comment about "default" in the template is
> misleading, because the man writer sets the hyphenate
> variable to true if it's not set.  I'll change this.
>
>
Thanks for fixing it.

I have but one more thought/question: what I really wanted to accomplish
was the following:

  - I have a table which I use in my SYNOPSIS, which is a little uncommon I
agree (it's due to the source markdown being used by another rendered which
doesn't support the '|' at start of line extension).
  - The table contains command-line argument.
  - Somehow they were being hyphenated, which is wrong. For example
--columns came out as --col-umns.

Is there perhaps some other way to prevent hyphenation of either:

  - A section.
  - "Words" that have been marked a certain way (like bolded or in code
blocks). I tried a number of things but nothing seemed to take effect in
that sense. I would've expected code blocks to do it (as in, they would be
verbatim).


>
>
> Nicolas Hillegeer <nicolashillegeer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Sorry for posting what appears to be a very basic question, but I've
> looked
> > for hours and couldn't find it.
> >
> > Problem: I want to generate my manpage from a markdown source, but I
> don't
> > want any hyphenation. By default, hyphenation is enabled:
> >
> > $ pandoc --print-default-template=man
> > ...
> > $if(hyphenate)$
> > .hy
> > $else$
> > .nh \" Turn off hyphenation by default.
> > $endif$
> > ...
> >
> >
> > Both in the documentation <https://pandoc.org/MANUAL.html> and in the
> original
> > commit
> > <
> https://github.com/jgm/pandoc/commit/f5e33e0dce8a4f08e23a59a8b270d3dad94601e0>
> which
> > enabled hyphenation, it is described as a "default". Which indicates it
> is
> > somehow overridable:
> >
> > Variables for man pages
> > adjusting
> >
> > adjusts text to left (l), right (r), center (c), or both (b) margins
> >
> > footer
> >
> > footer in man pages
> >
> > header
> >
> > header in man pages
> >
> > hyphenate
> >
> > if true (the default), hyphenation will be used
> >
> > section
> >
> > section number in man pages
> >
> >
> >
> > With regards to variable setting, I found the following in the docs:
> >
> > Templates contain variables, which allow for the inclusion of arbitrary
> > information at any point in the file. They may be set at the command
> line
> > using the -V/--variable option. If a variable is not set, pandoc will
> look
> > for the key in the document’s metadata – which can be set using either
> YAML
> > metadata blocks or with the -M/--metadata option.
> >
> > And:
> >
> > -V KEY[=VAL], --variable=KEY[:VAL]
> >
> > Set the template variable KEY to the value VAL when rendering the
> document
> > in standalone mode. This is generally only useful when the --template
> > option is used to specify a custom template, since pandoc automatically
> > sets the variables used in the default templates. If no VAL is
> specified,
> > the key will be given the value true.
> >
> > -M KEY[=VAL], --metadata=KEY[:VAL]
> >
> > Set the metadata field KEY to the value VAL. A value specified on the
> > command line overrides a value specified in the document using YAML
> > metadata blocks. Values will be parsed as YAML boolean or string values.
> If
> > no value is specified, the value will be treated as Boolean true. Like
> > --variable, --metadata causes template variables to be set. But unlike
> > --variable, --metadata affects the metadata of the underlying document
> > (which is accessible from filters and may be printed in some output
> > formats) and metadata values will be escaped when inserted into the
> > template.
> >
> >
> > So, I'm trying thins like:
> >
> > $ pandoc --metadata=hyphenate:False --variable=hyphenate:False -s -f
> > markdown -t man mycommand.1.md -o mycommand.1
> >
> >
> > However it seems to have no effect. I tried the other metadata routes
> too:
> >
> > % hyphenate: False
> >
> > ---
> > hyphenate: False
> > ---
> >
> >
> > (In my document.)
> >
> > Nothing works.
> >
> > What am I doing wrong?
> >
> > --
> > 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/fbaf534c-daf9-49fe-8a20-190663a88c33%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CACqJ-1e6EMt2z2P_k9SkFYrDEaHathk-N0-9nCZrAhmH6uBjDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 8451 bytes --]

  parent reply	other threads:[~2019-07-05 22:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 20:16 Nicolas Hillegeer
     [not found] ` <fbaf534c-daf9-49fe-8a20-190663a88c33-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-07-04 17:24   ` John MacFarlane
     [not found]     ` <874l41n25d.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-07-05 22:22       ` Nicolas Hillegeer [this message]
     [not found]         ` <CACqJ-1e6EMt2z2P_k9SkFYrDEaHathk-N0-9nCZrAhmH6uBjDQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-07-07 15:47           ` John MacFarlane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACqJ-1e6EMt2z2P_k9SkFYrDEaHathk-N0-9nCZrAhmH6uBjDQ@mail.gmail.com \
    --to=nicolashillegeer-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).