- Revert "lint: fmt README.md (#694)" (#695) - Switch to markdownlint - Fix markdown linting issues
3.6 KiB
HACKING.md
Documentation
README: Update the table of content
-
Install doctoc
-
To update the TOC run the following command:
doctoc --github README.md
Update asciidoc and/or zshelldoc
If for some reason you want to build the zshelldocs or the PDF manually, you'll need:
- Patience, zsd is very finicky about locales. You have been warned.
- zshelldoc (zsd)
- asciidoc
make doc
Generate the manpage (doc/zinit.1)
-
Install pandoc
-
From the root of the repo run:
pandoc --standalone --to man README.md -o doc/zinit.1
Updating the gh-pages (zdharma-continuum.github.io)
-
Check out the documentation branch
git fetch origin documentation git checkout documentation -
Do your modifications and push your changes
-
Keep an eye on the CI logs
-
If all went well you can head to https://zdharma-continuum.github.io/ to see your changes live.
NOTE: If you really need to push directly, without CI please refer to [the README in the documentation]https://github.com/zdharma-continuum/zinit/blob/documentation/README.md
Testing
We run our tests with zunit.
To add a new test case:
-
zinit for \ as"program" \ atclone"ln -sfv revolver.zsh-completion _revolver" \ atpull"%atclone" \ pick"revolver" \ @molovo/revolver \ as"completion" \ atclone"./build.zsh; ln -sfv zunit.zsh-completion _zunit" \ atpull"%atclone" \ sbin"zunit" \ @zunit-zsh/zunit -
Create a new
.zunitfile in thetests/dir. Here's a template:#!/usr/bin/env zunit @setup { load setup setup } @teardown { load teardown teardown } @test 'zinit-annex-bin-gem-node installation' { # This spawns the official zinit container, and executes a single zinit command # inside it run ./scripts/docker-run.sh --wrap --debug --zunit \ zinit light as"null" for zdharma-continuum/null # Verify exit code of the command above assert $state equals 0 assert "$output" contains "Downloading" local artifact="${PLUGINS_DIR}/zdharma-continuum---null/readme.md" # Check if we downloaded the file correctly and if it is readable assert "$artifact" is_file assert "$artifact" is_readable }You should of course also check out the existing tests ;)
-
To run your new test:
zunit --verbose tests/your_test.zunit
Debugging tests
If you ever need to inspect the ZINIT[HOME_DIR] dir, where zinit's internal data is stored you can do so by commenting
out the @teardown section in your test. Then you can re-run said test and head over to ${TMPDIR:-/tmp}/zunit-zinit.
Good luck!
Misc
Get the list of supported ices
To get the list in a quick-and-dirty fashion you issue:
zinit --help | tail -1
See zinit-autoload.zsh for implementation details.