Skip to content

Commit

Permalink
Apply some suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Silvan Mosberger <github@infinisil.com>
  • Loading branch information
hsjobeki and infinisil committed Feb 25, 2024
1 parent 629f1f7 commit c0eafe0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 45 deletions.
3 changes: 1 addition & 2 deletions doc/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ If arguments require more complex documentation consider starting an extra secti
# Arguments
## **x**
## **x** (Any)
(...Some comprehensive documentation)
*/
Expand Down
6 changes: 3 additions & 3 deletions src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ pub fn handle_indentation(raw: &str) -> Option<String> {
///
pub fn shift_headings(raw: &str, levels: usize) -> String {
let mut result = String::new();
for line in raw.lines() {
for line in raw.split_inclusive("\n") {
if line.trim_start().starts_with('#') {
result.push_str(&format!("{}\n", &handle_heading(line, levels)));
result.push_str(&handle_heading(line, levels));
} else {
result.push_str(&format!("{line}\n"));
result.push_str(&line);
}
}
result
Expand Down
3 changes: 0 additions & 3 deletions src/snapshots/nixdoc__test__doc_comment.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ This is a parsed example

doc comment in markdown format


## `lib.debug.argumentTest` {#function-library-lib.debug.argumentTest}

doc comment in markdown format
Expand All @@ -33,7 +32,6 @@ Type: (Should NOT be a heading)

This is just markdown


structured function argument

: `formal1`
Expand All @@ -60,4 +58,3 @@ structured function argument
Comment



37 changes: 0 additions & 37 deletions test.nix

This file was deleted.

0 comments on commit c0eafe0

Please sign in to comment.