From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114222 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: andrei--- via ntg-context Newsgroups: gmane.comp.tex.context Subject: Custom Table of Contents Date: Thu, 20 Jan 2022 17:45:38 +0300 Message-ID: <36EDA4FC-F41E-43A6-8379-9AE4D53FDDA6@borisov.dev> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Content-Type: multipart/mixed; boundary="===============4441882185385573101==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37433"; mail-complaints-to="usenet@ciao.gmane.io" Cc: andrei@borisov.dev To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 20 15:47:06 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAYiO-0009YD-UZ for gctc-ntg-context-518@m.gmane-mx.org; Thu, 20 Jan 2022 15:47:04 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 72101282F95; Thu, 20 Jan 2022 15:45:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Xaf5IWZti-F; Thu, 20 Jan 2022 15:45:48 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 504E5282AD8; Thu, 20 Jan 2022 15:45:48 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D5CA6282AD8 for ; Thu, 20 Jan 2022 15:45:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wZRMJdwdahlz for ; Thu, 20 Jan 2022 15:45:44 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=17.58.23.199; helo=mr85p00im-ztdg06011801.me.com; envelope-from=andrei@borisov.dev; receiver= Original-Received: from mr85p00im-ztdg06011801.me.com (mr85p00im-ztdg06011801.me.com [17.58.23.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 8ADE9282AD7 for ; Thu, 20 Jan 2022 15:45:44 +0100 (CET) Original-Received: from smtpclient.apple (unknown [8.41.37.230]) by mr85p00im-ztdg06011801.me.com (Postfix) with ESMTPSA id 229B69C143A for ; Thu, 20 Jan 2022 14:45:41 +0000 (UTC) X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.816,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2022-01-18=5F01:2022-01-14=5F01,2022-01-18=5F01,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=944 clxscore=1030 phishscore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2201200078 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:114222 Archived-At: --===============4441882185385573101== Content-Type: multipart/alternative; boundary="Apple-Mail=_07B48079-4F70-4A3A-9B54-9C6348E3EA2A" --Apple-Mail=_07B48079-4F70-4A3A-9B54-9C6348E3EA2A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi! I=E2=80=99m new to ConTeXt. I need to make a custom table of contents that looks like this: https://imgur.com/a/Ca3By6X Each row in the table corresponds to an item that has following data to = print in the table of contents: page, total number of pages which the = item spans, name of the item and a custom text metadata field which is = defined by the item. Each item will have its own regular table of = content and own structure. So we can think of this TOC as kind of a mega = table of content one level above. It needs to be fully automatic. The actual table is going to be an xtable (which I was blown away by = after using LaTeX godawful tables for years, it=E2=80=99s soo good). After digging into the documentation (again, wow, it=E2=80=99s soo = detailed and approachable after LaTeX=F0=9F=98=82), I found out that = \completecontent doesn't provide such extreme level of customization. = Therefore I need reimplement at least some parts of the default content = forming mechanism. After digging in the source a bit, I found something = relevant: = https://source.contextgarden.net/tex/context/base/mkxl/strc-lst.mklx = . What I need is some guidance on what would be the best course of action, = in particular, which API should I use and roughly how should I approach = it=F0=9F=99=8F Should I create my own counters for each item and somehow reference = those manually in the TOC? How would I save additional text metadata field and the item name to = show it in the TOC? The source code mentions a concept of list renderers. This sounds like = the correct API to plug in, but it=E2=80=99s hard for me to grasp how = exactly it works. Any help will be appreciated! Thank you in advance! Stay safe, Andrei Borisov.= --Apple-Mail=_07B48079-4F70-4A3A-9B54-9C6348E3EA2A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Hi! I=E2=80=99m new to = ConTeXt.

I need to make a = custom table of contents that looks like this:

https://imgur.com/a/Ca3By6X

Each row = in the table corresponds to an item that has following data to print in = the table of contents: page, total number of pages which the item spans, = name of the item and a custom text metadata field which is defined by = the item. Each item will have its own regular table of content and own = structure. So we can think of this TOC as kind of a mega table of = content one level above.

It needs to be fully = automatic.

The actual table is = going to be an xtable = (which I was blown away by after using LaTeX godawful tables for years, = it=E2=80=99s soo good).

After= digging into the documentation (again, wow, it=E2=80=99s soo detailed = and approachable after LaTeX=F0=9F=98=82), I found out that \completecontent doesn't provide such extreme = level of customization. Therefore I need reimplement at least some parts = of the default content forming mechanism. After digging in the source a = bit, I found something relevant: https://source.contextgarden.net/tex/context/base/mkxl/strc-l= st.mklx.


What I need is some guidance on what = would be the best course of action, in particular, which API should I = use and roughly how should I approach it=F0=9F=99=8F

Should I create my own counters for each = item and somehow reference those manually in the TOC?

How would I save additional text = metadata field and the item name to show it in the TOC?

The source code mentions a concept of = list renderers. This sounds like the correct API to plug in, but it=E2=80=99= s hard for me to grasp how exactly it works.


Any help will be appreciated! Thank you = in advance!

Stay safe,
Andrei Borisov.
= --Apple-Mail=_07B48079-4F70-4A3A-9B54-9C6348E3EA2A-- --===============4441882185385573101== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============4441882185385573101==--