Skip to content

Commit

Permalink
docs CLI reference: add a warning that it is experimental
Browse files Browse the repository at this point in the history
There are many minor bugs that are difficult to fix in the short-term.

See also the commit message for a197409
  • Loading branch information
ilyagr committed Feb 4, 2024
1 parent 96efc12 commit 64fa847
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
source: cli/tests/test_generate_md_cli_help.rs
description: "AUTO-GENERATED FILE, DO NOT EDIT. This cli reference is generated as an `insta` snapshot. MkDocs follows they symlink from docs/cli-reference.md to the snap. Unfortunately, `insta` unavoidably creates this header. Luckily, MkDocs ignores the header since it has the same format as Markdown headers. TODO: MkDocs may fail on Windows if symlinks are not enabled in the OS settings"
---

!!! warning

This CLI reference is experimental. It is automatically generated, but
does not match the `jj help` output exactly.

<!-- See also https://github.com/ConnorGray/clap-markdown/issues -->

# Command-Line Help for `jj`

This document contains the help content for the `jj` command-line program.
Expand Down
14 changes: 13 additions & 1 deletion cli/tests/test_generate_md_cli_help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@ use crate::common::TestEnvironment;

pub mod common;

const PREAMBLE: &str = r#"
!!! warning
This CLI reference is experimental. It is automatically generated, but
does not match the `jj help` output exactly.
<!-- See also https://github.com/ConnorGray/clap-markdown/issues -->
"#;

#[test]
fn test_generate_markdown_docs_in_docs_dir() {
let test_env = TestEnvironment::default();
let markdown_help = test_env.jj_cmd_success(test_env.env_root(), &["util", "markdown-help"]);
let mut markdown_help = PREAMBLE.to_string();
markdown_help
.push_str(&test_env.jj_cmd_success(test_env.env_root(), &["util", "markdown-help"]));
// Validate partial snapshot, redacting any lines nested 2+ indent levels.
insta::with_settings!({
snapshot_path => ".",
Expand Down

0 comments on commit 64fa847

Please sign in to comment.