Skip to content
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

Docs/pdf generation #625

Closed
wants to merge 9 commits into from
Closed
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
18 changes: 3 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
*.[aos]
*.bundle
*.dll
*.orig
*.txt
*.zini
*.zwc
*deploy*key*
*~
.*.sw?
.project
TAGS
TODO*
\#*
doc/zsdoc/data
other
site*/
doc/**/data
doc/**/pdf
tags
test/
test?/_*
txt/
zmodules/
tests/_output/
tests/_support/zunit/
.idea
2 changes: 1 addition & 1 deletion .zunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ directories:
tests: tests
output: tests/_output
support: tests/_support
fail_fast: true
fail_fast: false
verbose: true
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
.EXPORT_ALL_VARIABLES:

ZSH := $(shell command -v zsh 2> /dev/null)
SRC := zinit{'','-additional','-autoload','-install','-side'}.zsh
ZSH := $(shell command -v zsh 2> /dev/null) -ilc
SRC := share/{'git-process-output','rpm2cpio'}.zsh zinit{'','-additional','-autoload','-install','-side'}.zsh
DOC_SRC := $(foreach wrd,$(SRC),../$(wrd))

.PHONY: all clean container doc doc/container tags tags/emacs tags/vim test zwc

clean:
rm -rvf *.zwc doc/zsdoc/zinit{'','-additional','-autoload','-install','-side'}.zsh.adoc doc/zsdoc/data/
$(ZSH) 'zi delete --yes zdharma-continuum/zshelldoc; exit'

container:
docker build --tag=ghcr.io/zdharma-continuum/zinit:latest --file=docker/Dockerfile .

doc: clean
cd doc; zsh -l -d -f -i -c "zsd -v --scomm --cignore '(\#*FUNCTION:[[:space:]][\:\∞\.\+\@\-a-zA-Z0-9]*[\[]*|}[[:space:]]\#[[:space:]][\]]*)' $(DOC_SRC)"
deps:
$(ZSH) "zi for make'PREFIX=$${ZPFX} install' nocompile zdharma-continuum/zshelldoc"

doc: deps
cd doc; $(ZSH) -df "zsd -v --scomm --cignore '(\#*FUNCTION:[[:space:]][\~\-\:\+\@\__\-a-zA-Z0-9]*[\[]*|}[[:space:]]\#[[:space:]][\]]*)' $(DOC_SRC); make -C ./zsdoc pdf"

doc/container: container
./scripts/docker-run.sh --docs --debug

# Run ctags to generate Emacs and Vim's format tag file.
tags: tags/emacs tags/vim
tags: tags/emacs tags/vim ## Run ctags to generate Emacs and Vim's format tag file.

tags/emacs: ## Build Emacs-style ctags file
@if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \
ctags -e -R --options=share/zsh.ctags --languages=zsh \
--pattern-length-limit=250 --maxdepth=1; \
ctags --languages=zsh --maxdepth=1 --options=share/zsh.ctags --pattern-length-limit=250 -R -e; \
else \
ctags -e -R --languages=sh --langmap=sh:.zsh; \
fi; \
printf "Created the Emacs \`TAGS\` file.\\n"; \
printf "Created the Emacs TAGS file\n"; \
else \
printf 'Error: Please install a Ctags (e.g.: either the Exuberant or Universal %b' \
'version) utility first.\n'; \
printf 'Error: Please install a Ctags (e.g.: either the Exuberant or Universal %b version) utility first\n'; \
fi

tags/vim: ## Build the Vim-style ctags file
Expand All @@ -51,4 +52,4 @@ test:
zunit run

zwc:
$(or $(ZSH),:) -fc 'for f in *.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'
$(ZSH) 'for f in *.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'
98 changes: 50 additions & 48 deletions doc/zsdoc/Makefile
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
# This Makefile is to convert supplied Asciidoc files into
# other formats like pdf and man. The files contain Zplugin's
# code documentation.
#
# *.adoc files are generated by Makefile from upper (i.e. top)
# directory.

all: man pdf

# MANUALS
# Converted with a2x from asciidoc package

man: man/zinit.zsh.1 man/zinit-side.zsh.1 man/zinit-install.zsh.1 man/zinit-autoload.zsh.1

man/zinit.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit.zsh.adoc

man/zinit-side.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-side.zsh.adoc

man/zinit-install.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-install.zsh.adoc

man/zinit-autoload.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-autoload.zsh.adoc
# *.adoc files are generated by Makefile from upper (i.e. top) directory.

SRC := $(shell zsh -c "echo {'git-process-output','rpm2cpio'}.zsh zinit{'','-additional','-autoload','-install','-side'}.zsh")

PDF_SRC := $(foreach wrd,$(SRC),$(wrd).pdf)
PDF_CMD := asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf

