Skip to content

Commit

Permalink
refactor: rename zinit functions
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster committed Dec 9, 2022
1 parent 59975d7 commit c28580c
Show file tree
Hide file tree
Showing 32 changed files with 3,563 additions and 2,778 deletions.
9 changes: 0 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
.git/
.github/
.git*
doc/
scripts/
test/
tests/

*.zwc
Makefile
10 changes: 5 additions & 5 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
zshelldoc:
runs-on: ubuntu-latest
steps:

- name: checkout repository
uses: actions/checkout@v3

- name: re-generate documentation
run: |
make doc/container
sudo chown -R "$(id -u):$(id -g)" .
- name: build docker image
run: make container-build

- name: generate documentation
run: make container-docs

- name: check for out-of-date documentation
run: |
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* change ctags symbols browser key binding from `ctrl-k` to `alt-Q` ([#387](https://github.com/zdharma-continuum/zinit/issues/387)) ([7f6dc7d](https://github.com/zdharma-continuum/zinit/commit/7f6dc7da6c824b30c0e8e30ae0ecbda5be118e68)), closes [#386](https://github.com/zdharma-continuum/zinit/issues/386)
* Do not try to escape exclamation marks ([#399](https://github.com/zdharma-continuum/zinit/issues/399)) ([0e55b2e](https://github.com/zdharma-continuum/zinit/commit/0e55b2ea673915c462af752ee7d46fff55e6f436))
* docs workflow should fail if out-of-date ([#278](https://github.com/zdharma-continuum/zinit/issues/278)) ([07cde66](https://github.com/zdharma-continuum/zinit/commit/07cde660081c91382ce73b60485839710154c7c6))
* Don't error if $OPTS is not yet defined in .zinit-compinit call ([44765e0](https://github.com/zdharma-continuum/zinit/commit/44765e0bcb8d3f1ee3eb55286e33ad17b8c72a5e))
* Don't error if $OPTS is not yet defined in zi::compinit call ([44765e0](https://github.com/zdharma-continuum/zinit/commit/44765e0bcb8d3f1ee3eb55286e33ad17b8c72a5e))
* filter by runtime detected CPU before compiled CPU ([#304](https://github.com/zdharma-continuum/zinit/issues/304)) ([a4dc13f](https://github.com/zdharma-continuum/zinit/commit/a4dc13f66a65c4fa52953104c13e44a7d7c0a945)), closes [#287](https://github.com/zdharma-continuum/zinit/issues/287)
* gh-r & plugin zunit tests ([dd12fce](https://github.com/zdharma-continuum/zinit/commit/dd12fce3f49db284de7cf18a03ef891cc46bc7cc))
* gh-r filters i686 (32 bit) for x86_64 ([#226](https://github.com/zdharma-continuum/zinit/issues/226)) ([57f0d82](https://github.com/zdharma-continuum/zinit/commit/57f0d82118ed626f04d4b9b8b26de48c9d7e0956)), closes [#225](https://github.com/zdharma-continuum/zinit/issues/225)
Expand Down
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# syntax=docker/dockerfile-upstream:master

ARG TARGETPLATFORM=linux/amd64
FROM --platform=$TARGETPLATFORM asciidoctor/docker-asciidoctor:latest

ENV USER root
ENV ZINIT_HOME /${USER}/zinit.git

RUN apk add \
asciidoc-doc \
make \
less \
tree \
zsh

WORKDIR /${USER}

COPY . ./zinit.git
COPY ./docker/zshrc .zshrc

RUN zsh --interactive --login -c -- '@zi::scheduler burst'

CMD ["zsh","--interactive","--login"]
20 changes: 13 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
.EXPORT_ALL_VARIABLES:

ZSH := $(shell command -v zsh 2> /dev/null)
SRC := zinit{'','-additional','-autoload','-install','-side'}.zsh
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/

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)"
cd doc; zsh -l -d -f -i -c "zsd -v --scomm --cignore '(\#*FUNCTION:[[:space:]][\+\@\-\:\~\-a-zA-Z0-9]*[\[]*|}[[:space:]]\#[[:space:]][\]]*)' $(DOC_SRC); make -C ./zsdoc pdf"

CONTAINER_NAME := zinit
CONTAINER_CMD := docker run -it --platform=linux/x86_64 --mount=source=$(CONTAINER_NAME)-volume,destination=/root

container-build: ## build docker image
docker build --file=Dockerfile --platform=linux/x86_64 --tag=$(CONTAINER_NAME):latest .

container-docs: ## regenerate zinit docs in container
$(CONTAINER_CMD) $(CONTAINER_NAME):latest make --directory zinit.git/ doc

doc/container: container
./scripts/docker-run.sh --docs --debug
container-shell: ## start shell in docker container
$(CONTAINER_CMD) $(CONTAINER_NAME):latest

# Run ctags to generate Emacs and Vim's format tag file.
tags: tags/emacs tags/vim
Expand Down
2 changes: 1 addition & 1 deletion doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ For more details check out [PR #61](https://github.com/zdharma-continuum/zinit/p
- 06-11-2021

- 🚧 zinit has a new home: https://github.com/zdharma-continuum/zinit
- The migration from @zdharma, @Zsh-Packages and @zinit-zsh is still in progress. If you are interested in helping
- The migration from @zdharma, @Zsh-Packages and @zi::zsh is still in progress. If you are interested in helping
or want to let us know that a particular project is missing, please head to
[I_WANT_TO_HELP](https://github.com/zdharma-continuum/I_WANT_TO_HELP/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
- 📚 zinit now ensures that the man dirs under `$ZPFX/man` are created on startup. Please note that these directories
Expand Down
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

0 comments on commit c28580c

Please sign in to comment.