use somedoc::model::Document; use somedoc::write::OutputFormat; pub mod common; const COMMON_PREAMBLE: &str = r###" "###; #[inline] fn assert_html_eq(part_fn: impl Fn() -> Document, expected: &str, preamble_included: bool) { common::assert_serialized_eq( &part_fn(), OutputFormat::Html, &format!( "{}{}", if preamble_included { "" } else { COMMON_PREAMBLE }, expected ), ) } #[test] fn test_skos() { assert_html_eq( common::skos::document, r###" Scheme: Clothing shapes, patterns, and details

Scheme: Clothing shapes, patterns, and details

Terms commonly used to describe fashion items. It includes terms for outline, fit, elements, detailing, and patterns.

Labels

skos:prefLabel

skos:altLabel

Other labels
Label textLanguage
Clothing shapes, patterns, and detailsen

Other Properties


Jump to: Concepts Hierarchy | Concepts | Collections | Appendix - RDF


Concept Hierarchy

Appendix - RDF

      @prefix foo: <...>
foo:bar foo:baz 12.
      
    
@prefix foo: <...>
foo:bar foo:baz 12.
    
"###, true, ); } #[test] fn test_empty_document() { assert_html_eq( common::parts::empty_document, r###" "###, false, ); } #[test] fn test_document_with_title() { assert_html_eq( common::parts::document_with_title, r###" Test Document "###, true, ); } #[test] fn test_document_with_heading() { assert_html_eq( common::parts::document_with_heading, r###"

Test Document

"###, false, ); } #[test] fn test_document_with_labeled_heading() { assert_html_eq( common::parts::document_with_labeled_heading, r###"

Test Document

"###, false, ); } #[test] fn test_document_with_headings() { assert_html_eq( common::parts::document_with_headings, r###"

Section

Sub-section

Sub-sub-section

Sub-sub-sub-section

Sub-sub-sub-sub-section
Sub-sub-sub-sub-sub-section
Sub-sub-sub-sub-sub-sub-section "###, false, ); } #[test] fn test_paragraph_alignment() { assert_html_eq( common::parts::paragraph_alignment, r###"

left-aligned

right-aligned

center-aligned

both-aligned

"###, false, ); } #[test] fn test_document_with_front_matter() { assert_html_eq( common::parts::document_with_front_matter, r###"

Section One

Section Two

"###, false, ); } #[test] fn test_unordered_list() { assert_html_eq( common::parts::unordered_list, r###" "###, false, ); } #[test] fn test_ordered_list() { assert_html_eq( common::parts::ordered_list, r###"
  1. one
  2. two
  3. three
"###, false, ); } #[test] fn test_labeled_ordered_list() { assert_html_eq( common::parts::labeled_ordered_list, r###"
  1. one
  2. two
  3. three
"###, false, ); } #[test] fn test_nested_unordered_list() { assert_html_eq( common::parts::nested_unordered_list, r###" "###, false, ); } #[test] fn test_nested_ordered_list() { assert_html_eq( common::parts::nested_ordered_list, r###"
  1. one
  2. two
    1. inner one
    2. inner two
  3. three
"###, false, ); } #[test] fn test_nested_mixed_lists() { assert_html_eq( common::parts::nested_mixed_lists, r###" "###, false, ); } #[test] fn test_definition_list() { assert_html_eq( common::parts::definition_list, r###"
Universe
Big, really big
"###, false, ); } #[test] fn test_image_block() { assert_html_eq( common::parts::image_block, r###"
"###, false, ); } #[test] fn test_image_block_with_label_and_caption() { assert_html_eq( common::parts::image_block_with_label_and_caption, r###"
"###, false, ); } #[test] fn test_math_block() { assert_html_eq( common::parts::math_block, r###"
\[ x=2+2^2 \]
"###, false, ); } #[test] fn test_math_block_with_label_and_caption() { assert_html_eq( common::parts::math_block_with_label_and_caption, r###"
\[ x=2+2^2 \]
"###, false, ); } #[test] fn test_block_quote() { assert_html_eq( common::parts::block_quote, r###"

a block quote

"###, false, ); } #[test] fn test_nested_block_quotes() { assert_html_eq( common::parts::nested_block_quotes, r###"

a block quote

another block quote

"###, false, ); } #[test] fn test_text_styles() { assert_html_eq( common::parts::text_styles, r###"

Here is some plain bold italic mono code plain strikethrough underline small caps superscript subscript text.

"###, false, ); } #[test] fn test_nested_text_styles() { assert_html_eq( common::parts::nested_text_styles, r###"

Here is some bold italic text.

Here is some bold italic plain text.

Here is some bold plain italic text.

"###, false, ); } #[test] fn test_hyper_links() { assert_html_eq( common::parts::hyper_links, r###"

example

example

"###, false, ); } #[test] fn test_complex_paragraph() { assert_html_eq( common::parts::complex_paragraph, r###"

This paragraph has a link, some math: \( x=2+2^2 \), a line break,
an image:  —  all together!

"###, false, ); }