From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/21847 Path: news.gmane.org!.POSTED!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Chapter TOC via filter? Date: Fri, 11 Jan 2019 11:22:13 -0800 Message-ID: References: <1bb6e5f4-04ce-4209-8223-f928f2943998@googlegroups.com> <4f0905e3-c55d-4d97-958c-8478ada10bcf@googlegroups.com> <6e119a06-0158-452e-84e3-b248a4efd4a6@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1547234422 23474 195.159.176.226 (11 Jan 2019 19:20:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2019 19:20:22 +0000 (UTC) To: Axel Rauschmayer , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBB4WZ4PQQKGQE2A6N4AY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 11 20:20:17 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-io1-f61.google.com ([209.85.166.61]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gi2Lo-0005zE-Cy for gtp-pandoc-discuss@m.gmane.org; Fri, 11 Jan 2019 20:20:16 +0100 Original-Received: by mail-io1-f61.google.com with SMTP id s25sf13852717ioc.14 for ; Fri, 11 Jan 2019 11:22:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1547234547; cv=pass; d=google.com; s=arc-20160816; b=mCiXf8+WXzkhNkE2TPoZuRkVt7tSu/Yko9zvaR12LoenaMzZom7ZfPYmMKU3lC6Uju hhI3hqRd1vumqE8JHKNpTZPUT2Oi5H7lrbJKIZGZEWbLOr6zGM6cV1KZkkMMUOKEsY1x fHT52V/F8oYq+sj4ljminT6ULOqgG+o+rEECtUciY31CSwiPGXN2ENbpvgws6oSRVhkk 3rmlFk0vy3/RJ+Ktw4IWpcwp5zwnmcQ6VvatUkKkZNRfGE8OgSD+9E3dtOiVD30/E/Ra ZkZ7Tdcn2+doPeDeae+bE0OsFqT1ixz6wnQZNqftJAzN+ji8GQzAdeLLue4mHU5y0jxe 2SPw== 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:content-transfer-encoding :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=1tvLYZP7l2d+BYnhjuzSYyqo58PMaQWY69D+Tijs4YI=; b=bb2DB8ClXDzkbCACY0GKtDnXEGaSEyeCusbUKrNUlpKep10wut+4LMNpVp3RPj/BcW WAkhb/afkoeV0GDaE1VPO0F+qsELMw3kQINlk3Ix6POaEr007AIG5HqeBy2YAo8JkcFw dJl6Fz1YBCmSUivVy0t6hoUAFCx822NQHgoBXOgRpMu6lq0SXHbQh0yW9hsWi0IzFV9F 6ABamaTlrPZoVrNxA20OAocjKItpCvan0NRu0DJ9WhtUeYtRbJwdoZgXao2r618WFBCL GHhrYPvJW5vmnTeCP0PJxewUqvbT/5BB3mgt+rtOQZZPQEWblMr/SqBPj/5HEubJVM/Z ptlQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=nLbI1Iqv; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62e 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:content-transfer-encoding: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=1tvLYZP7l2d+BYnhjuzSYyqo58PMaQWY69D+Tijs4YI=; b=s4uvwF12cuLZpeQEGXXp3pU9XSMR8aS+chD2LWMm4L5I51M2B/8gy7atdfL+4Herlf vZYq9ZlydughJbQ5CQa4m/oPOVA2vgHaMCzuI0x7VpGKfMcN+6fJgigL/lY6uqxy2D/k AYDn6yRi2iAosjAAS60tb3YfVnpsoy4AOj3OyA6vIyk+/odXS4QWDLB8emOgM1O330Zb ax4AZS5cKm8Wwvk950Dmch5tbMcRpRGRB3l49q10qzLNsFUReaQYBFYNE3B0mxAxlyD6 9HiyG2Uin5zP0D7LVx6SzEKDXkdxuIZXNSBA+DOLaPezmGfGRKrAwci871T0MKqqT6qO 5EZQ== 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:content-transfer-encoding :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=1tvLYZP7l2d+BYnhjuzSYyqo58PMaQWY69D+Tijs4YI=; b=YF2n0aOez2I/QJcUp3qKmIa2lzNtd6LsNERgMoHV9Ju1mk8BuQrj29MEqD7n+65tfe gn0Odu83/f4VD0MNqNWbsnXqK/bLEShzUoWOR2SZWDZZnGDlvioupemuvWCJHTWEnsLw mI4WI8vv6lstfgW/1FENXhlZcK/ojF9liOKfE8pS/2XGhzIoalP1+/UmW5p9fE36H3JD CeB8IBwuSFRP35wUagrXjTrTdrkupi7zPvRX4cr6tn+56+YGkuLLRL92P7LE4bXehsZ/ EVvevs/HquKX3Hs0k1lC7SC0TPnvH9tGSoEyjexDbsfSxkHt8n91viL2IJ+ovLU4eHkb Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJcUukej2ILlWJf6gBef+MCd9sBgNKbTzPGWxMogYDgoPZDvzfsxWsbq H+4xQkz870hxtmwWYmohPmE= X-Google-Smtp-Source: ALg8bN5zu+hMSRxEcuVGypX+Zl1Ytu6ZYBWGX/Oq3J+uCQS/AwGTDiS/TJUobLPRU+56br3yly2iTA== X-Received: by 2002:a24:5782:: with SMTP id u124mr3335ita.0.1547234546966; Fri, 11 Jan 2019 11:22:26 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a6b:8d91:: with SMTP id p139ls4328638iod.4.gmail; Fri, 11 Jan 2019 11:22:25 -0800 (PST) X-Received: by 2002:a5e:a61a:: with SMTP id q26mr1030323ioi.29.1547234545977; Fri, 11 Jan 2019 11:22:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547234545; cv=none; d=google.com; s=arc-20160816; b=MbxV4iELS4/7GrxPqYUJEyc2bxI3FrxKXLKrIMHupdtczqFGM+5WYoDuKAyPed2MIO k1xS+hdi3DOWv+sfqlYckUB/NI8Kk6Zzcper3betf0JPl6yYfZjIYgcED1aemkJvFlgi qWY9e/uGcd5GUoa8sxQddAJ6WSGQ+IBvweM8NXxmwkZ1atKqjYmeF7kX66JJCbd2lJa5 GiV6Ab3KKYSIIG/DouHOL9x0uDX4RZkIqXaPfeYU5lwgkhLp3BWEMZBnXm+h27pkUuk2 0/1zwXZ0wSBXginnPojUhDnAfhEXnuT6QS1v8kF/JTbn/weolYmrowWz99UThmNYf2V1 +ZWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=IHDpzQPhyqNc90g1aTQq68a9HlUWA+A0nXbDrYbwlI4=; b=wfjmZDfTLKT3mojVF+3MvdSzpQ0SDXT1PZL4moXzKCpuRj5n/kGOaAwRx/n8x9j94/ Y7gaxjyNBdn8JR67qzPE+ABwuoVqNn7Tnp2197HP/A3eNDsJwNRGVJ6CgPA7SJcsyYJ5 0JlNgwzfMR4qLXIBTUgVe6C9Ujtm+jrQEfitqlkYqzaiAARNTzaXWugQ7W7viV8d9GrP qnPNJQqGp7moqkHELMQy3DFQj76GbQdDLAkGXzjQr30z+TdhrRKkRoPB2niv7fBcsPQg 0jztXNXHtqcUD7H4feoBx0zZbueIjLz4oS5KhDwISMKbgJl2tpA4kIGST7PC83RbpHjR gjzg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=nLbI1Iqv; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62e as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com. [2607:f8b0:4864:20::62e]) by gmr-mx.google.com with ESMTPS id u19si3389944iog.4.2019.01.11.11.22.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jan 2019 11:22:25 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62e as permitted sender) client-ip=2607:f8b0:4864:20::62e; Original-Received: by mail-pl1-x62e.google.com with SMTP id 101so7168298pld.6 for ; Fri, 11 Jan 2019 11:22:25 -0800 (PST) X-Received: by 2002:a17:902:24d:: with SMTP id 71mr14533945plc.225.1547234545327; Fri, 11 Jan 2019 11:22:25 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id p77sm178653168pfi.85.2019.01.11.11.22.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 11:22:24 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 56E9AA1F8; Fri, 11 Jan 2019 14:22:13 -0500 (EST) In-Reply-To: <6e119a06-0158-452e-84e3-b248a4efd4a6-/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=nLbI1Iqv; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62e 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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:21847 Archived-At: Axel Rauschmayer writes: >> I haven't looked at this in detail, but I would have=20 >> thought you could have extracted what you needed from=20 >> the `numbering` part of a Sec, which is just=20 >> a list of integers, e.g. 2, 4, 2.=20 >> >> If your top level header is parts, then the first=20 >> number is the part, the second the chapter, the=20 >> third the section. Then it's just a matter of=20 >> converting the part to a roman numeral when the=20 >> other numbers are absent, and otherwise ignoring=20 >> the part and concatenating the other numbers=20 >> with '.' between...=20 >> > > The problem is that part numbers don=E2=80=99t affect chapter numbers: Ah, yes, I see. You could fix this by iterating over the Sec objects and incrementing the second number as necessary; then Sec would contain the numbers you need. Your way works too, of course! --=20 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 e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/yh480kzhs73spm.fsf%40johnmacfarlane.net. For more options, visit https://groups.google.com/d/optout.