Skip to content
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

Clean up the generated CLI reference and remove the need fo a symlink using the include-markdown plugin #2986

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

ilyagr
Copy link
Collaborator

@ilyagr ilyagr commented Feb 7, 2024

The main goal is to avoid having a symlink in our source tree. Currently, there
is no good way to work with the jj repo with jj on Windows. Currently jj
just crashes with symlinks. This is being worked on, see e.g. #2939, but it will
always depend on whether Developer Mode is enabled in Windows or whether
symlinks are materialized as text files with symlinks. Finally, MkDocs has
trouble following symlinks on Windows, so building docs wouldn't work there.

Another advantage is that, previously, we were lucky that MkDocs treats insta
header in cli-reference@.md.snap as a Markdown header and follows symlinks at
all. Now, we no longer depend on that.

@ilyagr ilyagr force-pushed the include-markdown branch 2 times, most recently from bd35d03 to da1436e Compare February 9, 2024 04:44
Marching along with the times...
The main goal is to avoid having a symlink in our source tree. Currently, there
is no good way to work with the `jj` repo with `jj` on Windows.  Currently `jj`
just crashes with symlinks. This is being worked on, see e.g. martinvonz#2939, but it will
always depend on whether Developer Mode is enabled in Windows or whether
symlinks are materialized as text files with symlinks. Finally, MkDocs has
trouble following symlinks on Windows, so building docs wouldn't work there.

Another advantage is that, previously, we were lucky that MkDocs treats `insta`
header in `cli-reference@.md.snap` as a Markdown header and follows symlinks at
all. Now, we no longer depend on that.
This is a rather annoying bug. It was revealed because CLI reference stopped
working for *offline* docs after the previous commit. Turns out, none of the
plugins we enabled for normal docs were turned on in `mkdocs-offline.yml`.

Thanks to @mondeja for figuring out what was going on.

In the future, we could try a less ugly fix, e.g. turning the `offline` plugin
on or off via an environment variable.

See also:
squidfunk/mkdocs-material#6749
mondeja/mkdocs-include-markdown-plugin#195 (comment)
@ilyagr ilyagr marked this pull request as ready for review February 9, 2024 04:57
@ilyagr
Copy link
Collaborator Author

ilyagr commented Feb 12, 2024

Thank you, Austin, for the review!

@ilyagr ilyagr merged commit 44e1d4a into martinvonz:main Feb 12, 2024
15 checks passed
@ilyagr ilyagr deleted the include-markdown branch February 12, 2024 18:28
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.

2 participants