From 65380b2cd56592ee7545b878293d366ba5314b54 Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Sat, 10 Jun 2023 14:59:34 +1000 Subject: [PATCH 1/2] remove docs syntax highlighting for inline snippets --- crates/docs/src/lib.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/docs/src/lib.rs b/crates/docs/src/lib.rs index 654411925f..756c23a7af 100644 --- a/crates/docs/src/lib.rs +++ b/crates/docs/src/lib.rs @@ -934,10 +934,10 @@ fn markdown_to_html( for event in parser { match event { - Event::Code(cow_str) => { - let highlighted_html = - roc_highlight::highlight_roc_code_inline(cow_str.to_string().as_str()); - docs_parser.push(Event::Html(CowStr::from(highlighted_html))); + Event::Code(code_str) => { + let inline_code = + pulldown_cmark::CowStr::from(format!("{}", code_str)); + docs_parser.push(pulldown_cmark::Event::Html(inline_code)); } Event::End(Link(LinkType::ShortcutUnknown, ref _url, ref _title)) => { // Replace the preceding Text node with a Code node, so it @@ -954,17 +954,17 @@ fn markdown_to_html( docs_parser.push(event); } - Event::Start(CodeBlock(CodeBlockKind::Fenced(cow_str))) => { - in_code_block = Some(cow_str); + Event::Start(CodeBlock(CodeBlockKind::Fenced(code_str))) => { + in_code_block = Some(code_str); } Event::End(CodeBlock(_)) => { match in_code_block { - Some(cow_str) => { - if cow_str.contains("unchecked") { + Some(code_str) => { + if code_str.contains("unchecked") { // TODO HANDLE UNCHECKED } - if cow_str.contains("repl") { + if code_str.contains("repl") { // TODO HANDLE REPL } From 1f1e57a7a5a540979649dd925a92fa0c317c9bde Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Sun, 11 Jun 2023 10:35:23 +1000 Subject: [PATCH 2/2] add docs stlying for blockquotes --- crates/docs/src/static/styles.css | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/docs/src/static/styles.css b/crates/docs/src/static/styles.css index 6ac5b388cd..b2fc3fb812 100644 --- a/crates/docs/src/static/styles.css +++ b/crates/docs/src/static/styles.css @@ -189,6 +189,24 @@ section { 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 { margin-bottom: 0; }