From fb6bc2d7de7e13b945bcb9482cb27e5a75dccef0 Mon Sep 17 00:00:00 2001 From: Niklas Fasching Date: Tue, 11 Dec 2018 14:43:44 +0100 Subject: [PATCH] Split example.org into separate files ... hopefully correctly This will hopefully improve ease of developing (more granular test results) and prepares us for adding example org->html renders for gh-pages --- org/testdata/blocks.html | 21 ++ org/testdata/blocks.org | 21 ++ org/testdata/captions.html | 23 ++ org/testdata/captions.org | 13 + org/testdata/example.html | 466 ----------------------------------- org/testdata/example.org | 196 --------------- org/testdata/footnotes.html | 110 +++++++++ org/testdata/footnotes.org | 28 +++ org/testdata/headlines.html | 7 + org/testdata/headlines.org | 5 + org/testdata/inline.html | 109 ++++++++ org/testdata/inline.org | 28 +++ org/testdata/lists.html | 78 ++++++ org/testdata/lists.org | 20 ++ org/testdata/misc.html | 97 ++++++++ org/testdata/misc.org | 51 ++++ org/testdata/paragraphs.html | 14 ++ org/testdata/paragraphs.org | 11 + 18 files changed, 636 insertions(+), 662 deletions(-) create mode 100644 org/testdata/blocks.html create mode 100644 org/testdata/blocks.org create mode 100644 org/testdata/captions.html create mode 100644 org/testdata/captions.org delete mode 100644 org/testdata/example.html delete mode 100644 org/testdata/example.org create mode 100644 org/testdata/footnotes.html create mode 100644 org/testdata/footnotes.org create mode 100644 org/testdata/headlines.html create mode 100644 org/testdata/headlines.org create mode 100644 org/testdata/inline.html create mode 100644 org/testdata/inline.org create mode 100644 org/testdata/lists.html create mode 100644 org/testdata/lists.org create mode 100644 org/testdata/misc.html create mode 100644 org/testdata/misc.org create mode 100644 org/testdata/paragraphs.html create mode 100644 org/testdata/paragraphs.org diff --git a/org/testdata/blocks.html b/org/testdata/blocks.html new file mode 100644 index 0000000..c6bc188 --- /dev/null +++ b/org/testdata/blocks.html @@ -0,0 +1,21 @@ +
+
echo a bash source block
+

+block! +

+
+
a source block without a language
+and a second line
+and a third one
+
+an example block
+with multiple lines
+
+
+

+Mongodb is very webscale +

+

+and quote blocks can contain multiple paragraphs +

+
diff --git a/org/testdata/blocks.org b/org/testdata/blocks.org new file mode 100644 index 0000000..320fca2 --- /dev/null +++ b/org/testdata/blocks.org @@ -0,0 +1,21 @@ +#+CAPTION: block! +#+BEGIN_SRC bash +echo a bash source block +#+END_SRC + +#+BEGIN_SRC +a source block without a language +and a second line +and a third one +#+END_SRC + +#+BEGIN_EXAMPLE foo bar baz +an example block +with multiple lines +#+END_EXAMPLE + +#+BEGIN_QUOTE +Mongodb is very webscale + +and quote blocks can contain multiple paragraphs +#+END_QUOTE diff --git a/org/testdata/captions.html b/org/testdata/captions.html new file mode 100644 index 0000000..f4b068c --- /dev/null +++ b/org/testdata/captions.html @@ -0,0 +1,23 @@ +

+Anything can be captioned. Also captions are not real, correct captions but just a paragraph below the element (bothe wrapped into a div) +

+
+
echo "i have a caption!"
+

+captioned soure block +

+
+
+

+ +

+

+captioned link (video in this case) +

+
+

+note that only that one line is captioned, not the whole paragraph +

+

+also, normal text lines can't be captioned +

diff --git a/org/testdata/captions.org b/org/testdata/captions.org new file mode 100644 index 0000000..3822b29 --- /dev/null +++ b/org/testdata/captions.org @@ -0,0 +1,13 @@ +Anything can be captioned. Also captions are not real, correct captions but just a paragraph below the element (bothe wrapped into a div) + +#+CAPTION: captioned soure block +#+BEGIN_SRC sh +echo "i have a caption!" +#+END_SRC + +#+CAPTION: captioned link (video in this case) +[[my-video.mp4]] +note that only that one line is captioned, not the whole paragraph + +#+CAPTION: not happening! +also, normal text lines can't be captioned diff --git a/org/testdata/example.html b/org/testdata/example.html deleted file mode 100644 index 7159696..0000000 --- a/org/testdata/example.html +++ /dev/null @@ -1,466 +0,0 @@ -

