Skip to content

Generate a website with docs via mkdocs #2166

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

Merged
merged 8 commits into from
Aug 28, 2023
Merged

Conversation

ilyagr
Copy link
Contributor

@ilyagr ilyagr commented Aug 26, 2023

This is more or less ready for review now.

You can play with the website this generates on https://ilyagr.github.io/jj (which redirects to a placeholder docs for a "released" version of jj) and https://ilyagr.github.io/jj/prerelease.

This includes a github action that updates the "prerelease" section of the website on every update to main.

I initially was thinking of using mdbook, which looks a little better, but I think versioning the docs is important, and the features I want are pretty much only supported by the Mkdocs' "Material" theme. For example, I would have preferred to use the readthedocs theme if it could keep the URL when switching versions (jimporter/mike#81).

Mkdocs is written in Python. The prerequesites for building docs on your machine should be to install Python and Poetry, everything else should be installed automatically by Poetry. See contributing.md for instructions.

(Mostly) fixes #1430.

@ilyagr ilyagr force-pushed the mkdocs branch 4 times, most recently from 7071569 to 4926cca Compare August 26, 2023 06:21
@ilyagr ilyagr changed the title Generate a website with docs, generated by mkdocs Generate a website with docs via mkdocs Aug 26, 2023
@ilyagr ilyagr force-pushed the mkdocs branch 9 times, most recently from fc15398 to 1e67093 Compare August 27, 2023 00:23
@ilyagr ilyagr marked this pull request as ready for review August 27, 2023 00:28
@ilyagr ilyagr force-pushed the mkdocs branch 15 times, most recently from 6410f35 to d3e660b Compare August 27, 2023 01:45
    ```shell script
    ```

breaks mkdocs rendering
@ilyagr
Copy link
Contributor Author

ilyagr commented Aug 27, 2023

Thank you Philip! I addressed your comments, added some more details to contributing.md, and added poetry to the environment nix develop creates.

I'll wait another day or two to see if anyone else has comments. I also think that ultimately @martinvonz should merge this, as he is likely to have to deal with branch protection issues when this is merged. (I don't understand exactly what the best branch protection setup for the gh-pages branch is).

@ilyagr ilyagr force-pushed the mkdocs branch 13 times, most recently from 6b18e03 to c502569 Compare August 28, 2023 03:42
Copy link
Member

@martinvonz martinvonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thank you!

ilyagr added 5 commits August 28, 2023 10:28
I initially was thinking of using `mdbook`, which looks a little better, but I
think versioning the docs is important, and the features I want are pretty much
only supported by the Mkdocs' "Material" theme. 

Mkdocs is written in Python. The prerequesites for building docs on your
machine should be to install Python and Poetry, everything else should be
installed automatically by Poetry. See the edits to `contributing.md` for more details.
One action publishes the 'prerelease' version on every push
to `main`.

The other publishes a 'latest' version on every releasse.

I tested both of them, but not with branch protection rules.
This should allow Nix users to build the documentation in
`nix develop` following the instructions in `contributing.md`.

It feels a little weird to add a package manager and ask
people to use it inside nix, but I think it's simpler
than having two sets of instructions and dependencies
to maintain.
@ilyagr
Copy link
Contributor Author

ilyagr commented Aug 28, 2023

@martinvonz, feel free to merge this whenever you want.

@martinvonz martinvonz enabled auto-merge (rebase) August 28, 2023 17:38
@martinvonz martinvonz merged commit d3428d6 into jj-vcs:main Aug 28, 2023
@ilyagr
Copy link
Contributor Author

ilyagr commented Aug 28, 2023

As expected, the branch protection rules make themselves known.

https://github.com/martinvonz/jj/actions/runs/6003122517/job/16280883112#step:6:77

error: failed to push branch gh-pages to origin: "remote: error: GH006: Protected branch update failed for refs/heads/gh-pages.        
remote: error: Changes must be made through a pull request.        
To https://github.com/martinvonz/jj
 ! [remote rejected] gh-pages -> gh-pages (protected branch hook declined)
error: failed to push some refs to 'https://github.com/martinvonz/jj'"
Error: Process completed with exit code 1.

@martinvonz
Copy link
Member

I've relaxed the branch protections to only require linear updates now.

@ilyagr
Copy link
Contributor Author

ilyagr commented Aug 28, 2023

I asked it to "rerun failed jobs" -- and I think it worked! 🎉

@ilyagr ilyagr deleted the mkdocs branch August 28, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation: Add a Jujutsu Book
3 participants