diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 84f9cae..6983404 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -92,3 +92,17 @@ jobs: run: | git diff --exit-code git diff --cached --exit-code + + publish: + if: startswith(github.ref, 'refs/tags/') + name: publish + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Publish Docs + uses: mhausenblas/mkdocs-deploy-gh-pages@master + env: + GITHUB_TOKEN: ${{ secrets.MKDOCS_PUBLISH_GITHUB_TOKEN }} + REQUIREMENTS: mkdocs-requirements.txt diff --git a/.gitignore b/.gitignore index e0c50ab..c04fcc5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ *.coverprofile *.orig -node_modules/ vendor .idea internal/*/built-example coverage.txt /.local/ +/site/ *.exe diff --git a/Makefile b/Makefile index 52e9204..ba783cb 100644 --- a/Makefile +++ b/Makefile @@ -30,3 +30,15 @@ gfmrun: .PHONY: toc toc: go run internal/build/build.go toc docs/v2/manual.md + +.PHONY: docs +docs: + mkdocs build + +.PHONY: docs-deps +docs-deps: + pip install -r mkdocs-requirements.txt + +.PHONY: serve-docs +serve-docs: + mkdocs serve diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..8654f8f --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +cli.urfave.org diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 120000 index 0000000..0400d57 --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1 @@ +../CODE_OF_CONDUCT.md \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 37055ff..7e80bdb 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -98,6 +98,28 @@ line help system which may be consulted for further information, e.g.: go run internal/genflags/cmd/genflags/main.go --help ``` +#### docs output + +The documentation in the `docs` directory is automatically built via `mkdocs` into a +static site and published when releases are pushed (see [RELEASING](./RELEASING/)). There +is no strict requirement to build the documentation when developing locally, but the +following `make` targets may be used if desired: + +```sh +# install documentation dependencies with `pip` +make docs-deps +``` + +```sh +# build the static site in `./site` +make docs +``` + +```sh +# start an mkdocs development server +make serve-docs +``` + ### pull requests Please feel free to open a pull request to fix a bug or add a feature. The @urfave/cli diff --git a/docs/index.md b/docs/index.md index d9d5d46..7927044 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,5 +16,6 @@ These are the guides for each major supported version: In addition to the version-specific guides, these other documents are available: -- [`CONTRIBUTING`](./CONTRIBUTING/) -- [`RELEASING`](./RELEASING/) +- [CONTRIBUTING](./CONTRIBUTING/) +- [CODE OF CONDUCT](./CODE_OF_CONDUCT/) +- [RELEASING](./RELEASING/) diff --git a/mkdocs-requirements.txt b/mkdocs-requirements.txt index 94dae76..1c2f874 100644 --- a/mkdocs-requirements.txt +++ b/mkdocs-requirements.txt @@ -1,4 +1,4 @@ -mkdocs -mkdocs-material -mkdocs-git-revision-date-localized-plugin -pygments +mkdocs~=1.3 +mkdocs-material~=8.2 +mkdocs-git-revision-date-localized-plugin~=1.0 +pygments~=2.12