Skip to content

Commit 00f4899

Browse files
committed
adoc to mdbook
adoc to mdbook ignore built book base manual, iconv/pandoc outputs (tmp) use top level .gitignore introduction put images here quickstart placeholder installation sections add troubleshooting configuration static docs, dynamic next security non cargo privacy editor features communication license remove links and old chapter move contributing to this guide contributing images local .gitignore intermediate files, no longer needed ignore generated files increase toc heading to include 3s move generated config docs to markdown disable playground play in rust sections move generated assist docs to markdown link from adoc to md relocate assist generated file move generated diagnostic docs to markdown move feature docs to markdown ignore generated, keep directory ignore generated remove old docs remove docs/user more ignore shenanigans fix lsp-extensions path again
1 parent 6ba2590 commit 00f4899

File tree

128 files changed

+1667
-2341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1667
-2341
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ crates/*/target
77
*.log
88
*.iml
99
.vscode/settings.json
10-
generated_assists.adoc
11-
generated_features.adoc
12-
generated_diagnostic.adoc
1310
.DS_Store
1411
/out/
1512
/dump.lsif

crates/ide-assists/src/handlers/auto_import.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
3838
// use super::AssistContext;
3939
// ```
4040
//
41-
// .Import Granularity
41+
// #### Import Granularity
4242
//
4343
// It is possible to configure how use-trees are merged with the `imports.granularity.group` setting.
4444
// It has the following configurations:
@@ -52,7 +52,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
5252
//
5353
// In `VS Code` the configuration for this is `rust-analyzer.imports.granularity.group`.
5454
//
55-
// .Import Prefix
55+
// #### Import Prefix
5656
//
5757
// The style of imports in the same crate is configurable through the `imports.prefix` setting.
5858
// It has the following configurations:
@@ -66,7 +66,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
6666
//
6767
// In `VS Code` the configuration for this is `rust-analyzer.imports.prefix`.
6868
//
69-
// image::https://user-images.githubusercontent.com/48062697/113020673-b85be580-917a-11eb-9022-59585f35d4f8.gif[]
69+
// ![Auto Import](/img/features/auto_import.gif)
7070

7171
// Assist: auto_import
7272
//

crates/ide-assists/src/tests/sourcegen.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ r#####"
5555
"sourcegen_assists_docs",
5656
assists.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n"),
5757
);
58-
let dst = project_root().join("docs/user/generated_assists.adoc");
58+
let dst = project_root().join("docs/manual/generated/assists.md");
5959
fs::write(dst, contents).unwrap();
6060
}
6161
}
@@ -139,7 +139,7 @@ impl fmt::Display for Assist {
139139
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
140140
let _ = writeln!(
141141
f,
142-
"[discrete]\n=== `{}`
142+
"### {}\n\n
143143
**Source:** {}",
144144
self.id, self.location,
145145
);
@@ -150,13 +150,15 @@ impl fmt::Display for Assist {
150150
let _ = writeln!(
151151
f,
152152
"
153-
{}
153+
> {}
154+
155+
#### Before
154156
155-
.Before
156157
```rust
157158
{}```
158159
159-
.After
160+
#### After
161+
160162
```rust
161163
{}```",
162164
section.doc,

crates/ide-completion/src/completions/flyimport.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,27 @@ use super::Completions;
8383
// NOTE: currently, if an assoc item comes from a trait that's not currently imported, and it also has an unresolved and/or partially-qualified path,
8484
// no imports will be proposed.
8585
//
86-
// .Fuzzy search details
86+
// #### Fuzzy search details
8787
//
8888
// To avoid an excessive amount of the results returned, completion input is checked for inclusion in the names only
8989
// (i.e. in `HashMap` in the `std::collections::HashMap` path).
9090
// For the same reasons, avoids searching for any path imports for inputs with their length less than 2 symbols
9191
// (but shows all associated items for any input length).
9292
//
93-
// .Import configuration
93+
// #### Import configuration
9494
//
9595
// It is possible to configure how use-trees are merged with the `imports.granularity.group` setting.
9696
// Mimics the corresponding behavior of the `Auto Import` feature.
9797
//
98-
// .LSP and performance implications
98+
// #### LSP and performance implications
9999
//
100100
// The feature is enabled only if the LSP client supports LSP protocol version 3.16+ and reports the `additionalTextEdits`
101101
// (case-sensitive) resolve client capability in its client capabilities.
102102
// This way the server is able to defer the costly computations, doing them for a selected completion item only.
103103
// For clients with no such support, all edits have to be calculated on the completion request, including the fuzzy search completion ones,
104104
// which might be slow ergo the feature is automatically disabled.
105105
//
106-
// .Feature toggle
106+
// #### Feature toggle
107107
//
108108
// The feature can be forcefully turned off in the settings with the `rust-analyzer.completion.autoimport.enable` flag.
109109
// Note that having this flag set to `true` does not guarantee that the feature is enabled: your client needs to have the corresponding

crates/ide-completion/src/completions/postfix/format_like.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// ** `logw` -> `log::warn!(...)`
1515
// ** `loge` -> `log::error!(...)`
1616
//
17-
// image::https://user-images.githubusercontent.com/48062697/113020656-b560f500-917a-11eb-87de-02991f61beb8.gif[]
17+
// ![Format String Completion](/img/features/format_string_completion.gif)
1818

1919
use ide_db::{
2020
syntax_helpers::format_string_exprs::{parse_format_exprs, with_placeholders},

crates/ide-completion/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ pub use crate::{
7272
//
7373
// There also snippet completions:
7474
//
75-
// .Expressions
75+
// #### Expressions
7676
// - `pd` -> `eprintln!(" = {:?}", );`
7777
// - `ppd` -> `eprintln!(" = {:#?}", );`
7878
//
79-
// .Items
79+
// #### Items
8080
// - `tfn` -> `#[test] fn feature(){}`
8181
// - `tmod` ->
8282
// ```rust
@@ -93,7 +93,7 @@ pub use crate::{
9393
// Those are the additional completion options with automatic `use` import and options from all project importable items,
9494
// fuzzy matched against the completion input.
9595
//
96-
// image::https://user-images.githubusercontent.com/48062697/113020667-b72ab880-917a-11eb-8778-716cf26a0eb3.gif[]
96+
// ![Magic Completions](/img/features/magic_completions.gif)
9797

9898
/// Main entry point for completion. We run completion as a two-phase process.
9999
///

crates/ide-completion/src/snippet.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
//
99
// A custom snippet can be defined by adding it to the `rust-analyzer.completion.snippets.custom` object respectively.
1010
//
11-
// [source,json]
12-
// ----
11+
// ```json
1312
// {
1413
// "rust-analyzer.completion.snippets.custom": {
1514
// "thread spawn": {
@@ -25,7 +24,7 @@
2524
// }
2625
// }
2726
// }
28-
// ----
27+
// ```
2928
//
3029
// In the example above:
3130
//
@@ -55,8 +54,8 @@
5554
//
5655
// For the VSCode editor, rust-analyzer also ships with a small set of defaults which can be removed
5756
// by overwriting the settings object mentioned above, the defaults are:
58-
// [source,json]
59-
// ----
57+
//
58+
// ```json
6059
// {
6160
// "Arc::new": {
6261
// "postfix": "arc",
@@ -98,7 +97,7 @@
9897
// "scope": "expr"
9998
// }
10099
// }
101-
// ----
100+
// ```
102101

103102
use ide_db::imports::import_assets::LocatedImport;
104103
use itertools::Itertools;

crates/ide-db/src/apply_change.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ impl RootDatabase {
4444
//
4545
// Clears rust-analyzer's internal database and prints memory usage statistics.
4646
//
47-
// |===
48-
// | Editor | Action Name
47+
// | Editor | Action Name |
48+
// |--------|--------------|
49+
// | VS Code | **rust-analyzer: Memory Usage (Clears Database)** |
4950
//
50-
// | VS Code | **rust-analyzer: Memory Usage (Clears Database)**
51-
// |===
52-
// image::https://user-images.githubusercontent.com/48062697/113065592-08559f00-91b1-11eb-8c96-64b88068ec02.gif[]
51+
// ![Memory Usage](/img/features/memory_usage.gif)
5352
pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes, usize)> {
5453
let mut acc: Vec<(String, Bytes, usize)> = vec![];
5554

crates/ide-db/src/symbol_index.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,9 @@ impl<DB> std::ops::Deref for Snap<DB> {
184184
// the filtering via the `rust-analyzer.workspace.symbol.search.scope` and
185185
// `rust-analyzer.workspace.symbol.search.kind` settings.
186186
//
187-
// |===
188-
// | Editor | Shortcut
189-
//
190-
// | VS Code | kbd:[Ctrl+T]
191-
// |===
187+
// | Editor | Shortcut |
188+
// |---------|----------|
189+
// | VS Code | <kbd>Ctrl+T</kbd>
192190
pub fn world_symbols(db: &RootDatabase, query: Query) -> Vec<FileSymbol> {
193191
let _p = profile::span("world_symbols").detail(|| query.query.clone());
194192

crates/ide-diagnostics/src/tests/sourcegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn sourcegen_diagnostic_docs() {
1010
let contents =
1111
diagnostics.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n");
1212
let contents = sourcegen::add_preamble("sourcegen_diagnostic_docs", contents);
13-
let dst = project_root().join("docs/user/generated_diagnostic.adoc");
13+
let dst = project_root().join("docs/manual/generated/diagnostic.md");
1414
fs::write(dst, contents).unwrap();
1515
}
1616

@@ -68,6 +68,6 @@ fn is_valid_diagnostic_name(diagnostic: &str) -> Result<(), String> {
6868

6969
impl fmt::Display for Diagnostic {
7070
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
71-
writeln!(f, "=== {}\n**Source:** {}\n{}", self.id, self.location, self.doc)
71+
writeln!(f, "### {}\n\n**Source:** {}\n\n{}\n\n", self.id, self.location, self.doc)
7272
}
7373
}

0 commit comments

Comments
 (0)