Motivation

-

-To validate the parser we'll try printing the AST back to org-mode source - if that -works we can be kind of sure that the parsing worked. -At least I hope so - I would like to get around writing tests for the individual parsing -functions... -

-

Paragraphs

-

-Empty lines separate paragraphs. -

-

-Right? -

-

-They do! -

-

Headlines with TODO status, priority & tags

-

Headline with todo status & priority

-

Headline with TODO status

-

Headline with tags & priority

-

-this one is cheating a little as tags are ALWAYS printed right aligned to a given column number... -

-

Lists

- -

Inline

- -

Captions

-

-Anything can be captioned. Also captions are not real, correct captions but just a paragraph below the element (bothe wrapped into a div) -

-
-
echo "i have a caption!"
-

-captioned soure block -

-
-
-

- -

-

-captioned link (video in this case) -

-
-

-note that only that one line is captioned, not the whole paragraph -

-

-also, normal text lines can't be captioned -

-

blocks

-
-
echo a bash source block
-

-bleck! -

-
-
a source block without a language
-and a second line
-and a third one
-
-an example block
-with multiple lines
-
-
-

-Mongodb is very webscale -

-

-and quote blocks can contain multiple paragraphs -

-
-

issues from goorgeous (free test cases, yay!)

-

#29: Support verse block

-
-

-This -is -verse -

-
-
-

-or even a totally custom kind of block -crazy ain't it? -

-
-

#47: Consecutive code wrapped text gets joined

-

-either this or that foo. -either this -or that foo. -

-

#50: LineBreaks in lists are preserved

- -
    -
  1. -

    -same -goes -for -ordered -lists -

    -
  2. -
  3. -

    -foo -

    -
  4. -
-

#68: Quote block with inline markup

-
-

-this is markup! -

-
-

#77: Recognize code--- as code plus dash

-

#75: Not parsing nested lists correctly

- -

#78: Emphasis at beginning of line

-

-italics -

-

-Text -italics -

-

#82: Crash on empty headline

-

-

-just a space as title... -

-

#84: Paragraphs that are not followed by an empty line are not parsed correctly

-

Foo

-

-Foo paragraph. -

-

Bar

-

-Bar paragraph -

-

Footnotes

- -
-

Footnotes

-
-
-1 -
-

-https://www.example.com -

-
    -
  • -

    -footnotes can contain markup -

    -
  • -
  • -

    -and other elements -

    -
      -
    • -

      -like blocks -

      -
      other non-plain
      -
    • -
    • -

      -and tables -

      - - - - - - - - - - - - -
      1a
      2b
      3c
      -
    • -
    -
  • -
-
-
- -
-4 -
-

-another unused footnote -

-
-
-
-5 -
-

-another unused footnote -

-
-
-
-6 -
-

-Footnotes break after two consecutive empty lines - just like paragraphs - see https://orgmode.org/worg/dev/org-syntax.html. -This shouldn't happen when the definition line and the line after that are empty. -

-
-
-
-2 -
-

-the inline footnote definition -

