Test Headings
This commit is contained in:
parent
85ead54619
commit
68928aeb20
5 changed files with 76 additions and 0 deletions
16
test/djot-to-html/003-headings/Main.idr
Normal file
16
test/djot-to-html/003-headings/Main.idr
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
module Main
|
||||||
|
|
||||||
|
import SSG.Djot
|
||||||
|
import SSG.HTML
|
||||||
|
|
||||||
|
import System
|
||||||
|
import System.File
|
||||||
|
|
||||||
|
main : IO ()
|
||||||
|
main = do
|
||||||
|
Right contents <- readFile "test.dj"
|
||||||
|
| Left err => do
|
||||||
|
printLn err
|
||||||
|
exitFailure
|
||||||
|
let parsed = djot contents
|
||||||
|
putStr . render . renderHtml $ parsed
|
19
test/djot-to-html/003-headings/expected
Normal file
19
test/djot-to-html/003-headings/expected
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang=en>
|
||||||
|
<body>
|
||||||
|
<h1>Level 1 Heading</h1>
|
||||||
|
<h2>Level 2 Heading</h2>
|
||||||
|
<h3>Level 3 Heading</h3>
|
||||||
|
<h4>Level 4 Heading</h4>
|
||||||
|
<h5>Level 5 Heading</h5>
|
||||||
|
<h6>Level 6 Heading</h6>
|
||||||
|
<p>####### Level 7 Not a Heading</p>
|
||||||
|
<h1>A heading that spans multiple lines</h1>
|
||||||
|
<h1>Heading</h1>
|
||||||
|
<p>Some content</p>
|
||||||
|
<h2>A sub heading</h2>
|
||||||
|
<p>Even more content</p>
|
||||||
|
<h1>Back up</h1>
|
||||||
|
<p>Some final content</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
6
test/djot-to-html/003-headings/run
Normal file
6
test/djot-to-html/003-headings/run
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
rm -rf build/
|
||||||
|
|
||||||
|
flock "$1" pack -q install-deps test.ipkg
|
||||||
|
pack -q run test.ipkg
|
||||||
|
|
||||||
|
rm -rf build/
|
28
test/djot-to-html/003-headings/test.dj
Normal file
28
test/djot-to-html/003-headings/test.dj
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Level 1 Heading
|
||||||
|
|
||||||
|
## Level 2 Heading
|
||||||
|
|
||||||
|
### Level 3 Heading
|
||||||
|
|
||||||
|
#### Level 4 Heading
|
||||||
|
|
||||||
|
##### Level 5 Heading
|
||||||
|
|
||||||
|
###### Level 6 Heading
|
||||||
|
|
||||||
|
####### Level 7 Not a Heading
|
||||||
|
|
||||||
|
# A heading that
|
||||||
|
spans multiple lines
|
||||||
|
|
||||||
|
# Heading
|
||||||
|
|
||||||
|
Some content
|
||||||
|
|
||||||
|
## A sub heading
|
||||||
|
|
||||||
|
Even more content
|
||||||
|
|
||||||
|
# Back up
|
||||||
|
|
||||||
|
Some final content
|
7
test/djot-to-html/003-headings/test.ipkg
Normal file
7
test/djot-to-html/003-headings/test.ipkg
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package a-test
|
||||||
|
|
||||||
|
depends = SSG
|
||||||
|
|
||||||
|
main = Main
|
||||||
|
|
||||||
|
executable = test
|
Loading…
Add table
Reference in a new issue