mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Merge pull request #5537 from lukewilliamboswell/docs
Various updates for docs generation
This commit is contained in:
commit
ab3ef04ab7
2 changed files with 27 additions and 9 deletions
|
@ -934,10 +934,10 @@ fn markdown_to_html(
|
||||||
|
|
||||||
for event in parser {
|
for event in parser {
|
||||||
match event {
|
match event {
|
||||||
Event::Code(cow_str) => {
|
Event::Code(code_str) => {
|
||||||
let highlighted_html =
|
let inline_code =
|
||||||
roc_highlight::highlight_roc_code_inline(cow_str.to_string().as_str());
|
pulldown_cmark::CowStr::from(format!("<code>{}</code>", code_str));
|
||||||
docs_parser.push(Event::Html(CowStr::from(highlighted_html)));
|
docs_parser.push(pulldown_cmark::Event::Html(inline_code));
|
||||||
}
|
}
|
||||||
Event::End(Link(LinkType::ShortcutUnknown, ref _url, ref _title)) => {
|
Event::End(Link(LinkType::ShortcutUnknown, ref _url, ref _title)) => {
|
||||||
// Replace the preceding Text node with a Code node, so it
|
// Replace the preceding Text node with a Code node, so it
|
||||||
|
@ -954,17 +954,17 @@ fn markdown_to_html(
|
||||||
|
|
||||||
docs_parser.push(event);
|
docs_parser.push(event);
|
||||||
}
|
}
|
||||||
Event::Start(CodeBlock(CodeBlockKind::Fenced(cow_str))) => {
|
Event::Start(CodeBlock(CodeBlockKind::Fenced(code_str))) => {
|
||||||
in_code_block = Some(cow_str);
|
in_code_block = Some(code_str);
|
||||||
}
|
}
|
||||||
Event::End(CodeBlock(_)) => {
|
Event::End(CodeBlock(_)) => {
|
||||||
match in_code_block {
|
match in_code_block {
|
||||||
Some(cow_str) => {
|
Some(code_str) => {
|
||||||
if cow_str.contains("unchecked") {
|
if code_str.contains("unchecked") {
|
||||||
// TODO HANDLE UNCHECKED
|
// TODO HANDLE UNCHECKED
|
||||||
}
|
}
|
||||||
|
|
||||||
if cow_str.contains("repl") {
|
if code_str.contains("repl") {
|
||||||
// TODO HANDLE REPL
|
// TODO HANDLE REPL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,6 +189,24 @@ section {
|
||||||
margin: 72px 0px;
|
margin: 72px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
section blockquote {
|
||||||
|
font-style: italic;
|
||||||
|
position: relative;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
section blockquote:before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 2px;
|
||||||
|
height: 100%;
|
||||||
|
background-color: var(--gray);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
section > *:last-child {
|
section > *:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue