diff --git a/README.md b/README.md index 21eb90b..a3db550 100644 --- a/README.md +++ b/README.md @@ -3,33 +3,20 @@ 1 - Welcome To Gitdown ================== Gitdown is a simple tool for writing documentation hosted on a github repository. It uses [ditaa][] to convert ascii diagrams into images, and produces [markdown][] documents that can be uploaded to your repository along with code. I made Gitdown so that we could write technical white papers and user guides as plain text (including diagrams) and publish them with a single "git push" command. Gitdown is a simpler version of the tool we use to maintain the [ØMQ][zeromq] [Guide][zguide]. -Gitdown is written and maintained by Pieter Hintjens. Please use the issue [tracker][] for all comments and errata. This document was published on Thursday February, 2017 at 20:23:49, and generated by the magic of Gitdown from README.txt. +Gitdown is written and maintained by Pieter Hintjens. Please use the issue [tracker][] for all comments and errata. This document was published on Thursday January, 2025 at 11:44:16, and generated by the magic of Gitdown from README.txt. -This is version 2011.03.24 of Gitdown. Changelog: +This is version 2025.01.02 of Gitdown. +See git log for changes. -* 2013.02.05: Gyepi Sam changed pull command to make chunk specification optional. -* 2010.03.24: added .pull command to include chunks from other files. -* 2010.10.11: don't do symbol substitution in code blocks. -* 2010.10.09: added .toc token to generate table of contents. - - Contents -------- -* License -* Installation and Use -* Installation in Cygwin -* How it Works -* Gitdown Syntax Summary -* Markdown Syntax Summary - License ------- @@ -38,7 +25,6 @@ Copyright (c) 1996-2011 iMatix Corporation This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - Installation and Use -------------------- @@ -72,7 +58,6 @@ To use Gitdown, edit a text document much like this README.txt. Then: The images directory holds images for all documents in the current directory. You can write documents anywhere on the git tree but if they are not at the root you must tell Gitdown how to create a full image path by setting the SUBDIR symbol (see below). - Installation in Cygwin ---------------------- @@ -96,7 +81,6 @@ Add this to your ~/.bash_profile: export PERLLIB=$PATH - How it Works ------------ @@ -115,7 +99,6 @@ The Gitdown workflow is: This README acts as an example. - Gitdown Syntax Summary --------------------- @@ -181,7 +164,6 @@ These symbols are predefined by gitdown for you: * SELF specifies the input file name without extension. * OUTPUT specifies the current output file name, - Markdown Syntax Summary ----------------------- diff --git a/README.txt b/README.txt index 6b3331b..08a7f1b 100644 --- a/README.txt +++ b/README.txt @@ -21,12 +21,8 @@ Gitdown is a simple tool for writing documentation hosted on a github repository Gitdown is written and maintained by Pieter Hintjens. Please use the issue [tracker][] for all comments and errata. This document was published on &date("dddd mmmm, yyyy") at &time(), and generated by the magic of Gitdown from $(INPUT). -This is version 2011.03.24 of Gitdown. Changelog: - -* 2013.02.05: Gyepi Sam changed pull command to make chunk specification optional. -* 2010.03.24: added .pull command to include chunks from other files. -* 2010.10.11: don't do symbol substitution in code blocks. -* 2010.10.09: added .toc token to generate table of contents. +This is version 2025.01.02 of Gitdown. +See git log for changes. Contents -------- diff --git a/bin/gitdown b/bin/gitdown index 51558b8..f3e7ae5 100755 --- a/bin/gitdown +++ b/bin/gitdown @@ -28,16 +28,20 @@ push(@INC, $path); # Uses the Perl SFL modules from htmlpp require 'sflcvdp.pl'; # SFL date picture formatting -$version = "2014.10.10"; +$version = "2025.01.02"; # Parse and validate provided filename -die "Syntax: gitdoc textfilename\n" - unless $#ARGV == 0; -$input = $ARGV [0]; +$input = $ARGV[0]; +die "Syntax: gitdown textfilename [markdownfilename]\n" + unless $input; +die "Input should be a .txt file, not a .md file\n" + if $input =~ /\.md$/; + $self = $input; $self =~ s/\.[^.]*$//; -$output .= "$self.md"; -die "Input should be a .txt file, not a .md file\n" + +$output = $ARGV[1] || "$self.md"; +die "Input file cannot be the same as output file\n" if $input eq $output; # Read input file into @input array @@ -46,7 +50,7 @@ die "Can't read $input: $!" while () { chop; - if (/^\.pull\s+(.*?)([@,].+)?\s*$/) { + if (/^\.pull\s+(.+?)([@,].+)?\s*$/) { my ($source, $rest) = ($1, $2); my ($tag, $opts); #tags and opts are both optional diff --git a/images/README_1.png b/images/README_1.png index 904c7fc..3536397 100644 Binary files a/images/README_1.png and b/images/README_1.png differ diff --git a/images/README_2.png b/images/README_2.png index 4b0f099..6ae0368 100644 Binary files a/images/README_2.png and b/images/README_2.png differ diff --git a/test/pull.md b/test/pull.md index 2dadae6..87e705c 100644 --- a/test/pull.md +++ b/test/pull.md @@ -7,11 +7,13 @@ The reward for work well done is the opportunity to do more. This is chunk 2, which is code +```chunks for(int i = 0; i < argc ; i++) { printf("%s\n", argv[i]); } +``` This is chunk 3, which is left aligned @@ -27,3 +29,5 @@ This is file2, no chunk, plain text There is wisdom in turning as often as possible from the familiar to the unfamiliar: it keeps the mind nimble, it kills prejudice, and it fosters humor. + +_This documentation was generated from test/pull.txt using [Gitdown](https://github.com/zeromq/gitdown)_