public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: "arnold...\@gmail.com"
	<arnold.maxim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: External syntax highlghter CSS
Date: Mon, 31 Aug 2020 10:12:59 -0700	[thread overview]
Message-ID: <m2imcyyc10.fsf@johnmacfarlane.net> (raw)
In-Reply-To: <5ecceacc-2a83-4783-8014-435d0c2872d9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


Pandoc's HTML writer actually keeps track of whether a page
contains highlighted code, and it only inserts the
highlighting-css into the HTML if it does.

In an epub, this means that the highlighting CSS will only
be included in chapters that actually have highlighted code.

It probably would be better in EPUB just to add the highlighting
CSS as a separate file.  If you think that would have advantages,
go ahead and submit a request on the issue tracker.

I don't think it should matter much whether you put it at the
beginning or the end, but of course it depends on what rules
you have in your CSS.

"arnold...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <arnold.maxim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> I already use --highlight-style, but unfortunately still need to do some 
> CSS tweaks to improve the EPUB -> MOBI conversion result.
>
> Still, are there any reasons why syntax highlighter CSS is embedded into 
> html markup for EPUB files? Isn't it simpler to link it instead of 
> embedding into each chapter? Does it affect how highlighting styles are 
> applied due to some non-obvious CSS precedence issues on some devices? Is 
> it safe to append it at the end of epub.css, or it is better to prepend it 
> to keep the existing order?
>
> On Sunday, August 30, 2020 at 8:21:05 AM UTC+7 John MacFarlane wrote:
>
>>
>> You can do that, of course, but if you want to customize, 
>> a more robust solution is to use --highlight-style with a 
>> JSON .theme file -- see manual under --highlight-style. 
>>
>> Unlike fiddling with CSS, this will work for every output 
>> format that supports highlighting. 
>>
>>
>> > Hey folks! 
>> > 
>> > Can someone elaborate on why syntax highlighter CSS is embedded into 
>> html 
>> > markup for EPUB files (as opposed to the default epub.css which is 
>> linked)? 
>> > 
>> > I want to customize the syntax highlighter CSS a bit (not just colors). 
>> > What are the downsides of specifying -V highlighting-css="" and 
>> appending 
>> > the customized syntax CSS to default epub.css instead? 
>>
>>
>
> -- 
> 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/5ecceacc-2a83-4783-8014-435d0c2872d9n%40googlegroups.com.


      parent reply	other threads:[~2020-08-31 17:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29 12:58 arnold...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found] ` <472847d1-1058-4f1f-a13e-b1464c6f6065n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-08-30  1:20   ` John MacFarlane
     [not found]     ` <m2o8mtx72n.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2020-08-30  4:21       ` arnold...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found]         ` <5ecceacc-2a83-4783-8014-435d0c2872d9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-08-31 17:12           ` John MacFarlane [this message]

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=m2imcyyc10.fsf@johnmacfarlane.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=arnold.maxim-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).