From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 9FDB01FF39B for ; Wed, 22 May 2024 09:36:33 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 37C8A6ABA; Wed, 22 May 2024 09:36:50 +0200 (CEST) Mime-Version: 1.0 Date: Wed, 22 May 2024 09:36:45 +0200 Message-Id: To: "Proxmox VE development discussion" From: "Max Carrara" X-Mailer: aerc 0.17.0-72-g6a84f1331f1c References: <20240510131616.1428053-4-c.heiss@proxmox.com> In-Reply-To: <20240510131616.1428053-4-c.heiss@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.029 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: Re: [pve-devel] [PATCH docs] asciidoc: add clickable anchor link to all headings X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Fri May 10, 2024 at 3:16 PM CEST, Christoph Heiss wrote: > Works the same as in our PBS documentation and is generally common for > documentations. > > Very useful for linking specific sections of the documentation in other > places. Previously, this always had to be done by getting the correct > anchor from the HTML directly via e.g. browser devtools. > > Signed-off-by: Christoph Heiss Applied this and built the docs - works great! Pretty neat. Clicked through a bunch of pages and didn't notice anything off - seems to work for the vast majority of headings. The exceptions I noticed are the "fake headings" in the Bibliography and FAQ pages, as those are actually `div`s. That being said, IMHO those are not really important and can just be changed to actual headings if desired (haven't checked in detail though). So, IMO those aren't really relevant for this patch anyway. Just wanted to note. LGTM. Tested-by: Max Carrara > --- > This patch should also pretty much also apply to pmg-docs, although I > did not explicitly test that yet. Tried this; unfortunately it doesn't, as the file names differ. Even when piping the patch through `s/pve/pmg/g` it won't apply, unfortunately. (Maybe I missed something though, was really just a quick attempt.) > > asciidoc/pve-docs.css | 34 ++++++++++++++++++++++++++++++++++ > asciidoc/pve-html.conf | 22 +++++++++++++++++----- > 2 files changed, 51 insertions(+), 5 deletions(-) > > diff --git a/asciidoc/pve-docs.css b/asciidoc/pve-docs.css > index 19c176e..9ddf57c 100644 > --- a/asciidoc/pve-docs.css > +++ b/asciidoc/pve-docs.css > @@ -1,6 +1,7 @@ > :root { > /* pre-defined colors */ > --pdt-grey-950: hsl(0deg, 0%, 95%); > + --pdt-grey-750: hsl(0deg, 0%, 75%); > --pdt-grey-400: hsl(0deg, 0%, 40%); > --pdt-grey-250: hsl(0deg, 0%, 25%); > --pdt-grey-150: hsl(0deg, 0%, 15%); > @@ -41,6 +42,39 @@ h6 { > font-size: 1.0em; > } > > +/* Support for heading anchor links */ > +h3 { > + border-bottom: unset; > +} > + > +h3 > span { > + display: inline-block; > + border-bottom: 2px solid silver; > +} > + > +a.headerlink { > + color: var(--pdt-grey-750); > + padding: 0 4px; > + text-decoration: none; > + visibility: hidden; > +} > + > +/* add it as an pseudo-element, so that it does not show up in the ToC */ > +a.headerlink::after { > + content: '\00b6'; > + text-decoration: none; > +} > + > +h1:hover > a.headerlink, > +h2:hover > a.headerlink, > +h3:hover > a.headerlink, > +h4:hover > a.headerlink, > +h5:hover > a.headerlink, > +h6:hover > a.headerlink { > + visibility: visible; > +} > + > +/* Dark mode theme */ > @media screen and (prefers-color-scheme: dark) { > :root { > color-scheme: dark; > diff --git a/asciidoc/pve-html.conf b/asciidoc/pve-html.conf > index 6e895e6..396a5e7 100644 > --- a/asciidoc/pve-html.conf > +++ b/asciidoc/pve-html.conf > @@ -505,7 +505,10 @@ bodydata=| > > [sect1] >
> -{numbered?{sectnum} }{title} > + > +{numbered?{sectnum} }{title} > +{id? } > + >
> | >
> @@ -513,25 +516,34 @@ bodydata=| > > [sect2] >
> -{numbered?{sectnum} }{title} > + > +{numbered?{sectnum} }{title} > +{id? } > + > | >
> > [sect3] >
> -{numbered?{sectnum} }{title} > +{numbered?{sectnum} }{title} > +{id? } > + > | >
> > [sect4] >
> -{title} > +{title} > +{id? } > + > | >
> > [sect5] >
> -{title} > +{title} > +{id? } > + > | >
> > -- > 2.44.0 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel