2023-08-18 23:43:20 +00:00
|
|
|
site_name: Jujutsu docs
|
|
|
|
site_dir: 'rendered-docs'
|
|
|
|
# Not having this (or viewing the site locally, or from any place other than the
|
|
|
|
# site_url) leads to version switching failing to preserve the current path.
|
|
|
|
site_url: !ENV [SITE_URL_FOR_MKDOCS, 'https://martinvonz.github.io/jj/']
|
|
|
|
theme:
|
|
|
|
name: 'material'
|
|
|
|
language: 'en'
|
|
|
|
features:
|
|
|
|
# - navigation.top
|
2024-01-02 21:14:57 +00:00
|
|
|
|
|
|
|
# Respect the users default settings and add a toggle for manually choosing
|
|
|
|
# automatic/light/dark palette.
|
|
|
|
# taken from https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#system-preference
|
|
|
|
palette:
|
|
|
|
- media: "(prefers-color-scheme)"
|
|
|
|
toggle:
|
|
|
|
icon: material/brightness-auto
|
|
|
|
name: Switch to system preference
|
|
|
|
- media: "(prefers-color-scheme: light)"
|
|
|
|
scheme: default
|
|
|
|
toggle:
|
|
|
|
icon: material/brightness-7
|
|
|
|
name: Switch to light mode
|
|
|
|
- media: "(prefers-color-scheme: dark)"
|
|
|
|
scheme: slate
|
|
|
|
toggle:
|
|
|
|
icon: material/brightness-4
|
|
|
|
name: Switch to dark mode
|
|
|
|
|
2023-08-18 23:43:20 +00:00
|
|
|
extra:
|
|
|
|
version:
|
|
|
|
provider: mike
|
2024-02-07 22:09:29 +00:00
|
|
|
|
2024-05-06 22:54:55 +00:00
|
|
|
validation:
|
|
|
|
anchors: warn
|
|
|
|
|
2024-02-07 22:09:29 +00:00
|
|
|
# IMPORTANT: any changes to plugins have to be duplicated in
|
|
|
|
# `mkdocs-offline.yml`. See that file for more details.
|
2023-08-18 23:43:20 +00:00
|
|
|
plugins:
|
2024-02-07 20:06:54 +00:00
|
|
|
- include-markdown # For the CLI reference
|
2023-08-18 23:43:20 +00:00
|
|
|
- search
|
|
|
|
- redirects:
|
|
|
|
redirect_maps:
|
|
|
|
|
|
|
|
# Not all of these may be necessary, especially since the material
|
|
|
|
# theme substitutes for some of them
|
|
|
|
markdown_extensions:
|
|
|
|
- toc:
|
|
|
|
permalink: true
|
|
|
|
- extra
|
|
|
|
- sane_lists
|
|
|
|
- admonition
|
|
|
|
- codehilite:
|
|
|
|
guess_lang: false
|
2023-11-02 05:26:07 +00:00
|
|
|
# Allows list items with several paragraphs to be indented two spaces instead
|
|
|
|
# of four (like GitHub markdown)
|
|
|
|
- mdx_truly_sane_lists:
|
|
|
|
# No, thanks, we'd like only somewhat sane lists :)
|
|
|
|
# With `truly_sane: true`, together with breakless lists, it often splits
|
|
|
|
# a single list in two.
|
|
|
|
truly_sane: false
|
|
|
|
# Fixes weird concatenation of list items that happens sometimes when
|
|
|
|
# there is not a paragraph break between them and one of them has
|
|
|
|
# multiple paragraphs.
|
|
|
|
- mdx_breakless_lists
|
2023-08-18 23:43:20 +00:00
|
|
|
- pymdownx.tabbed:
|
|
|
|
alternate_style: true
|
2023-11-22 15:10:40 +00:00
|
|
|
- pymdownx.superfences:
|
|
|
|
custom_fences:
|
|
|
|
- name: mermaid
|
|
|
|
class: mermaid
|
|
|
|
format: !!python/name:pymdownx.superfences.fence_code_format
|
2023-08-18 23:43:20 +00:00
|
|
|
- pymdownx.details
|
|
|
|
- pymdownx.snippets
|
|
|
|
- pymdownx.emoji:
|
2023-11-02 05:45:46 +00:00
|
|
|
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
|
|
|
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
2023-08-18 23:43:20 +00:00
|
|
|
|
|
|
|
# This lists all the files that become part of the documentation
|
|
|
|
nav:
|
2023-10-04 01:20:04 +00:00
|
|
|
- 'Home': 'index.md'
|
|
|
|
|
2023-08-18 23:43:20 +00:00
|
|
|
- 'Getting started':
|
|
|
|
- 'Installation and Setup': 'install-and-setup.md'
|
|
|
|
- 'Tutorial and Birds-Eye View': 'tutorial.md'
|
2023-08-28 17:30:33 +00:00
|
|
|
- 'Working with GitHub': 'github.md'
|
2024-01-27 19:56:36 +00:00
|
|
|
- 'Working on Windows': 'windows.md'
|
2023-08-18 23:43:20 +00:00
|
|
|
|
|
|
|
- FAQ: 'FAQ.md'
|
|
|
|
|
docs: store output of `jj util markdown-help`, render it on the website
I am using a very hacky approach, using `insta` to generate the markdown help.
This is based on a lucky coincidence that `insta` chose to use a header
format for snapshot files that MkDocs interprets as a Markdown header (and
ignores).
I considered several other approaches, but I couldn't resist the facts that:
- This doesn't require new developers to install any extra tools or run any
extra commands.
- There is no need for a new CI check.
- There is no need to compile `jj` in the "Make HTML docs" GitHub action,
which is currently very fast and cheap.
Downside: I'm not sure how well MkDocs will work on Windows, unless the
developer explicitly enables symbolic links (which IIUC is not trivial).
### Possible alternatives
My next favorite approaches (which we could switch to later) would be:
#### `xtask`
Set up a CI check and a [Cargo `xtask`] so that `cargo xtask cli-help-to-md`
essentially runs `cargo run -- util markdown-help > docs/cli-reference.md` from
the project root.
Every developer would have to know to run `cargo xtask cli-help-to-md` if
they change the help text.
Eventually, we could have `cargo xtask preflight` that runs `cargo +nightly
fmt; cargo xtask cli-help-to-md; cargo nextest run`, or `cargo insta`.
#### Only generate markdown for CLI help when building the website, don't track it in Git.
I think that having the file in the repo will be nice to preview changes to
docs, and it'll allow people to consult the file on GitHub or in their repo.
The (currently) very fast job of building the website would now require
installing Rust and building `jj`.
#### Same as the `xtask`, but use a shell script instead of an `xtask`
An `xtask` might seem like overkill, since it's Rust instead of a shell script.
However, I don't want this to be a shell script so that new contributors on
Windows can still easily run it ( since this will be necessary for the CI to
pass) without us having to support a batch file.
#### Cargo Alias
My first attempt was to set up a [cargo alias] to run this, but that doesn't
support redirection (so I had to change the `jj util` command to output to a
file) and, worse, is incapable of executing the command *in the project root*
regardless of where in the project the current directory is. Again, this seems
to be too inconvenient for a command that every new PR author would have to run
to pass CI.
Overall, this just seems a bit ugly. I did file
https://github.com/rust-lang/cargo/issues/13348, I'm not really sure that was
worthwhile, though.
**Aside:** For reference, the alias was:
```toml
# .cargo/config.toml
alias.gen-cli-reference = "run -p jj-cli -- util markdown-help docs/cli-reference.md"
```
### Non-alternatives
#### Clap's new feature
`clap` recently obtained a similarly-sounding feature in
https://github.com/clap-rs/clap/pull/5206. However, it only prints short help
for subcommands and can't be triggered by an option AFAICT, so it won't help us
too much.
[Cargo `xtask`]: https://github.com/matklad/cargo-xtask
[cargo alias]: https://doc.rust-lang.org/cargo/reference/config.html#alias
2024-01-28 03:31:27 +00:00
|
|
|
- "CLI Reference": 'cli-reference.md'
|
|
|
|
|
2024-02-09 18:36:19 +00:00
|
|
|
- Testimonials: 'testimonials.md'
|
|
|
|
|
2023-08-18 23:43:20 +00:00
|
|
|
- Concepts:
|
|
|
|
- 'Working Copy': 'working-copy.md'
|
|
|
|
- 'Branches': 'branches.md'
|
|
|
|
- 'Conflicts': 'conflicts.md'
|
|
|
|
- 'Operation Log': 'operation-log.md'
|
|
|
|
- 'Glossary': 'glossary.md'
|
|
|
|
|
|
|
|
- 'Configuration':
|
|
|
|
- 'Settings': 'config.md'
|
2024-04-05 12:39:59 +00:00
|
|
|
- 'Fileset language': 'filesets.md'
|
2023-08-18 23:43:20 +00:00
|
|
|
- 'Revset language': 'revsets.md'
|
|
|
|
- 'Templating language': 'templates.md'
|
|
|
|
|
|
|
|
- 'Comparisons':
|
|
|
|
- 'Git comparison': 'git-comparison.md'
|
|
|
|
- 'Git compatibility': 'git-compatibility.md'
|
|
|
|
- 'Sapling': 'sapling-comparison.md'
|
|
|
|
- 'Other related work': 'related-work.md'
|
|
|
|
|
|
|
|
- 'Technical details':
|
|
|
|
- 'Architecture': 'technical/architecture.md'
|
|
|
|
- 'Concurrency': 'technical/concurrency.md'
|
|
|
|
- 'Conflicts': 'technical/conflicts.md'
|
|
|
|
|
|
|
|
- Contributing:
|
|
|
|
- 'Guidelines and "How to...?"': 'contributing.md'
|
|
|
|
- 'Code of conduct': 'code-of-conduct.md'
|
|
|
|
|
|
|
|
- 'Design docs':
|
|
|
|
- 'git-submodules': 'design/git-submodules.md'
|
|
|
|
- 'git-submodule-storage': 'design/git-submodule-storage.md'
|
2023-09-05 22:49:59 +00:00
|
|
|
- 'JJ run': 'design/run.md'
|
2024-01-23 17:53:07 +00:00
|
|
|
- 'Sparse Patterns v2': 'design/sparse-v2.md'
|
2023-08-18 23:43:20 +00:00
|
|
|
- 'Tracking branches': 'design/tracking-branches.md'
|
|
|
|
|
|
|
|
|