SGML

Markdown Entity Examples

entity-expansion1 entity-expansion2
Basic entity expansion example
entity-expansion3
External entity example
single-line-entity-preexpansion1 single-line-entity-preexpansion2 single-line-entity-preexpansion3 single-line-entity-preexpansion4
Entity references on a line of their own get markdown syntax replaced into HTML
Note: To produce HTML from the example markdown sources, copy and paste an example source, store it into a file with the ".md" file extension, and invoke
sgmlproc <your-file.md>
where <your-file.md> is replaced by the actual file used for storing.

entity-expansion1

<!DOCTYPE html [
  <!ENTITY uvar "user variable">
  <!ELEMENT html O O ANY>
]>

This tests basic expansion of an &uvar;.

Rendered HTML

<p>This tests basic expansion of an user variable.
</p>

entity-expansion2

<!DOCTYPE html [
  <!ENTITY uvar "<em>variable containing markup</em>">
  <!ELEMENT html O O ANY>
]>

This tests expansion of an &uvar;, where we expect markdown.awk to preserve
inline HTML in the expansion.

Rendered HTML

<p>This tests expansion of an <em>variable containing markup</em>, where we expect markdown.awk to preserve
inline HTML in the expansion.
</p>

entity-expansion3

<!DOCTYPE html [
  <!ENTITY uvar SYSTEM "entity-expansion3-external-entity.txt">
  <!ELEMENT html O O ANY>
]>

This tests expansion of an entity: &uvar; where we expect markdown.awk to
replace it with the contents of the file entity-expansion3-external-entity.txt,

Rendered HTML

<p>This tests expansion of an entity: To be imported into entity-expansion3 output where we expect markdown.awk to
replace it with the contents of the file entity-expansion3-external-entity.txt,
</p>

single-line-entity-preexpansion1

<!DOCTYPE html [
  <!ELEMENT html O O ANY>
  <!ENTITY e "*with markdown syntax converted to html*"> 
]>

Test that a single entity reference on a line of it's own gets expanded:

&e

Rendered HTML

<p>Test that a single entity reference on a line of it's own gets expanded:
</p><p><em>with markdown syntax converted to html</em>
</p>

single-line-entity-preexpansion2

<!DOCTYPE html [
  <!ELEMENT html O O ANY>
  <!ENTITY % e SYSTEM "single-line-entity-preexpansion2.ent">
  <!ENTITY e "%e">
]>

Test that a single entity reference on a line of it's own gets expanded:

&e

This is regular text following the entity reference.

Rendered HTML

<p>Test that a single entity reference on a line of it's own gets expanded:
</p><p><em>with markdown syntax converted to html</em>
</p><ul><li><p>and containing <em>multiple</em> lines with block-level markdown syntax
</p></li><li>to check if this is formatted as a list
</li></ul><p>This is regular text following the entity reference.
</p>

single-line-entity-preexpansion3

<!DOCTYPE html [
  <!ELEMENT html O O ANY>
  <!ENTITY e SYSTEM "single-line-entity-preexpansion3.ent">
]>

Test that a single entity reference on a line of it's own gets expanded:

&e

This is regular text following the entity reference.

Rendered HTML

<p>Test that a single entity reference on a line of it's own gets expanded:
</p><p><em>with markdown syntax converted to html</em>
</p><ul><li><p>and containing <em>multiple</em> lines with block-level markdown syntax
</p></li><li>to check if this is formatted as a list
</li></ul><p>This is regular text following the entity reference.
</p>

single-line-entity-preexpansion4

<!DOCTYPE html [
  <!ELEMENT html O O ANY>
  <!ENTITY e SYSTEM>
]>

Test that a single entity reference on a line of it's own gets expanded:

&e

This is regular text following the entity reference.

Rendered HTML

<p>Test that a single entity reference on a line of it's own gets expanded:
</p><p><em>with markdown syntax converted to html</em>
</p><ul><li><p>and containing <em>multiple</em> lines with block-level markdown syntax
</p></li><li>to check if this is formatted as a list
</li></ul><p>This is regular text following the entity reference.
</p>