From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26023 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: External syntax highlghter CSS Date: Mon, 31 Aug 2020 10:12:59 -0700 Message-ID: References: <472847d1-1058-4f1f-a13e-b1464c6f6065n@googlegroups.com> <5ecceacc-2a83-4783-8014-435d0c2872d9n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32584"; mail-complaints-to="usenet@ciao.gmane.io" To: "arnold...\@gmail.com" , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBKG7WT5AKGQE7LZ63PQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Aug 31 19:13:17 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-io1-f60.google.com ([209.85.166.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kCnMq-0008N6-OT for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 31 Aug 2020 19:13:16 +0200 Original-Received: by mail-io1-f60.google.com with SMTP id f19sf4525264iol.10 for ; Mon, 31 Aug 2020 10:13:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1598893995; cv=pass; d=google.com; s=arc-20160816; b=yYW3DILWygnQ/CLmjPU7WrJNYxVY4bn/I9IRw+4FDkVk2uDG1J7KuV3BSuvuH90777 XnQD9AfcG+3s4hKtg/yRXh/yDo08LxS7c8TC21Lc73DeoDIOmHjaeFpiGJM4adUOuFdq 5pXaAgKz9GEGxqjzCG9Bi/AySl9NbQYC6o2YKua1ZFTJp+H/5D7f62fA3DIeQWpA07Q1 XK+c6zvlqq7cgQfk86mJJqEVvqUbePxM0MqckbD5sHjOOlkgb7D4ZuSt/1VuCNjytt7n bKkzshlXTTaBbpWyMqi4UnY+nHpvcVHDfpOeT3Qa3rT7iZ/P6KaybH68Fkw2dk2RPOD0 KFYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=JsQcLqK3DGOmXiczdvuE88Yk6s0FrD2AxC6wwPqtu3A=; b=KgaVDN26IQjWN7zdrtw21Nz3uqILzFc2B2FqQ6W9mVGyyLLgri8SmMBVhx8KPIa12O 3NYsJJQssJjg2YsaCgQJ8vNThPdmfzMMhHY+1oDE/cwz6JRA0dxY+NhxkstF3+R4zY58 zXejSpRzsEkH3bxbUTNPNa7wWqy+vj6dc1LCz8WjMjstOzKgN0/Jkiy6v82OijtTeCcK zuweXmz4/7ngbx19S+AakbYwMTEWeZQP7Mxhzw+y856BB624SiAYVP4iMOPGqSFkawot NgbDtL5gm4PM8qEz58j9MR4tJapNZ2bvFC3/lAsG4E4NowSLgaoIXWYR7Fi5IZaRtU2P KrAw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=WUV3krS6; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52e as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=JsQcLqK3DGOmXiczdvuE88Yk6s0FrD2AxC6wwPqtu3A=; b=Lz8LRu7cQ1uieDWP7bzSwTXtHfnBueuVZC+pvTSs+LaRkLZpIQrmCPVmuUjkkRO8Td qdbT48WcP9PowjsFR89UlUBgFkdW7O6a2Txf4qz4X6ST5EqB3UgQ/GYItSwnIPjdDTJS 3kaPHYcurBgm0UltkWy1fvlbppKNyF6+jryUIX2X9z0HKTAuWr00gNNK7gWUPR8TbXmd X+jvtCyMLrwASWPXiul2xqzWPcJQ9xn7gBhp5jC1JhjEdwBtO4JtIoDFX15geUq/AN8t gpvCGqY3X/QDsQoxdDH8rCYvWYsUNp65dGoVBu4Z6UHV+QSwYZvGArPn3YhzUdQF7bKS BYew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=JsQcLqK3DGOmXiczdvuE88Yk6s0FrD2AxC6wwPqtu3A=; b=BRYxVvwy6ta/qK4rSNC3ibXefe29wYPmb20wpfzsIBYPMGUBFYMaqrSrj3rywazBnv 7IbB1TfH0m1jCjkOeVk/sTANDAqUj+iS2npPsiv4bCYfvWywPSQBI/dE3UYjFlg/V4vl u3HruOpkaJylXB9Mlzv+zy5YplVJDYOxUfpD4NPK63qAcLh8ryswAtiLXbg2I6oBokwt ZDheN9Kg5LYzj5rmgEh1bTeo+uV5GUIzdmbG9MIiwCnEh0rZjpLloCFSR+/MyEu5opt5 t8hIMqWvlAimQywUxSRX65yDjEfmvROir8rGKzYGF/ZV9IlWq1vTizRtpjs++uGFRoMw 2IBA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532yWYKs397J1P8iPhXIe7pfXevIElfOorR21umAfq/aKr7UM8iv OpUto5uRwkmS3tfm8Ubo0c0= X-Google-Smtp-Source: ABdhPJyExrDgmCri4uHJncrI4EclERHjJFQvYD1cK4bqyn0Z6K/PVhbkxO/z/yjFhKtyTJFJytX3ow== X-Received: by 2002:a05:6e02:147:: with SMTP id j7mr2192109ilr.109.1598893995744; Mon, 31 Aug 2020 10:13:15 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a5e:9b0b:: with SMTP id j11ls1195047iok.2.gmail; Mon, 31 Aug 2020 10:13:12 -0700 (PDT) X-Received: by 2002:a6b:6d07:: with SMTP id a7mr2054685iod.82.1598893992615; Mon, 31 Aug 2020 10:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598893992; cv=none; d=google.com; s=arc-20160816; b=iI34DohLFR12viBy1c75Oe6RTdmhlKjm48iVqEZnDua+FPE8aa5j8TcsPeyapUdj6e XshcbhqptFEfOGAarMSum2BPnlyYv+jGLH+Y5NoL4F9wrRcBd/GP3Bjx34LZdSLql+f0 Rg1z8QqKRg2w8U59sAcYB0mKLiCAk/LATc4Igm969tC8jRdYRJLmw5Lex80I+IqFEerD 3Di0TdgZDBiP/FYY1/6qJDMmRYChn2coYedsmFJRpvaWgRLadANv7J59/lnhp5LrkDcw LLUNxFuxCKFZKTB8PU+9bLiOENHqQoTSiOVbrQhlQoev36I8g3pMmR7r7IhDolyJ352w Jvlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=WF8q4PilRLxJHjwdDLPA0WU2oYybZfiQfS4T1x7oiKI=; b=VTSArnGVe6ZYgOuPqCByqLSlsN89ppekiL2eQ8lKmPc1xqxek4lcoKEPfZmaQQMopn 4zl08UP5Su9WovfILQd7/so3XQnmfJSIXwfW4wu+Q4c8WAhKJRKrCJ+ejoV75kd+QtH1 x0ryipxr1ow3f4XfIcGLGM7BQdKtfl7mj9aL9YpVgOPmCKuXVeXMtUINmKEkbuO3SbJc +Qx5jmXkyEhNQx1oiaWoeC9ksxm1qUpy/nKpeRgRjEc5Fa59X1KsCuppHk4EGuYx/8yU Mnpqw814T0Otd5Wc9rQUxf3a/B19ujx/54CzpQnjbB1K6ooyxn2hiPXOSEVQ/7gRRJUM ZYHQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=WUV3krS6; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52e as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com. [2607:f8b0:4864:20::52e]) by gmr-mx.google.com with ESMTPS id e82si522377ill.2.2020.08.31.10.13.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Aug 2020 10:13:12 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52e as permitted sender) client-ip=2607:f8b0:4864:20::52e; Original-Received: by mail-pg1-x52e.google.com with SMTP id 7so934456pgm.11 for ; Mon, 31 Aug 2020 10:13:12 -0700 (PDT) X-Received: by 2002:a63:5825:: with SMTP id m37mr2016933pgb.257.1598893991821; Mon, 31 Aug 2020 10:13:11 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id y29sm7994878pfp.141.2020.08.31.10.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 10:13:10 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id AA123A2A1; Mon, 31 Aug 2020 13:12:59 -0400 (EDT) In-Reply-To: <5ecceacc-2a83-4783-8014-435d0c2872d9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=WUV3krS6; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52e as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:26023 Archived-At: 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" 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.