From ab310f940549682e824ce7cdfcfaa07e4123ddc5 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 27 Nov 2008 12:00:21 +0100 Subject: [PATCH] Website: Improve reading experience of the manual The manual now used better the org.css file. It also reacts to single key presses like "n" and "p", and has a top-level table of contents that is always active and visible. --- ChangeLog | 6 +++++ Makefile | 2 ++ UTILITIES/manfull.pl | 28 +++++++++++++++++++++ UTILITIES/mansplit.pl | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100755 UTILITIES/manfull.pl create mode 100755 UTILITIES/mansplit.pl diff --git a/ChangeLog b/ChangeLog index d5eff2045..edfe897dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-19 Carsten Dominik + + * Makefile (html_manual): Process the split html manual with the + new script. + + * UTILITIES/mansplit.pl: New file. 2009-01-06 Carsten Dominik diff --git a/Makefile b/Makefile index 138688817..3cccd153a 100644 --- a/Makefile +++ b/Makefile @@ -163,6 +163,7 @@ doc/org.pdf: doc/org.texi doc/org.html: doc/org.texi (cd doc; $(TEXI2HTML) --no-split -o org.html org.texi) + UTILITIES/manfull.pl doc/org.html doc/orgcard.dvi: doc/orgcard.tex (cd doc; tex orgcard.tex) @@ -194,6 +195,7 @@ html_manual: doc/org.texi rm -rf doc/manual mkdir doc/manual $(TEXI2HTML) -o doc/manual doc/org.texi + UTILITIES/mansplit.pl doc/manual/*.html info: doc/org diff --git a/UTILITIES/manfull.pl b/UTILITIES/manfull.pl new file mode 100755 index 000000000..60f126dfc --- /dev/null +++ b/UTILITIES/manfull.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl + + +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"; + +while () { + if (//) { + print OUT; + print OUT ''; + } elsif (/
/) { + print OUT; + print OUT '
'; + } elsif (/

Table of Contents<\/h2>/) { + print OUT; + print OUT '
'; + $toc = 1; + } elsif (/<\/div>/ and $toc) { + print OUT "

"; + $toc = 0; + } else { + print OUT; + } +} +system "rm $page.orig"; +} diff --git a/UTILITIES/mansplit.pl b/UTILITIES/mansplit.pl new file mode 100755 index 000000000..2cdfb053a --- /dev/null +++ b/UTILITIES/mansplit.pl @@ -0,0 +1,68 @@ +#!/usr/bin/perl +# Work on the files that are created by makeinfo for html output +# split into many small files. + +# This will walk though the files listed on the command line, install +# Sebastian Rose's key reader and add a small top-level-only table +# of contents that will be placed into a special region and visible +# in all subfiles. The small contents is a constant and has to be updated +# by hand, currently. + +$contents = < +

Table of Contents

+ + + +EOF + + +$script = <<'EOF'; + + + +EOF + +while ($page = shift) { +system "mv $page $page.orig"; +open IN,"<$page.orig" or die "Cannot read from $page.orig\n"; +undef $/; +$all = ; +close IN; + +$all =~ s//$&\n$script/; +$all =~ s/^/\n$contents/m; + +open OUT,">$page" or die "Cannot write to $page\n"; +print OUT $all; +close OUT; +system "rm $page.orig"; +} -- 2.11.4.GIT