emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix patching of single-page manuals
Date: Sat, 2 Oct 2021 23:51:42 +0700	[thread overview]
Message-ID: <sja2n0$kem$1@ciao.gmane.io> (raw)
In-Reply-To: <rpr9m9$1563$1@ciao.gmane.io>

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

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.

[-- Attachment #2: 0001-manfull.pl-Adjust-pattern-for-current-makeinfo.patch --]
[-- Type: text/x-patch, Size: 1377 bytes --]

From 6c2e0872df94c7c970aebabafc4b809be446485a Mon Sep 17 00:00:00 2001
From: Max Nikulin <manikulin@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


[-- Attachment #3: 0002-manfull.pl-Avoid-silent-failures.patch --]
[-- Type: text/x-patch, Size: 1201 bytes --]

From 78bc4d01e1cc2aeb8264166d734add7a2d5a1810 Mon Sep 17 00:00:00 2001
From: Max Nikulin <manikulin@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	other threads:[~2021-10-02 16:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27 16:32 A glitch in CSS for lists at https://orgmode.org/org.html Maxim Nikulin
2021-10-02 16:51 ` Max Nikulin [this message]
2021-10-02 17:13   ` [PATCH] Fix patching of single-page manuals Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='sja2n0$kem$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).