mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Aliases now rendered in docs
This commit is contained in:
parent
1320930a73
commit
1df89ccbbe
3 changed files with 15 additions and 4 deletions
|
@ -111,12 +111,16 @@ fn generate_module_doc<'a>(
|
||||||
},
|
},
|
||||||
|
|
||||||
Alias {
|
Alias {
|
||||||
name: _,
|
name,
|
||||||
vars: _,
|
vars: _,
|
||||||
ann: _,
|
ann: _,
|
||||||
} =>
|
} => {
|
||||||
// TODO
|
let entry = DocEntry {
|
||||||
{
|
name: name.value.to_string(),
|
||||||
|
docs: before_comments_or_new_lines.and_then(comments_or_new_lines_to_docs),
|
||||||
|
};
|
||||||
|
acc.push(entry);
|
||||||
|
|
||||||
(acc, None)
|
(acc, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
3
docs/tests/fixtures/Interface.roc
vendored
3
docs/tests/fixtures/Interface.roc
vendored
|
@ -2,6 +2,9 @@ interface Test
|
||||||
exposes [ singleline, multiline, multiparagraph, codeblock ]
|
exposes [ singleline, multiline, multiparagraph, codeblock ]
|
||||||
imports []
|
imports []
|
||||||
|
|
||||||
|
## This is a block
|
||||||
|
Block : [ @Block ]
|
||||||
|
|
||||||
## Single line documentation.
|
## Single line documentation.
|
||||||
singleline : Bool -> Bool
|
singleline : Bool -> Bool
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@ mod test_docs {
|
||||||
};
|
};
|
||||||
|
|
||||||
let expected_entries = vec![
|
let expected_entries = vec![
|
||||||
|
ModuleEntry {
|
||||||
|
name: "Block".to_string(),
|
||||||
|
docs: "<p>This is a block</p>\n".to_string(),
|
||||||
|
},
|
||||||
ModuleEntry {
|
ModuleEntry {
|
||||||
name: "singleline".to_string(),
|
name: "singleline".to_string(),
|
||||||
docs: "<p>Single line documentation.</p>\n".to_string(),
|
docs: "<p>Single line documentation.</p>\n".to_string(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue