summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2008-11-27 12:00:21 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-01-19 12:45:20 +0100
commitab310f940549682e824ce7cdfcfaa07e4123ddc5 (patch)
treed4a775a8921700a6a295c4aae6cd3a51d78cd884
parent9aa72230a22414d2b7bf8314af9a18a9494e700a (diff)
downloadorg-mode-ab310f940549682e824ce7cdfcfaa07e4123ddc5.tar.gz
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.
-rw-r--r--ChangeLog6
-rw-r--r--Makefile2
-rwxr-xr-xUTILITIES/manfull.pl28
-rwxr-xr-xUTILITIES/mansplit.pl68
4 files changed, 104 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d5eff20..edfe897 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-19 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * Makefile (html_manual): Process the split html manual with the
+ new script.
+
+ * UTILITIES/mansplit.pl: New file.
2009-01-06 Carsten Dominik <carsten.dominik@gmail.com>
diff --git a/Makefile b/Makefile
index 1386888..3cccd15 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 0000000..60f126d
--- /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 (<IN>) {
+ if (/<meta http-equiv="Content-Style-Type" content="text\/css">/) {
+ print OUT;
+ print OUT '</style><link rel="stylesheet" href="http://orgmode.org/org.css" type="text/css" />';
+ } elsif (/<div class="contents">/) {
+ print OUT;
+ print OUT '<div id="table-of-contents">';
+ } elsif (/<h2>Table of Contents<\/h2>/) {
+ print OUT;
+ print OUT '<div id="text-table-of-contents">';
+ $toc = 1;
+ } elsif (/<\/div>/ and $toc) {
+ print OUT "</div></div></div>";
+ $toc = 0;
+ } else {
+ print OUT;
+ }
+}
+system "rm $page.orig";
+}
diff --git a/UTILITIES/mansplit.pl b/UTILITIES/mansplit.pl
new file mode 100755
index 0000000..2cdfb05
--- /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 = <<EOF;
+<div id="table-of-contents">
+<h2>Table of Contents</h2>
+<div id="text-table-of-contents">
+<ul>
+<li><a name="toc_Top" href="index.html#Top">Org Mode Manual</a>
+<li><a name="toc_Introduction" href="Introduction.html#Introduction">1 Introduction</a>
+<li><a name="toc_Document-Structure" href="Document-Structure.html#Document-Structure">2 Document Structure</a>
+<li><a name="toc_Tables" href="Tables.html#Tables">3 Tables</a>
+<li><a name="toc_Hyperlinks" href="Hyperlinks.html#Hyperlinks">4 Hyperlinks</a>
+<li><a name="toc_TODO-Items" href="TODO-Items.html#TODO-Items">5 TODO Items</a>
+<li><a name="toc_Tags" href="Tags.html#Tags">6 Tags</a>
+<li><a name="toc_Properties-and-Columns" href="Properties-and-Columns.html#Properties-and-Columns">7 Properties and Columns</a>
+<li><a name="toc_Dates-and-Times" href="Dates-and-Times.html#Dates-and-Times">8 Dates and Times</a>
+<li><a name="toc_Capture" href="Capture.html#Capture">9 Capture</a>
+<li><a name="toc_Agenda-Views" href="Agenda-Views.html#Agenda-Views">10 Agenda Views</a>
+<li><a name="toc_Embedded-LaTeX" href="Embedded-LaTeX.html#Embedded-LaTeX">11 Embedded LaTeX</a>
+<li><a name="toc_Exporting" href="Exporting.html#Exporting">12 Exporting</a>
+<li><a name="toc_Publishing" href="Publishing.html#Publishing">13 Publishing</a>
+<li><a name="toc_Miscellaneous" href="Miscellaneous.html#Miscellaneous">14 Miscellaneous</a>
+<li><a name="toc_Extensions" href="Extensions.html#Extensions">A Extensions</a>
+<li><a name="toc_Hacking" href="Hacking.html#Hacking">B Hacking</a>
+<li><a name="toc_History-and-Acknowledgments" href="History-and-Acknowledgments.html#History-and-Acknowledgments">C History and Acknowledgments</a>
+<li><a name="toc_Main-Index" href="Main-Index.html#Main-Index">Main Index</a>
+<li><a name="toc_Key-Index" href="Key-Index.html#Key-Index">Key Index</a>
+</li></ul>
+</div>
+</div>
+</div>
+EOF
+
+
+$script = <<'EOF';
+</style><link rel="stylesheet" href="http://orgmode.org/org.css" type="text/css" />
+<script type="text/javascript" src="http://orgmode.org/org-keys.js"></script>
+<script language="javascript" type="text/javascript">
+ <!--/*--><![CDATA[/*><!--*/
+ OrgKeyReader.registerHref('h', 'index.html');
+ OrgKeyReader.registerHref('t', 'index.html');
+ /*]]>*/-->
+</script>
+EOF
+
+while ($page = shift) {
+system "mv $page $page.orig";
+open IN,"<$page.orig" or die "Cannot read from $page.orig\n";
+undef $/;
+$all = <IN>;
+close IN;
+
+$all =~ s/<meta http-equiv="Content-Style-Type" content="text\/css">/$&\n$script/;
+$all =~ s/^<body>/<body onload="OrgKeyReader.init();">\n$contents/m;
+
+open OUT,">$page" or die "Cannot write to $page\n";
+print OUT $all;
+close OUT;
+system "rm $page.orig";
+}