Permalink
Browse files

gitolite docs on one page...!

  - 1-page.pl to produce 'gitolite.mkd' before you run 'mkdoc'
  - topbar changed to add link to the single page HTML
  - requires changes in mkdoc to add css counters on h lines

  - finally, the actual sequence and section info
  • Loading branch information...
1 parent 4998a54 commit c3ac337c69460722aaaffe86571cf6bc51bb7a24 @sitaramc committed Feb 3, 2013
Showing with 176 additions and 0 deletions.
  1. +2 −0 .topbar
  2. +174 −0 1-page.pl
View
@@ -3,6 +3,8 @@
|
<a href="index.html">main page</a>
|
+ <a href="gitolite.html">single-page</a>
+|
<a href="index.html#license">license</a>
</p>
<p style="text-align:center">
View
@@ -0,0 +1,174 @@
+#!/usr/bin/perl
+
+# a rather simple script to produce a single mkd file out of all the docs.
+#
+# the major effort is in coming up with the best sequence of MKD files for
+# reading. It's kinda subjective...
+
+# typically run as `./1-page.pl`; produces "gitolite.mkd" (hardcoded)
+
+open(STDOUT, ">", "gitolite.mkd");
+
+my $out = '';
+my $base;
+my %map;
+
+while (<DATA>) {
+ if (/^include (\S+)$/) {
+ $out .= one($1)
+ } else {
+ $out .= $_;
+ }
+}
+
+sub one {
+ my $mkd = shift;
+
+ my $base = $mkd;
+ $base =~ s(.*/)();
+ $base =~ s(.mkd$)();
+
+ my $out = '';
+
+ # for each mkd
+ for (`cat $mkd`) {
+
+ # ignore internal HRs and TOCs
+ next if /^----$/ or /^TOC$/;
+ # add anchor to h1 lines that don't already have one
+ s/^# (?!#)/# #$base /;
+ # increase the outline level all through by 1
+ s/^#/##/;
+ # prefix all anchor texts with basename and remember the mapping
+ $map{$2} = "$base-$2" if s/^(#+) #(\S+) /$1 #$base-$2 /;
+
+ $out .= $_;
+ }
+ $out .= "\n\n----\n\n";
+
+ return $out;
+}
+
+# apply the mapping to references [like][this] etc., although you have to fix
+# [this][] to look like [this][this] for convenience.
+$out =~ s/\[(.+?)\]\[\]/[$1][$1]/g;
+$out =~ s/\]\[(.+?)\]/"][" . ( $map{$1} || $1 ) . "]"/ge;
+
+print $out;
+
+# note: ips, locking, progit, sskm, plus any mkds that belong to specific
+# branches (cache, namespaces) are left out.
+
+__DATA__
+
+#title Gitolite docs in one big page
+
+This contains **all** of gitolite's documentation in one page. Useful for
+people who'd rather Ctrl-F around than click around :-)
+
+The page is loosely divided into the following sections:
+
+1. introduction, quick links, basics, and emergency help
+2. detailed install/setup and access rules
+3. git-config, gitolite options, gitweb/daemon, and the rc file
+4. wildcard repos, mirroring, and some other special features
+5. smart http mode
+6. customising gitolite with your own code
+7. all things ssh
+8. various odds and ends like how/why/who, regexes, and performance
+9. everything to do with migration from v2.
+
+Please note that this is only the latest entry point to the documentation.
+Others are:
+
+ * the main page -- see link at the top
+ * the "master table of contents" -- see link at the top
+ * the graphical overviews: [basic][] and [advanced][]
+ * a truly humungous index of all the section headings in *this* document
+ appears at the end, cleverly moved there from its traditional place to
+ avoid scaring people away!
+
+Enjoy!
+
+----
+
+# basics, quick links, and help
+
+include index.mkd
+include testing.mkd
+include qi.mkd
+include user.mkd
+include users.mkd
+include repos.mkd
+include groups.mkd
+include emergencies.mkd
+include WARNINGS.mkd
+
+# detailed installation and access rules
+
+include install.mkd
+include setup.mkd
+include clone.mkd
+include syntax.mkd
+include admin.mkd
+include rules.mkd
+include refex.mkd
+include write-types.mkd
+
+# the rc file, git-config, and options
+
+include rc.mkd
+include git-config.mkd
+include options.mkd
+include external.mkd
+
+# wild repos, mirroring, and other features
+
+include wild.mkd
+include mirroring.mkd
+include deleg.mkd
+include special.mkd
+include rare.mkd
+
+# smart http
+
+include http.mkd
+include contrib/ssh-and-http.mkd
+
+# customising gitolite
+
+include cust.mkd
+include non-core.mkd
+include dev-notes.mkd
+include vref.mkd
+include triggers.mkd
+
+# ssh
+
+include extras/ssh.mkd
+include extras/auth.mkd
+include extras/glssh.mkd
+include extras/sts.mkd
+include contrib/putty.mkd
+
+# odds and ends
+
+include how.mkd
+include why.mkd
+include who.mkd
+include g3why.mkd
+include dev-status.mkd
+include files.mkd
+include extras/regex.mkd
+include perf.mkd
+
+# migration
+
+include g2incompat.mkd
+include g2migr-example.mkd
+include g2migr.mkd
+include gsmigr.mkd
+
+----
+
+TOC

0 comments on commit c3ac337

Please sign in to comment.