-
-
-
-
diff --git a/org/testdata/example.org b/org/testdata/example.org deleted file mode 100644 index d4b4c10..0000000 --- a/org/testdata/example.org +++ /dev/null @@ -1,196 +0,0 @@ -#+TITLE: Example org mode file -#+AUTHOR: Niklas Fasching -#+DESCRIPTION: just some random elements with little explanation - -* Motivation - -To validate the parser we'll try printing the AST back to org-mode source - if that -works we can be kind of sure that the parsing worked. -At least I hope so - I would like to get around writing tests for the individual parsing -functions... - -** Paragraphs - -Empty lines separate paragraphs. - -Right? - -They do! - -** Headlines with TODO status, priority & tags -*** TODO [#B] Headline with todo status & priority -*** DONE Headline with TODO status -*** [#A] Headline with tags & priority :foo:bar: -this one is cheating a little as tags are ALWAYS printed right aligned to a given column number... -** Lists -- unordered list item 1 -- unordered list item 2 - with ~inline~ /markup/ - 1. ordered sublist item 1 - a) ordered sublist item 1 - b) ordered sublist item 2 - c) ordered sublist item 3 - 2. ordered sublist item 2 -- unordered list item 3 - and a [[https://example.com][link]] - and some lines of text - 1. and another subitem - #+BEGIN_SRC sh - echo with a block - #+END_SRC - 2. and another one with a table - | a | b | c | - |---+---+---| - | 1 | 2 | 3 | - - and text with an empty line in between as well! -- unordered list item 4 - -** Inline -- /emphasis/ and a hard line break \\ - see? -- /.emphasis with dot border chars./ -- /emphasis with a slash/inside/ -- /emphasis/ followed by raw text with slash / -- ->/not an emphasis/<- -- links with slashes do not become /emphasis/: [[https://somelinkshouldntrenderaccidentalemphasis.com]]/ /emphasis/ -- _underlined_ *bold* =verbatim= ~code~ +strikethrough+ -- *bold string with an *asterisk inside* -- =multiline emphasis is - supported - and respects MaxEmphasisNewLines (default: 1)= - /so this - is emphasized/ - - /but - this - is - not emphasized/ -- empty emphasis markers like ++ // __ and so on are ignored -- subscript_{sub} and superscript^{super} -- links - 1. regular link [[https://example.com]] link without description - 2. regular link [[https://example.com][example.com]] link with description - 3. regular link to a file (image) [[file:my-img.png]] - 4. regular link to a file (video) [[my-video.mp4]] - 5. regular link to http (image) [[http://www.example.com/my-img.png]] - 6. regular link to https (image) [[https://www.example.com/my-img.png]] - 7. auto link, i.e. not inside =\[[square brackets]\]= https://www.example.com - -** Captions - -Anything can be captioned. Also captions are not real, correct captions but just a paragraph below the element (bothe wrapped into a div) - -#+CAPTION: captioned soure block -#+BEGIN_SRC sh -echo "i have a caption!" -#+END_SRC - -#+CAPTION: captioned link (video in this case) -[[my-video.mp4]] -note that only that one line is captioned, not the whole paragraph - -#+CAPTION: not happening! -also, normal text lines can't be captioned - - -** blocks - -#+CAPTION: bleck! -#+BEGIN_SRC bash -echo a bash source block -#+END_SRC - -#+BEGIN_SRC -a source block without a language -and a second line -and a third one -#+END_SRC - -#+BEGIN_EXAMPLE foo bar baz -an example block -with multiple lines -#+END_EXAMPLE - -#+BEGIN_QUOTE -Mongodb is very webscale - -and quote blocks can contain multiple paragraphs -#+END_QUOTE - -** issues from goorgeous (free test cases, yay!) -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/29][#29:]] Support verse block -#+BEGIN_VERSE -This -*is* -verse -#+END_VERSE - -#+BEGIN_CUSTOM -or even a *totally* /custom/ kind of block -crazy ain't it? -#+END_CUSTOM -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/47][#47:]] Consecutive ~code~ wrapped text gets joined -either ~this~ or ~that~ foo. -either ~this~ -or ~that~ foo. -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/50][#50]]: LineBreaks in lists are preserved -- this list item - has - multiple - linbreaks - but it's still just one paragraph (i.e. no line breaks are rendered) -- foobar -1. same - goes - for - ordered - lists -2. foo -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/68][#68]]: Quote block with inline markup -#+BEGIN_QUOTE -[[https://www.example.com][/this/ *is* _markup_!]] -#+END_QUOTE - -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/77][#77]]: Recognize =code=--- as code plus dash -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/75][#75]]: Not parsing nested lists correctly -- bullet 1 - - sub bullet -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/78][#78]]: Emphasis at beginning of line -/italics/ - - -Text -/italics/ -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/82][#82]]: Crash on empty headline -**** -just a space as title... -*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/84][#84]]: Paragraphs that are not followed by an empty line are not parsed correctly -**** Foo -Foo paragraph. -**** Bar -Bar paragraph -** Footnotes -- normal footnote reference [fn:1] [fn:6] -- further references to the same footnote should not [fn:1] render duplicates in the footnote list -- inline footnotes are also supported via [fn:2:the inline footnote definition]. - -* Footnotes -[fn:1] https://www.example.com -- footnotes can contain *markup* -- and other elements - - like blocks - #+BEGIN_SRC - other non-plain - #+END_SRC - - and tables - | 1 | a | - | 2 | b | - | 3 | c | - -[fn:3] [[http://example.com/unused-footnote][example.com/unused-footnote]] - -[fn:4] another unused footnote - -[fn:5] another unused footnote - -[fn:6] - -Footnotes break after two consecutive empty lines - just like paragraphs - see https://orgmode.org/worg/dev/org-syntax.html. -This shouldn't happen when the definition line and the line after that are empty. diff --git a/org/testdata/footnotes.html b/org/testdata/footnotes.html new file mode 100644 index 0000000..e7991a9 --- /dev/null +++ b/org/testdata/footnotes.html @@ -0,0 +1,110 @@ +

