diff --git a/Makefile b/Makefile index 8c2975f..0843c31 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ MANPREFIX ?= "$(PREFIX)/share/man/man1" SYSCONFDIR ?= $(PREFIX)/etc BINS = $(wildcard bin/git-*) MANS = $(wildcard man/git-*.md) +MAN_BINS = $(filter-out man/git-extras.md, $(MANS)) MAN_HTML = $(MANS:.md=.html) MAN_PAGES = $(MANS:.md=.1) CODE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) @@ -62,7 +63,27 @@ install: @echo "If you are a zsh user, you may want to 'source $(CODE_DIR)etc/git-extras-completion.zsh'" \ "and put this line into ~/.zshrc to enable zsh completion" -man/%.html: man/%.md +man/index.txt: $(MANS) + echo '# manuals' > $@.tmp + for file in $(sort $^) ; do \ + extra=$${file%.md} ; \ + extra=$${extra#man/} ; \ + echo "$$extra(1) $$extra" >> $@.tmp ; \ + done + mv -f $@.tmp $@ + +man/git-extras.md: $(MAN_BINS) + ln=$$(awk '/## COMMANDS/{print NR};' $@) ; \ + awk "NR <= $$ln+1" $@ > $@.tmp + for file in $(sort $^) ; do \ + head -n1 $$file | \ + sed 's/^/ - **/;s/ -- /** /' >> $@.tmp ; \ + done + ln=$$(awk '/## AUTHOR/{print NR};' $@) ; \ + awk "NR >= $$ln-1" $@ >> $@.tmp + mv -f $@.tmp $@ + +man/%.html: man/%.md man/index.txt ronn \ --manual "Git Extras" \ --html \ diff --git a/man/Readme.md b/man/Readme.md index b547596..07fa070 100644 --- a/man/Readme.md +++ b/man/Readme.md @@ -7,12 +7,12 @@ To generate documentation: 1) Start by filling out the 'man-template.md' -2) Then use a program ronn. [Get ronn from github.](https://github.com/rtomayko/ronn) +2) Then install a program ronn. [Get ronn from github.](https://github.com/rtomayko/ronn) -3) Run ronn: +3) Run make: ``` -$ ronn .md +$ make -C .. man/git-.{1,html} ``` 4) Remember, we use the following naming convention for files: @@ -21,33 +21,6 @@ $ ronn .md git-.html git-.1 git-.md -``` - - You'll need to rename the html file, as ronn probably inserted a 1 into the filename. - -## EXAMPLE - -``` -$ ronn git-effort.md - -roff: ./git-effort.1 -html: ./git-effort.1.html +man - -$ mv git-effort.1.html git-effort.html -``` - -## SHELL SCRIPT - -Alternatively you can run the `manning-up.sh` automated shell script included in the man folder. The script will recreate the git-extras index based on the list of .md files available before it runs `ronn` against each one to generate the documents as well as renaming the generated `.html` files to their desired form. - -``` -$ ./manning-up.sh -``` - -To only (re)generate a specific .md manual template and have `.1.html` renamed to `.html` yau may also use manning-up.sh. - -``` -$ ./manning-up.sh git-info.md ``` ## AUTHOR diff --git a/man/git-alias.1 b/man/git-alias.1 index dde2856..1d71eab 100644 --- a/man/git-alias.1 +++ b/man/git-alias.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-ALIAS" "1" "June 2017" "" "" +.TH "GIT\-ALIAS" "1" "October 2017" "" "Git Extras" . .SH "NAME" \fBgit\-alias\fR \- Define, search and show aliases diff --git a/man/git-alias.html b/man/git-alias.html index b95759a..708de5d 100644 --- a/man/git-alias.html +++ b/man/git-alias.html @@ -65,7 +65,7 @@
  1. git-alias(1)
  2. -
  3. +
  4. Git Extras
  5. git-alias(1)
@@ -136,7 +136,7 @@ whois = !sh -c 'git log -i -1 --pretty="format:%an <%ae>
  1. -
  2. June 2017
  3. +
  4. October 2017
  5. git-alias(1)
diff --git a/man/git-archive-file.1 b/man/git-archive-file.1 index 9405813..6022939 100644 --- a/man/git-archive-file.1 +++ b/man/git-archive-file.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-ARCHIVE\-FILE" "1" "December 2016" "" "Git Extras" +.TH "GIT\-ARCHIVE\-FILE" "1" "October 2017" "" "Git Extras" . .SH "NAME" \fBgit\-archive\-file\fR \- Export the current HEAD of the git repository to an archive diff --git a/man/git-archive-file.html b/man/git-archive-file.html index 4e2a636..63ba060 100644 --- a/man/git-archive-file.html +++ b/man/git-archive-file.html @@ -111,7 +111,7 @@
  1. -
  2. December 2016
  3. +
  4. October 2017
  5. git-archive-file(1)
diff --git a/man/git-authors.1 b/man/git-authors.1 index f0a0477..edebfd9 100644 --- a/man/git-authors.1 +++ b/man/git-authors.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-AUTHORS" "1" "October 2016" "" "" +.TH "GIT\-AUTHORS" "1" "October 2017" "" "Git Extras" . .SH "NAME" \fBgit\-authors\fR \- Generate authors report diff --git a/man/git-authors.html b/man/git-authors.html index e15abc2..185f3ef 100644 --- a/man/git-authors.html +++ b/man/git-authors.html @@ -65,7 +65,7 @@
  1. git-authors(1)
  2. -
  3. +
  4. Git Extras
  5. git-authors(1)
@@ -139,7 +139,7 @@ Leila Muhtasib
  1. -
  2. October 2016
  3. +
  4. October 2017
  5. git-authors(1)
diff --git a/man/git-back.1 b/man/git-back.1 index b88a83d..ca873a0 100644 --- a/man/git-back.1 +++ b/man/git-back.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-BACK" "1" "December 2015" "" "" +.TH "GIT\-BACK" "1" "October 2017" "" "Git Extras" . .SH "NAME" \fBgit\-back\fR \- Undo and Stage latest commits diff --git a/man/git-back.html b/man/git-back.html index 8ff46e6..3ed0e15 100644 --- a/man/git-back.html +++ b/man/git-back.html @@ -65,7 +65,7 @@
  1. git-back(1)
  2. -
  3. +
  4. Git Extras
  5. git-back(1)
@@ -115,7 +115,7 @@
  1. -
  2. December 2015
  3. +
  4. October 2017
  5. git-back(1)
diff --git a/man/git-bug.1 b/man/git-bug.1 index 6bc8966..ee581e1 100644 --- a/man/git-bug.1 +++ b/man/git-bug.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-BUG" "1" "July 2017" "" "" +.TH "GIT\-BUG" "1" "October 2017" "" "Git Extras" . .SH "NAME" \fBgit\-bug\fR \- Create bug branch diff --git a/man/git-bug.html b/man/git-bug.html index 64bd56f..f4df38c 100644 --- a/man/git-bug.html +++ b/man/git-bug.html @@ -65,7 +65,7 @@
  1. git-bug(1)
  2. -
  3. +
  4. Git Extras
  5. git-bug(1)
@@ -126,7 +126,7 @@ Modified by Mark Pitman <
  • -
  • July 2017
  • +
  • October 2017
  • git-bulk(1)
  • diff --git a/man/git-changelog.1 b/man/git-changelog.1 index d651101..88397bc 100644 --- a/man/git-changelog.1 +++ b/man/git-changelog.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-CHANGELOG" "1" "November 2017" "" "" +.TH "GIT\-CHANGELOG" "1" "January 2018" "" "Git Extras" . .SH "NAME" \fBgit\-changelog\fR \- Generate a changelog report diff --git a/man/git-changelog.html b/man/git-changelog.html index 34db05f..e2c8cba 100644 --- a/man/git-changelog.html +++ b/man/git-changelog.html @@ -65,7 +65,7 @@
    1. git-changelog(1)
    2. -
    3. +
    4. Git Extras
    5. git-changelog(1)
    @@ -184,7 +184,7 @@
    1. -
    2. November 2017
    3. +
    4. January 2018
    5. git-changelog(1)
    diff --git a/man/git-chore.1 b/man/git-chore.1 index 25ca64f..bc45893 100644 --- a/man/git-chore.1 +++ b/man/git-chore.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-CHORE" "1" "July 2017" "" "" +.TH "GIT\-CHORE" "1" "October 2017" "" "Git Extras" . .SH "NAME" \fBgit\-chore\fR \- Create chore branch diff --git a/man/git-chore.html b/man/git-chore.html index f41c6a5..7cbe08b 100644 --- a/man/git-chore.html +++ b/man/git-chore.html @@ -65,7 +65,7 @@
    1. git-chore(1)
    2. -
    3. +
    4. Git Extras
    5. git-chore(1)
    @@ -124,7 +124,7 @@ Modified by Mark Pitman <
  • git-clear-soft(1)
  • -
  • +
  • Git Extras
  • git-clear-soft(1)
  • @@ -105,7 +105,7 @@
    1. -
    2. July 2016
    3. +
    4. October 2017
    5. git-clear-soft(1)
    diff --git a/man/git-clear.1 b/man/git-clear.1 index fede733..7c00138 100644 --- a/man/git-clear.1 +++ b/man/git-clear.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-CLEAR" "1" "May 2016" "" "" +.TH "GIT\-CLEAR" "1" "May 2018" "" "Git Extras" . .SH "NAME" \fBgit\-clear\fR \- Rigorously clean up a repository diff --git a/man/git-clear.html b/man/git-clear.html index ec57152..4d4c9a4 100644 --- a/man/git-clear.html +++ b/man/git-clear.html @@ -3,7 +3,7 @@ - git-clear(1) - Rigorously clean up a repository + git-clear(1) - Rigorously clean up a repository