On 27/11/2020 23:32, Maxim Nikulin wrote:
Unordered lists are styled a bit incorrectly in the single-page org manual. Compare e.g. "Installation" section:

https://orgmode.org/org.html#Installation
https://orgmode.org/manual/Installation.html#Installation

For some reason whole text of single-page manual is a part of table of contents (div.contents), so bold font and suppressed marker rules are applied for regular ul elements.

It is a minor issue. Maybe someone familiar with export settings for the manual could have a look and decide either CSS should be tweaked of main part of the manual should be pulled out of the TOC block.

Currently the problem exists e.g. for "Plain Lists" section
https://orgmode.org/manual/Plain-Lists.html - OK
https://orgmode.org/org.html#Plain-Lists - bold items with no markers

Output of makeinfo changed a bit, so a pattern in a helper script postprocessing HTML files is not suitable for currently generated files. CSS styles intended to tune table of contents are applied to all unordered lists.
>From 6c2e0872df94c7c970aebabafc4b809be446485a Mon Sep 17 00:00:00 2001
From: Max Nikulin <maniku...@gmail.com>
Date: Sat, 2 Oct 2021 23:36:49 +0700
Subject: [PATCH 1/2] manfull.pl: Adjust pattern for current makeinfo

* mk/manfull.pl: During patching of single-page html manuals allow
current form of table of contents headers.

Older makeinfo did not add "contents-heading" class to "<h2>" element.
Helper script failed to properly modify HTML files generated by current
version of makeinfo.  With partially patched file, CSS stiles intended
for table of contents were applied to all unordered lists, so e.g. in
"Plain Lists" section items were bold and with missed markers.
---
 mk/manfull.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/manfull.pl b/mk/manfull.pl
index 95ffa392c..307ce396e 100755
--- a/mk/manfull.pl
+++ b/mk/manfull.pl
@@ -13,7 +13,7 @@ while (<IN>) {
   } elsif (/<div class="contents">/) {
     print OUT;
     print OUT '<p>This is the official manual for the latest <a href="https://orgmode.org";>Org mode</a> release.</p><div id="table-of-contents">';
-  } elsif (/<h2>Table of Contents<\/h2>/) {
+  } elsif (/<h2>Table of Contents<\/h2>|<h2 class="contents-heading">/) {
     print OUT;
     print OUT '<a href="https://orgmode.org";>https://orgmode.org</a><br/><div id="text-table-of-contents">';
     $toc = 1;
-- 
2.25.1

>From 78bc4d01e1cc2aeb8264166d734add7a2d5a1810 Mon Sep 17 00:00:00 2001
From: Max Nikulin <maniku...@gmail.com>
Date: Sat, 2 Oct 2021 23:41:23 +0700
Subject: [PATCH 2/2] manfull.pl: Avoid silent failures

* mk/manfull.pl: Report failures of patching of single-page HTML
manuals.

It should prevent silent generating of manual pages inconsistent with
provided CSS files when output of makeinfo will change next time.
---
 mk/manfull.pl | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/mk/manfull.pl b/mk/manfull.pl
index 307ce396e..39439bd4b 100755
--- a/mk/manfull.pl
+++ b/mk/manfull.pl
@@ -1,11 +1,14 @@
 #!/usr/bin/perl
 
+$failures = 0;
 
 while ($page = shift) {
 system "mv $page $page.orig";
 open IN,"<$page.orig" or die "Cannot read from $page.orig\n";
 open OUT,">$page" or die "Cannot write to $page\n";
 
+$toc = undef;
+
 while (<IN>) {
   if (/<meta http-equiv="Content-Style-Type" content="text\/css">/) {
     print OUT;
@@ -25,4 +28,11 @@ while (<IN>) {
   }
 }
 system "rm $page.orig";
+
+if (!defined($toc) || $toc != 0) {
+  ++$failures;
+  print STDERR "Patching of $page failed\n";
 }
+}
+
+$failures == 0 or die "Patching of $failures files failed\n";
-- 
2.25.1

Reply via email to