Additional Information, that will only be shown on demand.
use anyhow::Result; use asciidoctrine::{self, *}; use clap::Parser; use pretty_assertions::assert_eq; use std::io::BufWriter; #[test] fn bullet_list_with_dashes() -> Result<()> { let content = r#" - This - is - a - list -- with subpoints --- and deeper ---- nested subpoints - Next normal point "#; let reader = AsciidocReader::new(); let opts = options::Opts::parse_from(vec!["asciidoctrine", "--template", "-"]); let mut env = util::Env::Cache(util::Cache::new()); let ast = reader.parse(content, &opts, &mut env)?; let mut buf = BufWriter::new(Vec::new()); let mut writer = HtmlWriter::new(); writer.write(ast, &opts, &mut buf)?; let output = String::from_utf8(buf.into_inner()?)?; assert_eq!( output, r#"
This
is
a
list
with subpoints
and deeper
nested subpoints
Next normal point
This
is
a
list
with subpoints
and deeper
nested subpoints
Next normal point
Additional Information, that will only be shown on demand.
This Information is visible by default.
Here inline markup text is rendered specially But paragraphs * or ** Lists ** are not handled as such |
In this cell markup text is handeled specially We can even have multiple paragraphs
|
Some text is bold.
"# ); Ok(()) } #[test] fn inline_italic() -> Result<()> { let content = r#" Some text is _italic_. "#; let reader = AsciidocReader::new(); let opts = options::Opts::parse_from(vec!["asciidoctrine", "--template", "-"]); let mut env = util::Env::Cache(util::Cache::new()); let ast = reader.parse(content, &opts, &mut env)?; let mut buf = BufWriter::new(Vec::new()); let mut writer = HtmlWriter::new(); writer.write(ast, &opts, &mut buf)?; let output = String::from_utf8(buf.into_inner()?)?; assert_eq!( output, r#"Some text is italic.
"# ); Ok(()) } #[test] fn inline_monospaced() -> Result<()> { let content = r#" Some text is `monospaced`. "#; let reader = AsciidocReader::new(); let opts = options::Opts::parse_from(vec!["asciidoctrine", "--template", "-"]); let mut env = util::Env::Cache(util::Cache::new()); let ast = reader.parse(content, &opts, &mut env)?; let mut buf = BufWriter::new(Vec::new()); let mut writer = HtmlWriter::new(); writer.write(ast, &opts, &mut buf)?; let output = String::from_utf8(buf.into_inner()?)?; assert_eq!( output, r#"Some text is monospaced
.
This
is
a
nested
numbered list
Col1 |
Col2 |
Cel1 |
Cel2 |
Cel3 |
Cel4 |
echo "hello world!"
echo "hello world!"