From 03ea2802495df568690760906e26dda753f75e1d Mon Sep 17 00:00:00 2001 From: David Greaves Date: Sun, 8 May 2005 18:22:48 +0100 Subject: [PATCH 2/2] core-git documentation update Reformat core-git.txt to asciidoc format. Includes split-docs.pl to create individual txt, html and man pages. Editorial note. I've updated to add git-diff-cache -m and git-update-cache --replace description on top of the version David posted to the GIT list and got his OK. Signed-off-by: David Greaves Signed-off-by: Junio C Hamano --- Documentation/split_docs.pl | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 Documentation/split_docs.pl (limited to 'Documentation/split_docs.pl') diff --git a/Documentation/split_docs.pl b/Documentation/split_docs.pl new file mode 100755 index 0000000000..655489315f --- /dev/null +++ b/Documentation/split_docs.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl -w +use strict; + +my $cmd; +my $name; + +my $author; + +while () { + if (/^NAME$/ || eof(STDIN)) { + if ($cmd) { + print PAGE $author if defined($author); + print PAGE "Documentation\n--------------\nDocumentation by David Greaves, Junio C Hamano and the git-list .\n\n"; + print PAGE "GIT\n---\nPart of the link:git.html[git] suite\n\n"; + + if ($#ARGV || $ARGV[0] eq "-html") { + system(qw(asciidoc -b css-embedded -d manpage), "$cmd.txt"); + } elsif ($ARGV[0] eq "-man") { + system(qw(asciidoc -b docbook -d manpage), "$cmd.txt"); + system(qw(xmlto man), "$cmd.xml") if -e "$cmd.xml"; + } + } + exit if eof(STDIN); + $_=;$_=; # discard underline and get command + chomp; + $name = $_; + ($cmd) = split(' ',$_); + print "$name\n"; + open(PAGE, "> $cmd.txt") or die; + print PAGE "$cmd(1)\n==="."="x length($cmd); + print PAGE "\nv0.1, May 2005\n\nNAME\n----\n$name\n\n"; + + + $author = "Author\n------\nWritten by Linus Torvalds \n\n"; + + next; + } + next unless $cmd; + + $author=undef if /^AUTHOR$/i; # don't use default for commands with an author + + print PAGE $_; + +} -- cgit v1.3