MAN_SRC := $(foreach wrd,$(SRC),man/$(wrd))
MAN_CMD := a2x --verbose -L --doctype manpage --format manpage -D man

.PHONY: all clean test man pdf

all: clean man pdf
dirs:
mkdir -p man pdf

# Manual pages
# uses a2x from asciidoc package
man: dirs $(MAN_SRC)
man/git-process-output.zsh:
$(MAN_CMD) git-process-output.zsh.adoc
man/rpm2cpio.zsh:
$(MAN_CMD) rpm2cpio.zsh.adoc
man/zinit-additional.zsh:
$(MAN_CMD) zinit-additional.zsh.adoc
man/zinit-autoload.zsh:
$(MAN_CMD) zinit-autoload.zsh.adoc
man/zinit-install.zsh:
$(MAN_CMD) zinit-install.zsh.adoc
man/zinit-side.zsh:
$(MAN_CMD) zinit-side.zsh.adoc
man/zinit.zsh:
$(MAN_CMD) zinit.zsh.adoc

# PDFS
# Uses asciidoctor not a2x (i.e. not asciidoc)

pdf: pdf/zinit.zsh.pdf pdf/zinit-side.zsh.pdf pdf/zinit-install.zsh.pdf pdf/zinit-autoload.zsh.pdf

pdf/zinit.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit.zsh.adoc

pdf/zinit-side.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-side.zsh.adoc

pdf/zinit-install.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-install.zsh.adoc

pdf/zinit-autoload.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-autoload.zsh.adoc
# uses asciidoctor not a2x (i.e. not asciidoc)
pdf: dirs $(PDF_SRC)
git-process-output.zsh.pdf:
$(PDF_CMD) git-process-output.zsh.adoc
rpm2cpio.zsh.pdf:
$(PDF_CMD) rpm2cpio.zsh.adoc
zinit-additional.zsh.pdf:
$(PDF_CMD) zinit-additional.zsh.adoc
zinit-autoload.zsh.pdf:
$(PDF_CMD) zinit-autoload.zsh.adoc
zinit-install.zsh.pdf:
$(PDF_CMD) zinit-install.zsh.adoc
zinit-side.zsh.pdf:
$(PDF_CMD) zinit-side.zsh.adoc
zinit.zsh.pdf:
$(PDF_CMD) zinit.zsh.adoc

clean:
rm -rf man pdf data

.PHONY: man pdf clean

# vim:noet:sts=8:ts=8
# vim:ft=make:noet:sts=4:ts=4
75 changes: 75 additions & 0 deletions doc/zsdoc/git-process-output.zsh.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
git-process-output.zsh(1)
=========================
:compat-mode!:

NAME
----
git-process-output.zsh - a shell script

SYNOPSIS
--------
Documentation automatically generated with `zshelldoc'

FUNCTIONS
---------

print_my_line
print_my_line_compress
timeline

DETAILS
-------

Script Body
~~~~~~~~~~~

Has 113 line(s). Calls functions:

Script-Body
|-- print_my_line
|-- print_my_line_compress
`-- timeline

Uses feature(s): _eval_, _read_, _setopt_, _trap_

print_my_line
~~~~~~~~~~~~~

____

$1 - n. of objects
$2 - packed objects
$3 - total objects
$4 - receiving percentage
$5 - resolving percentage
____

Has 13 line(s). Doesn't call other functions.

Called by:

Script-Body

print_my_line_compress
~~~~~~~~~~~~~~~~~~~~~~

Has 12 line(s). Doesn't call other functions.

Called by:

Script-Body

timeline
~~~~~~~~

____

Code by leoj3n
____

Has 15 line(s). Doesn't call other functions.

Called by:

Script-Body

Binary file added doc/zsdoc/pdf/git-process-output.zsh.pdf
Binary file not shown.
Binary file added doc/zsdoc/pdf/rpm2cpio.zsh.pdf
Binary file not shown.
Binary file added doc/zsdoc/pdf/zinit-additional.zsh.pdf
Binary file not shown.
Binary file added doc/zsdoc/pdf/zinit-autoload.zsh.pdf
Binary file not shown.
Binary file added doc/zsdoc/pdf/zinit-install.zsh.pdf
Binary file not shown.
Binary file added doc/zsdoc/pdf/zinit-side.zsh.pdf
Binary file not shown.
Binary file added doc/zsdoc/pdf/zinit.zsh.pdf
Binary file not shown.
24 changes: 24 additions & 0 deletions doc/zsdoc/rpm2cpio.zsh.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
rpm2cpio.zsh(1)
===============
:compat-mode!:

NAME
----
rpm2cpio.zsh - a shell script

SYNOPSIS
--------
Documentation automatically generated with `zshelldoc'

FUNCTIONS
---------


DETAILS
-------

Script Body
~~~~~~~~~~~

Has 51 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).

Loading