Using some footnotes

+ +
+

Footnotes

+
+
+1 +
+

+https://www.example.com +

+
    +
  • +

    +footnotes can contain markup +

    +
  • +
  • +

    +and other elements +

    +
      +
    • +

      +like blocks +

      +
      other non-plain
      +
    • +
    • +

      +and tables +

      + + + + + + + + + + + + +
      1a
      2b
      3c
      +
    • +
    +
  • +
+
+
+ +
+4 +
+

+another unused footnote +

+
+
+
+5 +
+

+another unused footnote +

+
+
+
+6 +
+

+Footnotes break after two consecutive empty lines - just like paragraphs - see https://orgmode.org/worg/dev/org-syntax.html. +This shouldn't happen when the definition line and the line after that are empty. +

+
+
+
+2 +
+

+the inline footnote definition +

+
+
+
+
diff --git a/org/testdata/footnotes.org b/org/testdata/footnotes.org new file mode 100644 index 0000000..0730354 --- /dev/null +++ b/org/testdata/footnotes.org @@ -0,0 +1,28 @@ +* Using some footnotes +- normal footnote reference [fn:1] [fn:6] +- further references to the same footnote should not [fn:1] render duplicates in the footnote list +- inline footnotes are also supported via [fn:2:the inline footnote definition]. + +* Footnotes +[fn:1] https://www.example.com +- footnotes can contain *markup* +- and other elements + - like blocks + #+BEGIN_SRC + other non-plain + #+END_SRC + - and tables + | 1 | a | + | 2 | b | + | 3 | c | + +[fn:3] [[http://example.com/unused-footnote][example.com/unused-footnote]] + +[fn:4] another unused footnote + +[fn:5] another unused footnote + +[fn:6] + +Footnotes break after two consecutive empty lines - just like paragraphs - see https://orgmode.org/worg/dev/org-syntax.html. +This shouldn't happen when the definition line and the line after that are empty. diff --git a/org/testdata/headlines.html b/org/testdata/headlines.html new file mode 100644 index 0000000..0f4b575 --- /dev/null +++ b/org/testdata/headlines.html @@ -0,0 +1,7 @@ +

Simple Headline

+

Headline with todo status & priority

+

Headline with TODO status

+

Headline with tags & priority

+

+this one is cheating a little as tags are ALWAYS printed right aligned to a given column number... +

