Skip to content

Commit

Permalink
convert manual to mdbook
Browse files Browse the repository at this point in the history
manual.adoc to markdown

add entire static manual and toc

move generated adoc to md in book dir

add features

add features

add assists

add config

add diagnostics

split up book, clean up links

update book config

add intro

remove old docs, add a README

clean up ignores

add temporary workflow

temporary makefile

remove workflow

remove generated config.md

rework generated locations and ignores
  • Loading branch information
joshrotenberg committed Nov 12, 2023
1 parent 5acbfd4 commit e4e0df5
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ crates/*/target
/out/
/dump.lsif
.envrc
docs/book/book
docs/book/src/*/generated.md
2 changes: 1 addition & 1 deletion crates/ide-assists/src/tests/sourcegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ r#####"
"sourcegen_assists_docs",
assists.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n"),
);
let dst = project_root().join("docs/book/generated/assists.md");
let dst = project_root().join("docs/book/src/assists/generated.md");
fs::write(dst, contents).unwrap();
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ide-diagnostics/src/tests/sourcegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn sourcegen_diagnostic_docs() {
let contents =
diagnostics.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n");
let contents = sourcegen::add_preamble("sourcegen_diagnostic_docs", contents);
let dst = project_root().join("docs/book/generated/diagnostic.md");
let dst = project_root().join("docs/book/src/diagnostics/generated.md");
fs::write(dst, contents).unwrap();
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,7 @@ mod tests {

#[test]
fn generate_config_documentation() {
let docs_path = project_root().join("docs/book/generated/config.md");
let docs_path = project_root().join("docs/book/src/configuration/generated.md");
let expected = ConfigData::manual();
ensure_file_contents(&docs_path, &expected);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rust-analyzer/tests/slow-tests/sourcegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn sourcegen_feature_docs() {
",
contents.trim()
);
let dst = sourcegen::project_root().join("docs/book/generated/features.md");
let dst = sourcegen::project_root().join("docs/book/src/features/generated.md");
fs::write(dst, contents).unwrap();
}

Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/assists/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ particular context. They are usually triggered by a shortcut or by
clicking a light bulb icon in the editor. Cursor position or selection
is signified by `` character.

{{#include ../../generated/assists.md:2:}}
{{#include generated.md:2:}}
3 changes: 1 addition & 2 deletions docs/book/src/configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ config-related messages. Logs should show both the JSON that

This is the list of config options `rust-analyzer` supports:


{{#include ../../generated/config.md}}
{{#include generated.md}}
2 changes: 1 addition & 1 deletion docs/book/src/diagnostics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ can be turned off using the `rust-analyzer.diagnostics.enable`,
To run `cargo clippy` instead of `cargo check`, you can set
`"rust-analyzer.check.command": "clippy"`.

{{#include ../../generated/diagnostic.md:2:}}
{{#include generated.md:2:}}
3 changes: 1 addition & 2 deletions docs/book/src/features/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Features

{{#include ../../generated/features.md:3:}}

{{#include generated.md:3:}}

0 comments on commit e4e0df5

Please sign in to comment.