public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "T. Kurt Bond" <tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: pandoc context template forces linkstyle, linkcolor, and linkcontrastcolor off by default
Date: Tue, 8 Jun 2021 15:49:34 -0400	[thread overview]
Message-ID: <CAN1EhV-hvWkLtcDMqJy8QZCvKK18TF+O3Uyf+gWtPTeubtRxWA@mail.gmail.com> (raw)

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

I'm always surprised when I produce a PDF with pandoc via context output
and the hyperlinks are indistinguishable from normal text so I can't tell
where they are.  It turns out that the template for context output
unconditionally sets linkstyle, linkcolor, and contrastcolor to the values
of the variables $linkstyle$, $linkcolor$, and $linkcontrastcolor$ *even if
the user hasn't specified them.*  This forces those all off.

Here's the code from pandoc -D context (pandoc version 2.14.0.1):

% Enable hyperlinks
\setupinteraction
  [state=start,
$if(title)$
  title={$title$},
$endif$
$if(subtitle)$
  subtitle={$subtitle$},
$endif$
$if(author)$
  author={$for(author)$$author$$sep$; $endfor$},
$endif$
$if(keywords)$
  keyword={$for(keywords)$$keywords$$sep$; $endfor$},
$endif$
  style=$linkstyle$,
  color=$linkcolor$,
  contrastcolor=$linkcontrastcolor$]

I think the last three lines should be

$if(linkstyle)$
  style=$linkstyle$,
$endif$
$if(linkcolor)$
  color=$linkcolor$,
$endif$
$if(linkcontrastcolor)$
  contrastcolor=$linkcontrastcolor$
$endif$
  ]

instead, so the style, color, and contrast color are only set if the user
specifies those variables.  This way the document gets the default ConTeXt
style, color, and contrast color.

-- 
T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io

-- 
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/CAN1EhV-hvWkLtcDMqJy8QZCvKK18TF%2BO3Uyf%2BgWtPTeubtRxWA%40mail.gmail.com.

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

             reply	other threads:[~2021-06-08 19:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 19:49 T. Kurt Bond [this message]
     [not found] ` <CAN1EhV-hvWkLtcDMqJy8QZCvKK18TF+O3Uyf+gWtPTeubtRxWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-09 22:28   ` 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=CAN1EhV-hvWkLtcDMqJy8QZCvKK18TF+O3Uyf+gWtPTeubtRxWA@mail.gmail.com \
    --to=tkurtbond-re5jqeeqqe8avxtiumwx3w@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).