public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* pandoc context template forces linkstyle, linkcolor, and linkcontrastcolor off by default
@ 2021-06-08 19:49 T. Kurt Bond
       [not found] ` <CAN1EhV-hvWkLtcDMqJy8QZCvKK18TF+O3Uyf+gWtPTeubtRxWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: T. Kurt Bond @ 2021-06-08 19:49 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- 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 --]

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

end of thread, other threads:[~2021-06-09 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 19:49 pandoc context template forces linkstyle, linkcolor, and linkcontrastcolor off by default T. Kurt Bond
     [not found] ` <CAN1EhV-hvWkLtcDMqJy8QZCvKK18TF+O3Uyf+gWtPTeubtRxWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-09 22:28   ` John MacFarlane

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