From cc5a6a2baab2b2ebd50ea40a5ccbf4e11c3a6373 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 29 Jul 2007 21:40:37 +0100 Subject: [PATCH] add a perl script to convert MaintNotes to wiki format Signed-off-by: Johannes Schindelin --- .gitignore | 1 + Makefile | 3 ++ to-wiki.perl | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 Makefile create mode 100644 to-wiki.perl diff --git a/.gitignore b/.gitignore index 4d8f04330c..7c31e3f644 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /AT.log /AT.log.bak /AT.build-logs/ +/MaintNotes.wiki diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..718ca5a776 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +MaintNotes.wiki: MaintNotes Makefile to-wiki.perl + (cat $<; sed '1,/^$$/d' < ../git/Documentation/howto/maintain-git.txt) | \ + perl to-wiki.perl > $@ diff --git a/to-wiki.perl b/to-wiki.perl new file mode 100644 index 0000000000..d50449a3d0 --- /dev/null +++ b/to-wiki.perl @@ -0,0 +1,95 @@ +#!/usr/bin/perl + +$tabbed = 0; +$tab = '(\t| {8}| {5})'; + +print 'Notes: +* The newest version of this message can be found in the \'todo\' branch in git.git, as file [http://repo.or.cz/w/git.git?a=blob_plain;f=MaintNotes;hb=todo MaintNotes]. +* This Wiki page is generated irregularly using [http://repo.or.cz/w/git/dscho.git?a=blob_plain;f=to-wiki.perl;hb=my-todo Dscho\'s script]. +
+ +== A note from the maintainer == + +'; + +sub p { + $_ = $_[0]; + s/^\* (This document)$/\n== $1 ==/; + s/^\* (.*?)\.*$/\n=== $1 ===/; + s/http:\/\/www.kernel.org\/$/[http:\/\/www.kernel.org\/pub\/software\/scm\/git\/docs\/ $&]/; + s/ repo.or.cz/ [http:\/\/repo.or.cz$&]/; + + s/^ (\S+) *(--.*?)\n*$/$tabbed = 3; sprintf("* '''$1''' $2");/e; + s/^ [-*] (.*?)\n*$/$tabbed = 3; sprintf("* $1");/e; + s/^ [-*] (.*?)\n*$/$tabbed = 3; sprintf("** $1");/e; + s/^ ([A-Z].*?)\n*$/$tabbed = 3; sprintf(":$1");/e; + s/^ [-*] (.*?)\n*$/$tabbed = 3; sprintf("*** $1");/e; + s/^ \((\d)\) (.*?)\n*$/$tabbed = 3; sprintf(": $1. $2");/e; + + $gitlink = "[http://repo.or.cz/w/git.git?a=blob_plain;f="; + $gitlink2 = "[http://repo.or.cz/w/git.git?a=blob;f="; + s/(Documentation\/SubmittingPatches|contrib\/README)/$gitlink$1 $1]/; + s/(MaintNotes)/$gitlink$1;hb=todo $1]/; + s/Meta\/(PU|git-topic.perl)/$gitlink2$1;hb=todo Meta\/$1]/; + s/html and man branches/'html' and 'man' branches/g; + s/^The maintainer's git time/ + +---- +== Addendum == + +=== Activities === + +$&/; + s/^(The policy |A typical git day)/ +=== $1 === + +$1/; + s/^Some observations/=== Observations === + +$&/; + + if ($tabbed == 3) { + $tabbed--; + } elsif ($tabbed) { + if (/^$tab/ || ($tabbed == 2 && /^ /)) { + if ($tabbed == 1) { + s/^$tab//; + s/^\$/ \$/; + s/$/
/; + } else { + s/^\s*/:/; + s/\n*$//; + } + } else { + if ($tabbed == 2) { + print "\n"; + } else { + print "\n"; + } + $tabbed = 0; + } + } else { + if (/^$tab/) { + s/^$tab//; + s/^\$/print " "; sprintf(" \$");/e; + s/$/
/; + print "
\n"; + $tabbed = 1; + } + s/^ {3}(\S)/$1/; + } + print $_; +} + +while (<>) { + p $_; +} + +p ""; +print ' + +\'\'\'References:\'\'\' +* [http://permalink.gmane.org/gmane.comp.version-control.git/65722 Addendum to "MaintNotes"] post at git mailing list. +* [http://repo.or.cz/w/git.git?a=blob_plain;f=Documentation/howto/maintain-git.txt Documentation/howto/maintain-git.txt] with foreword by Jeff King. + +'; -- 2.11.4.GIT