From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23751 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Setting the document language on the HTML tag in epub3 Date: Sun, 03 Nov 2019 14:59:33 -0800 Message-ID: References: <92867006-1219-4139-9aff-1bc7345c09c5@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="37845"; mail-complaints-to="usenet@blaine.gmane.org" To: Patrick Kenny , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBYVX7XWQKGQEXNJCIYY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Nov 03 23:59:49 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-il1-f190.google.com ([209.85.166.190]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iROqb-0009gy-3c for gtp-pandoc-discuss@m.gmane.org; Sun, 03 Nov 2019 23:59:49 +0100 Original-Received: by mail-il1-f190.google.com with SMTP id o11sf14251287ilc.6 for ; Sun, 03 Nov 2019 14:59:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1572821987; cv=pass; d=google.com; s=arc-20160816; b=OQviavAC5zNlqc00Fo09H5POOVkE3hHYOwOhS1xVuG0FDqEcGUWIBV+DFV4CDZ2o7q feev//9hv4ynegMf1OG/nA1dYSC/hC3tO6UatRpj1d+ZrVzR96EdAJGpVL6Ya2ccuOnM bnTY91K8LgXktUWLoQ4XBfGbaIVmgNOXTLIGWa6WIPHuYBnw503fjHMWkF0QxOd610S+ /dJBcUzRGaf2cLXmC+NUl/v143eif46x3TPuWKfIWaa3iQUotGAdeMdWTvx9cXN5epkn uwpA4jKgRrV9qptSERLMoZhQJCclX3gs/2l9O2EoAOQvFE58EPxTrCBVsEQQI9MyAyCx QcjA== 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=tfIIko2ZltpOcJg9LIJx15/soEfUUUtrZIpUtFgQKbI=; b=MvAlhwPqxqY/Z13peTWCHp7VgZKgrkNXTNcTVTm68TxGVL2Z5jywPU9jDunEDh5b2S 3FXr1OTKH1iofQflCC+nIRevB2D9KK1BbIkDzPQwFfjVdqehtAf2Yt5jT6cbdAGZpv0Z AejbClesy8E9/6SIRgWJxhiPvBqtVle+6Ki5HKrinKs8f+55PimpKAhHo5nOi5d0EawR ZI0xFdpxjGZDthWdgYTgLt6nmhlnhEAFK2nQsX+pFTwJuxTxKFxLkIB/bVeeDHogUG0T XGSHirUiAxsThW/XEsn/poXYbzryRCNk8PfvVCdPHRpe3Z6FlTntinqZVjAixERE/Yo0 Tz1Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b="t/fFK3wi"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42d 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=tfIIko2ZltpOcJg9LIJx15/soEfUUUtrZIpUtFgQKbI=; b=QI4LWLyn/n6yoajUIVt5dKfVfZH8XU7gSxushy3cM/jwFPwquf4E7wNs6Xllv0SSg9 pZNPdzLSLGX/Xqtx+L5T4JowzngpuaJV6xbUDlTE/NXZazNfnDu2DOxF0KyD6BVIf+Y+ 2PCMjqBWdNzDKHFE/xGv2SDeO5KM5PxWyB/qSKKQfFPCY1ncvXFWt3nmCYGyL3mXniNR SltZwO5H6ajJX1XqRgOL4BZSxPecokhCzg3QiaglQMqz96sX6P0iPaXzI1Wi5hyggN5H QJkSvwxDch78KZXu+BDjLRX6A4Rdj1bwU2BK3puI3ps/oxe8EJQq2A0cjmHxJEgReleg 8SeQ== 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=tfIIko2ZltpOcJg9LIJx15/soEfUUUtrZIpUtFgQKbI=; b=GlcffFbY2H3VE448A05q8eWMRbIApjOZ2hQYTWo+s+1alU19oZfYcDeTav9b+9dgzC sBXzHaJK6oXfGYfNDPdrb9P4wS74i4C30/4QDz1iSc4QxzFBORxMapxCcc/xGllnGcID DEWUObtRBYD7x6oTOdtkpKnbP/t9ptKGzLo5Sj5vXwPbZkCEAjZK9MvE9v416f8pFT2F Lc+vBdlOVbu1yOO0Jrn4W+Vwk5b39jUVf+hI30Ao2nmNIyCQX+p/TNyLy1/fiNhFAhHB Lg3/34k3+ILHwuLBHRoNTqX+6bEMV7x+pKgAtWRCvrUpASdKEYGARHiAXFVhZ5XNc+dG Xxyg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWgaflvLrblriiY9xn0OV6geHR0wW0rbIIF9xE3gUKGnl6p+vow NrbYgdo11XHgIzhBDLDoeBs= X-Google-Smtp-Source: APXvYqwT3cuu+qQn6VP0T1XffjOMRPlB1nTEczyeHT7RUqs5lHaCxMpitUszAdziAk9Ac/xm/id6Tg== X-Received: by 2002:a5e:d904:: with SMTP id n4mr20343009iop.186.1572821987391; Sun, 03 Nov 2019 14:59:47 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a02:3e87:: with SMTP id s129ls1016967jas.3.gmail; Sun, 03 Nov 2019 14:59:46 -0800 (PST) X-Received: by 2002:a05:6638:219:: with SMTP id e25mr1253477jaq.105.1572821986005; Sun, 03 Nov 2019 14:59:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572821986; cv=none; d=google.com; s=arc-20160816; b=q3VoI6PzTgMGglhD0sU9/7xKhYNyhHY3jExneOZlEMBhnlXsGCtUqWsmeX3jTN1B2P 0yMw2sqONRetpnny/duCU8llNF7VgtHAFNqQMQFv4f9nOjxKb1LaCOdlLc+w3J6eeKPP dO5dm024AtWkVpn7y02S0WytnW1A5oORVDEAx45AXwNFiZ3Qjy35iIhS99nls4YkioXV ybTC9oLXD9QAeUHLoSETnCjz5cgDknOy6htjioWgQqhUlU3yp3C+QVv6I7FlJBQ3ahfW OR4nJZs8cGysaHTDd/vvjHq1lPyGDcVsMJKlhg/Wb071A162bGb7PvdDxzl7U+7WewDG HBng== 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=m5W1BmTUtusVH65G+Cif+Rm7ZsnAij7DbyKDZOb8wdg=; b=Y9+4gjaP1wGhSdXBTJPbsobIjHzXNKQU1pfjUPIETaCX5TqdlDvwIPQJkoIUt/Pvjr prAmaTXNAqKLKqVrtPMd02B25dO4+MLBxKFANjuQHKBd/g2yaWaPeCyVtmF0T5zXjIot yfKUwTQJncKp/Az2k1EAonHuRgbssyV7H2F2gAk/giVWd6Vk3mRpcM2dBbYOrlbkteno 1naVxtshWe2KvK8mDRX/eyzhd1h/w/Vqbs90HXMRv2dsBHKLHwYwDgnCyiZhVqElFjfg zBQeDXFnEyG7/9OjEpQsvzK4ehzNaKWP8anVrcl+PWvEqpta+Lc4yOGCcjV4ld9TP8SB u/Yg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b="t/fFK3wi"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com. [2607:f8b0:4864:20::42d]) by gmr-mx.google.com with ESMTPS id z78si954246ilj.5.2019.11.03.14.59.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Nov 2019 14:59:45 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42d as permitted sender) client-ip=2607:f8b0:4864:20::42d; Original-Received: by mail-pf1-x42d.google.com with SMTP id q26so10861324pfn.11 for ; Sun, 03 Nov 2019 14:59:45 -0800 (PST) X-Received: by 2002:a63:e156:: with SMTP id h22mr26223881pgk.266.1572821985295; Sun, 03 Nov 2019 14:59:45 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id x2sm1658626pfn.167.2019.11.03.14.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2019 14:59:44 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 5E996A234; Sun, 3 Nov 2019 17:59:33 -0500 (EST) In-Reply-To: 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="t/fFK3wi"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42d 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.org gmane.text.pandoc:23751 Archived-At: I can reproduce this. Let me look into it. Patrick Kenny writes: > Ok, here's some more information. I'm running Pandoc 2.7.3 on macOS 10.14.6. > > My custom template hasn't been modified in the header area: > > > > "http://www.idpf.org/2007/ops"$if(lang)$ xml:lang="$lang$"$endif$> > > > > $pagetitle$ > > I have a file called book-variables.yaml that looks like this: > > --- > lang: ja > title: > - type: main > text: "Wow a book" > creator: > - role: author > text: "Me" > language: ja > identifier: > - scheme: DOI > text: doi:10.234234.234/33 > ibooks: > version: 1.3.4 > page-progression-direction: ltr > --- > > And I am using the command: > > /usr/local/bin/pandoc mybook_epub_apple_4pandoc /Users/me/Library/ > MobileDocuments/com~apple~CloudDocs/book-variables.yaml -o mybook.epub -- > from=markdown-smart --to=epub-smart --toc --toc-depth=3 --epub- > chapter-level=2 -M date=2019-10-31 --css epub.css --resource > -path .:/Users/me/Library/MobileDocuments/com~apple~CloudDocs/audio --epub- > cover-image=cover.jpg --template mytemplate.epub3 &> > epub_apple_pandoc_errors.txt > > With this setup, cover.xhtml and title_page.xhtml have the language set on > the HTML tag, but none of the chapter files do. (ch001.xhtml, etc.) > > > > On Thursday, October 31, 2019 at 12:14:13 AM UTC+9, BP wrote: >> >> I just tried to generate an epub (something I don't usually do) having >> set the `lang` variable to `sv` and as far as I can see every .xhtml >> file in the archive has an attribute `xml:lang="sv"`, and the default >> templates for both epub3 and epub2 have an `$if(lang)$ >> xml:lang="$lang$"$endif$` in the `html` tag. So one or both of the >> following must be the case: >> >> - Your version of pandoc is outdated. >> - You are using a custom template which lacks the `$if(lang)$ >> xml:lang="$lang$"$endif$` in the `html` tag. >> >> I suggest upgrading pandoc and/or adding the needed bit to you template. >> >> >> >> On 2019-10-30 01:39, Patrick Kenny wrote: >> > Thank you for the response. >> > >> > When I use >> > >> > lang:ja >> > >> > Then >> > >> > * cover.xhtml >> > * title_page.xhtml >> > >> > get >> > >> > xml:lang="ja" >> > >> > as expected, but none of the chapter files do. (ch001.xhtml, etc.) Is >> this >> > the expected behavior? How can I also modify the chapter files? >> > >> > >> > On Wednesday, October 30, 2019 at 1:42:15 AM UTC+9, BP Jonsson wrote: >> >> >> >> The metadata key is exactly like the placeholder in the template, no >> more, >> >> no less, i.e. `lang: ja`. This is true generally, and you can easily >> define >> >> your own variables in your own templates. That wouldn't work if Pandoc >> >> meddled with the variable names so that the names used in metadata and >> >> those used in templates were somehow different. >> >> >> >> >> >> Den tis 29 okt. 2019 15:40Patrick Kenny > > >> >> skrev: >> >> >> >>> Going from markdown to epub3, how do I set the language on the HTML >> tag >> >>> in the epub? >> >>> >> >>> For epub3, the template looks like this: >> >>> >> >>> >> >>> >> >>> In my YAML metadata block, I have this: >> >>> >> >>> language: ja >> >>> >> >>> This sets the language in content.opf: >> >>> >> >>> ja >> >>> >> >>> But it doesn't set the language on the HTML tag. >> >>> >> >>> I also tried adding >> >>> >> >>> language: ja >> >>> >> >>> to the metadata, but this didn't change the value on the HTML tag, >> either. >> >>> >> >>> -- >> >>> 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >> >>> To view this discussion on the web visit >> >>> >> https://groups.google.com/d/msgid/pandoc-discuss/c500692e-7472-40fa-991e-378b7ab173d5%40googlegroups.com >> >>> < >> https://groups.google.com/d/msgid/pandoc-discuss/c500692e-7472-40fa-991e-378b7ab173d5%40googlegroups.com?utm_medium=email&utm_source=footer> >> >> >>> . >> >>> >> >> >> > >> >> > > -- > 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/b0afa24e-6be4-47a0-af2a-d36eeee469af%40googlegroups.com.