From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/21842 Path: news.gmane.org!.POSTED!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Chapter TOC via filter? Date: Thu, 10 Jan 2019 21:14:51 -0800 Message-ID: References: <1bb6e5f4-04ce-4209-8223-f928f2943998@googlegroups.com> <4f0905e3-c55d-4d97-958c-8478ada10bcf@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 1547183580 17353 195.159.176.226 (11 Jan 2019 05:13:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2019 05:13:00 +0000 (UTC) To: Axel Rauschmayer , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBWOM4DQQKGQEEXF4XXY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 11 06:12:55 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-io1-f60.google.com ([209.85.166.60]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghp7n-0004QX-Q9 for gtp-pandoc-discuss@m.gmane.org; Fri, 11 Jan 2019 06:12:55 +0100 Original-Received: by mail-io1-f60.google.com with SMTP id p4sf11996614iod.17 for ; Thu, 10 Jan 2019 21:15:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1547183706; cv=pass; d=google.com; s=arc-20160816; b=JB9mEEEM+B/7qKTDTOdJ1Y6bInh8WXby7o7wKzv5l0LDcbK3sOG/9/HPn+6ZV9t98b H4TYiw5XmLnTBUh6XyBNNFg5frPcKfRMstEUI1/HxUyXCouuNooUEdUwSk2fBEcZCAN5 e53DzIj0IXB8WJnlLH8jJyNDyCpovPaiFWrDFi1iFQcm1nfebq1eEyGmGD9jM7E6ZtcH NFez890cWmRjrnkltoWLWd7z7Mt9UYVKLGXeYDAbCHLy7CS3XPMSOD8PRdQOu/vs9r6+ kibJtdGtN9B1NszAsU+sgdx9v+fyRxoAvWSL2X9KPtGQnU6mxDQIpv8e7FOp6rit0zB5 4s8w== 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=ez5aNdc1+TxYPRKbqd66lbC0rwghlvGOFPIRPMX1LqY=; b=oEb/UMRzzhYdZ2Ub0ugUna8vu8JRm0hoNUBuOIJfiFXuZS0Ssq48a/py9hc3te7asv zjwNe6LCy/6CFF1Lh108+NYlF1Ng3wYQ9+W2QOng0lkGxPIVAA6lJK4qNPVSyGLdWFuh RcIvzakGQTY8v09cnibRr7ow0513gYs5SocBxSAxKIcPtK6D2dr/9yDwlHQpew0Bx6EO fScXrmCW0rCy/CUHBj0yUa9sLAxl37y3iOGaZKM5+XrFQo8Ji9PDlukbcHLDt1040wxI h2NROf0vKZx7R3t8OWG+DceeQZOxlIc/zJifDxUNcaa3a0i/Smi+I1FVldDfMgENQQKA 4NIg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=ZG41SvvA; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::535 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=ez5aNdc1+TxYPRKbqd66lbC0rwghlvGOFPIRPMX1LqY=; b=NHuf5uUfTUYWhZ2Xa27gXuxWkaXlq6znSFCKIN2YK+zfPvHTzzjokbbyPiZo/L0qXl 1edtQQmI34KMchEfV4hkr+W+UDDlu0/IbrVK8Fv9etP4E0VfqlsziBcj4ueOWWkEercI TiSSKr98I5tRmHovuXosbke5yHXZERcmqUDRlrspPO8ygFoJ4K8ydHjRo84w1sRZIRVu nFwnfSGHyxxo2ut3/D9GToi7btcHnkQX9nblYrsodtfuDCCSyqIxoEpCwwphMpSpulmc M6B307ysLY6cj7uTDMAOH8lmfZfV7Yd6uej5Hi3MMxNZiY+P5Zb2RattFwWPZcHspExo yf7A== 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=ez5aNdc1+TxYPRKbqd66lbC0rwghlvGOFPIRPMX1LqY=; b=tiPYPAR6DXPNM6yGxh6lhUBu/9bkyG94Ee3Meg8JWfE2iguTG3x3kUPwW/KEUfHR4u Out752RyPRsPTAMhzi9oIzdfhzAbWhTov+gktWTSjiBqgvlA7Pen5coXDXdNF0gv6enm UkLFlmLeaM/gnOG/mmoMBjZI0FD0xwJAU6Bd6qxIWAUy7M3EDSCc3muR96+LXAMzj4jg +ytdxImWgvpYAH7D3/Hls4yaCQXmiLsm1OINFDC2teoaB87VBU2lvxpL+1ulogNQxPLy ST6FH0DXz2JIjgMTaYfp+2a4D879eehkS0/2KxlYQBrFeVg46bgZIYpvKvYBwIeAb2T2 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJcUukdJI5fEHbfzqe1cIq2MeEncZ6RaXm8CSQB8Qzl5ph2WONbQW65X VuK34hOvxHh8FIn3OR9DHWo= X-Google-Smtp-Source: ALg8bN7H0wGEQ/zvOB8SFES3yCGfHBsSSMMQwCNOJD+8xQ3rEkRkNrVatNl/AjNui2Ry9gkgBwXXzQ== X-Received: by 2002:a02:1804:: with SMTP id k4mr61577jad.3.1547183706531; Thu, 10 Jan 2019 21:15:06 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a02:1893:: with SMTP id 19ls912203jar.3.gmail; Thu, 10 Jan 2019 21:15:05 -0800 (PST) X-Received: by 2002:a02:5c8:: with SMTP id 69mr6932856jal.20.1547183705363; Thu, 10 Jan 2019 21:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547183705; cv=none; d=google.com; s=arc-20160816; b=ZOFPEntuUs0HSGT/giy4h1boDZGDZ5WWRW34CaLPdj7WfdZMP5IWZ0KDF/rtyYR7BF H1j/ahXBvDPs5ubNLseeZgf+jTxhIy8pIUnH+oOEC9CxLNW3te6VPP2m1HfFS3Q8VoIf b2t19cXsqXnoD+c7Tgs5q+zbOENxM4j3Jr1mBpRfDkw16NtPwQ2Av3knbL3zLlbmMQ/Y knsNc2K2AaaNwYWZ0XtJl2PC2qBJo79SK6UIOKN7cjXEBz+XnBwuXTXqxObxb4jIX3kT VQ8t32qmeu7zGnPBPJLO9DvSXimM+xe/ZL4bVJoyuA+TwlWQCuGYuMxfZZRfm+kXA5HF OG8w== 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=ACWvaOwQETZDrsvczpWYjezI3nGcR95M7m9/JabL58I=; b=rHo9e2x6c7gbjHbFf6ktKYTHHgSvmtOllz2Y54+SLN1K1rR2FXDAbUwvsOwpCZzt29 kRfwDbagD/HanzJI5CENjBdVUAHmVnmvg37yiJVpbzqr5M+h9PCAkgaDLbu44SYortLR QGpw2Jin9J5ryVuLEh8A0yOKrLZRGwRPYsMG94ScYh3vMxiZLKZ8RART8Q1C8ss8rwjx 0H8erispXOTqKWsaFbPYhJoRPrBt5zJo117gJRub2jPRXLfsEPqTpB46u7mhUBg0sg+X tUvpM0jRtbnpaWYQoHuzqyKB8A//FL40pSHX57mtEe9snmWC/01Osqa2Xvq2ej+VxMsC RT5w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=ZG41SvvA; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::535 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com. [2607:f8b0:4864:20::535]) by gmr-mx.google.com with ESMTPS id u19si3316007iog.4.2019.01.10.21.15.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 21:15:05 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::535 as permitted sender) client-ip=2607:f8b0:4864:20::535; Original-Received: by mail-pg1-x535.google.com with SMTP id w6so5822807pgl.6 for ; Thu, 10 Jan 2019 21:15:05 -0800 (PST) X-Received: by 2002:a65:500c:: with SMTP id f12mr11919100pgo.226.1547183704586; Thu, 10 Jan 2019 21:15:04 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id x3sm230226326pgt.45.2019.01.10.21.15.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 21:15:03 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 4C5A4A1F8; Fri, 11 Jan 2019 00:14:52 -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=ZG41SvvA; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::535 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:21842 Archived-At: I haven't looked at this in detail, but I would have thought you could have extracted what you needed from the `numbering` part of a Sec, which is just a list of integers, e.g. 2, 4, 2. If your top level header is parts, then the first number is the part, the second the chapter, the third the section. Then it's just a matter of converting the part to a roman numeral when the other numbers are absent, and otherwise ignoring the part and concatenating the other numbers with '.' between... Axel Rauschmayer writes: > Alas, that still doesn=E2=80=99t give me part numbers for HTML. For=20 > example: http://exploringjs.com/impatient-js/toc.html > > I=E2=80=99ve written the following filter which mostly does what I want (= minus some=20 > polish): https://gist.github.com/rauschma/7f631cacad55b8b6c920b9334f71124= 4 > > - For LaTeX, I would track section numbers and generate the chapter= =20 > TOCs the same way. But I would leave the numbering of headings to LaTe= X. > =20 > > --=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= email 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/msgi= d/pandoc-discuss/e9ec0801-2490-4119-88cd-74adbcd9afe6%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. --=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/m2o98nvkqc.fsf%40johnmacfarlane.net. For more options, visit https://groups.google.com/d/optout.