Skip to content

Updates #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,20 @@
<img src="https://github.com/imatix/gitdown/raw/master/images/README_1.png" alt="1">
</center>

<A name="toc1-17" title="Welcome To Gitdown"></A>
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.

<A name="toc2-32" title="Contents"></A>
Contents
--------

* <a href="#toc2-38">License</a>
* <a href="#toc2-47">Installation and Use</a>
* <a href="#toc2-81">Installation in Cygwin</a>
* <a href="#toc2-105">How it Works</a>
* <a href="#toc2-160">Gitdown Syntax Summary</a>
* <a href="#toc2-226">Markdown Syntax Summary</a>

<A name="toc2-38" title="License"></A>
License
-------

Expand All @@ -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.

<A name="toc2-47" title="Installation and Use"></A>
Installation and Use
--------------------

Expand Down Expand Up @@ -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).


<A name="toc2-81" title="Installation in Cygwin"></A>
Installation in Cygwin
----------------------

Expand All @@ -96,7 +81,6 @@ Add this to your ~/.bash_profile:
export PERLLIB=$PATH


<A name="toc2-105" title="How it Works"></A>
How it Works
------------

Expand All @@ -115,7 +99,6 @@ The Gitdown workflow is:

This README acts as an example.

<A name="toc2-160" title="Gitdown Syntax Summary"></A>
Gitdown Syntax Summary
---------------------

Expand Down Expand Up @@ -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,

<A name="toc2-226" title="Markdown Syntax Summary"></A>
Markdown Syntax Summary
-----------------------

Expand Down
8 changes: 2 additions & 6 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down
18 changes: 11 additions & 7 deletions bin/gitdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,7 +50,7 @@ die "Can't read $input: $!"

while (<INPUT>) {
chop;
if (/^\.pull\s+(.*?)([@,].+)?\s*$/) {
if (/^\.pull\s+(.+?)([@,].+)?\s*$/) {
my ($source, $rest) = ($1, $2);
my ($tag, $opts); #tags and opts are both optional

Expand Down
Binary file modified images/README_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/README_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions test/pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)_