-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
use crate::html::r#type::render_type_def; | ||
use crate::html::util::*; | ||
|
||
pub fn render_type_alias(doc_node: &crate::DocNode) -> String { | ||
let type_alias_def = doc_node.type_alias_def.as_ref().unwrap(); | ||
|
||
let id = name_to_id("typeAlias", &doc_node.name); | ||
|
||
// TODO: tags, examples, TypeParamsDoc | ||
|
||
format!( | ||
r#"<div class="docBlockItems">{}</div>"#, | ||
section( | ||
"type", | ||
&doc_entry( | ||
&id, | ||
"definition", | ||
&format!(": {}", render_type_def(&type_alias_def.ts_type)), | ||
) | ||
) | ||
) | ||
} | ||
|
||
// TODO: classes: docBlockItems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
use crate::html::r#type::render_type_def; | ||
use crate::html::util::*; | ||
|
||
pub fn render_variable(doc_node: &crate::DocNode) -> String { | ||
let variable_def = doc_node.variable_def.as_ref().unwrap(); | ||
|
||
if variable_def.ts_type.is_none() { | ||
return String::new(); | ||
} | ||
|
||
let id = name_to_id("variable", &doc_node.name); | ||
|
||
// TODO: examples | ||
|
||
format!( | ||
r#"<div class="docBlockItems">{}</div>"#, | ||
section( | ||
"type", | ||
&doc_entry( | ||
&id, | ||
"", | ||
&render_type_def(variable_def.ts_type.as_ref().unwrap()) | ||
) | ||
) | ||
) | ||
} | ||
|
||
// TODO: classes: docBlockItems |