diff --git a/org/testdata/headlines.org b/org/testdata/headlines.org new file mode 100644 index 0000000..f94fca0 --- /dev/null +++ b/org/testdata/headlines.org @@ -0,0 +1,5 @@ +* Simple Headline +* TODO [#B] Headline with todo status & priority +* DONE Headline with TODO status +* [#A] Headline with tags & priority :foo:bar: +this one is cheating a little as tags are ALWAYS printed right aligned to a given column number... diff --git a/org/testdata/inline.html b/org/testdata/inline.html new file mode 100644 index 0000000..d0b73f3 --- /dev/null +++ b/org/testdata/inline.html @@ -0,0 +1,109 @@ + diff --git a/org/testdata/inline.org b/org/testdata/inline.org new file mode 100644 index 0000000..6984d68 --- /dev/null +++ b/org/testdata/inline.org @@ -0,0 +1,28 @@ +- /emphasis/ and a hard line break \\ + see? +- /.emphasis with dot border chars./ +- /emphasis with a slash/inside/ +- /emphasis/ followed by raw text with slash / +- ->/not an emphasis/<- +- links with slashes do not become /emphasis/: [[https://somelinkshouldntrenderaccidentalemphasis.com]]/ /emphasis/ +- _underlined_ *bold* =verbatim= ~code~ +strikethrough+ +- *bold string with an *asterisk inside* +- =multiline emphasis is + supported - and respects MaxEmphasisNewLines (default: 1)= + /so this + is emphasized/ + + /but + this + is + not emphasized/ +- empty emphasis markers like ++ // __ and so on are ignored +- subscript_{sub} and superscript^{super} +- links + 1. regular link [[https://example.com]] link without description + 2. regular link [[https://example.com][example.com]] link with description + 3. regular link to a file (image) [[file:my-img.png]] + 4. regular link to a file (video) [[my-video.mp4]] + 5. regular link to http (image) [[http://www.example.com/my-img.png]] + 6. regular link to https (image) [[https://www.example.com/my-img.png]] + 7. auto link, i.e. not inside =\[[square brackets]\]= https://www.example.com diff --git a/org/testdata/lists.html b/org/testdata/lists.html new file mode 100644 index 0000000..708a94d --- /dev/null +++ b/org/testdata/lists.html @@ -0,0 +1,78 @@ + diff --git a/org/testdata/lists.org b/org/testdata/lists.org new file mode 100644 index 0000000..54211db --- /dev/null +++ b/org/testdata/lists.org @@ -0,0 +1,20 @@ +- unordered list item 1 +- unordered list item 2 - with ~inline~ /markup/ + 1. ordered sublist item 1 + a) ordered sublist item 1 + b) ordered sublist item 2 + c) ordered sublist item 3 + 2. ordered sublist item 2 +- unordered list item 3 - and a [[https://example.com][link]] + and some lines of text + 1. and another subitem + #+BEGIN_SRC sh + echo with a block + #+END_SRC + 2. and another one with a table + | a | b | c | + |---+---+---| + | 1 | 2 | 3 | + + and text with an empty line in between as well! +- unordered list item 4 diff --git a/org/testdata/misc.html b/org/testdata/misc.html new file mode 100644 index 0000000..3e9ed0f --- /dev/null +++ b/org/testdata/misc.html @@ -0,0 +1,97 @@ +

issues from goorgeous (free test cases, yay!)

+

#29: Support verse block

+
+

+This +is +verse +

+
+
+

+or even a totally custom kind of block +crazy ain't it? +

+
+

#47: Consecutive code wrapped text gets joined

+

+either this or that foo. +either this +or that foo. +

+

#50: LineBreaks in lists are preserved

+ +
    +
  1. +

    +same +goes +for +ordered +lists +

    +
  2. +
  3. +

    +foo +

    +
  4. +
+

#68: Quote block with inline markup

+
+

+this is markup! +

+
+

#77: Recognize code--- as code plus dash

+

#75: Not parsing nested lists correctly

+ +

#78: Emphasis at beginning of line

+

+italics +

+

+Text +italics +

+

#82: Crash on empty headline

+

+

+just a space as title... +

+

#84: Paragraphs that are not followed by an empty line are not parsed correctly

+

Foo

+

+Foo paragraph. +

+

Bar

+

+Bar paragraph +

diff --git a/org/testdata/misc.org b/org/testdata/misc.org new file mode 100644 index 0000000..86ccfb6 --- /dev/null +++ b/org/testdata/misc.org @@ -0,0 +1,51 @@ +** issues from goorgeous (free test cases, yay!) +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/29][#29:]] Support verse block +#+BEGIN_VERSE +This +*is* +verse +#+END_VERSE + +#+BEGIN_CUSTOM +or even a *totally* /custom/ kind of block +crazy ain't it? +#+END_CUSTOM +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/47][#47:]] Consecutive ~code~ wrapped text gets joined +either ~this~ or ~that~ foo. +either ~this~ +or ~that~ foo. +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/50][#50]]: LineBreaks in lists are preserved +- this list item + has + multiple + linbreaks - but it's still just one paragraph (i.e. no line breaks are rendered) +- foobar +1. same + goes + for + ordered + lists +2. foo +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/68][#68]]: Quote block with inline markup +#+BEGIN_QUOTE +[[https://www.example.com][/this/ *is* _markup_!]] +#+END_QUOTE + +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/77][#77]]: Recognize =code=--- as code plus dash +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/75][#75]]: Not parsing nested lists correctly +- bullet 1 + - sub bullet +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/78][#78]]: Emphasis at beginning of line +/italics/ + + +Text +/italics/ +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/82][#82]]: Crash on empty headline +**** +just a space as title... +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/84][#84]]: Paragraphs that are not followed by an empty line are not parsed correctly +**** Foo +Foo paragraph. +**** Bar +Bar paragraph diff --git a/org/testdata/paragraphs.html b/org/testdata/paragraphs.html new file mode 100644 index 0000000..31921ef --- /dev/null +++ b/org/testdata/paragraphs.html @@ -0,0 +1,14 @@ +

+Paragraphs are the default element. +

+

+Empty lines and other elements end paragraphs - but paragraphs +can +obviously +span +multiple +lines. +

+

+Paragraphs can contain inline markup like emphasis strong and links example.com and stuff. +

diff --git a/org/testdata/paragraphs.org b/org/testdata/paragraphs.org new file mode 100644 index 0000000..cf0e6e0 --- /dev/null +++ b/org/testdata/paragraphs.org @@ -0,0 +1,11 @@ +Paragraphs are the default element. + +Empty lines and other elements end paragraphs - but paragraphs +can +obviously +span +multiple +lines. + +Paragraphs can contain inline markup like /emphasis/ *strong* and links [[https://www.example.com][example.com]] and stuff. +