Skip to content

Commit

Permalink
refresh the instructions for building the docs
Browse files Browse the repository at this point in the history
Various minor changes:
- gitignore the Jekyll output directory even if you run Jekyll from
  the repo root.
- gitignore the WASM file since it's a build output.
- Get rid of tools/scripts/serve_docs.sh - it's no longer needed since
  Jekyll 4.3.0 which fixed the Content-Type for WASM files
  (jekyll/jekyll#8965)
  4.3.0 was released October 2020.
- In push_docs, when checking out the repo to the working directory,
  directly check out the gh-pages branch instead of checking out HEAD
  and then switching branch.
- Update instructions accordingly.
  • Loading branch information
johnbartholomew committed Mar 22, 2024
1 parent 55eafec commit 0b7bcb1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 73 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ bazel-*
/dist/
/jsonnet.egg-info/
/doc/.jekyll-cache/
/production/
/doc/production/
/doc/js/libjsonnet.wasm

# Cmake
**/CMakeCache.txt
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@ Or you can build it yourself, which requires checking out
[go-jsonnet](https://github.com/google/go-jsonnet). See the README.md in
that repo for instructions.

Then, from the root of the repository you can generate and serve the website using
[Jekyll](https://jekyllrb.com/):
The standard library is documented in a structured format in `doc/_stdlib_gen/stdlib-content.jsonnet`.
The HTML (input for Jekyll) is regenerated using the following command:

```
tools/scripts/serve_docs.sh
tools/scripts/update_web_content.sh
```

This should the website on localhost:8200, automatically rebuild when you change any underlying
files, and automatically refresh your browser when that happens.

The standard library is documented in a structured format in `doc/_stdlib_gen/stdlib-content.jsonnet`.
The HTML (input for Jekyll) is regenerated using the following command:
Then, from the root of the repository you can generate and serve the website using
[Jekyll](https://jekyllrb.com/) (you need version 4.3.0 or later):

```
tools/scripts/update_web_content.sh
jekyll serve -s doc/
```

This should build and serve the website locally, and automatically rebuild
when you change any underlying files.
8 changes: 4 additions & 4 deletions release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Before doing the release, make sure that the project is in good state:
* Make sure that the stdlib documentation is complete. Check the release notes for any
additions or changes to stdlib and make sure they are reflected in the documentation.
* Make sure that you can build the website locally.
* `make doc/js/libjsonnet.js`
* `tools/scripts/serve_docs.sh`
* Download or build libjsonnet.wasm (see README.md for instructions)
* `jekyll serve -s doc/` (you need Jekyll 4.3.0 or later) to serve the site locally to check it.
* Check that it works in two different browsers. Make sure that live evaluation
in the tutorial works.

Expand Down Expand Up @@ -98,8 +98,8 @@ in one sitting and fix any unexpected problems.
## Update the website

In google/jsonnet:
* `make doc/js/libjsonnet.js`
* `tools/scripts/serve_docs.sh`
* Build or download libjsonnet.wasm (see README.md)
* `jekyll serve -s docs/`
* Check that the local version works in two different browsers. Make sure that live evaluation in the tutorial works.
* `tools/scripts/push_docs.sh`
* Check that the public works in two different browsers. Make sure that you are getting the new version (and not an old cached version). Make sure that live evaluation in the tutorial works.
Expand Down
4 changes: 1 addition & 3 deletions tools/scripts/push_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if [ -z "$working_dir" ]; then
trap "rm -rf ${working_dir}" EXIT
fi

git clone $JSONNET_REPO "$working_dir"
git clone -b gh-pages $JSONNET_REPO "$working_dir"

(
cd "$working_dir"
Expand All @@ -74,5 +74,3 @@ jekyll build -d "$working_dir"
git commit -am "Update docs."
git push -u origin gh-pages
)


57 changes: 0 additions & 57 deletions tools/scripts/serve_docs.sh

This file was deleted.

0 comments on commit 0b7bcb1

Please sign in to comment.