Skip to content

Commit 0051528

Browse files
author
Martin Brecht-Precht
committed
Added some more examples.
1 parent 04e49b7 commit 0051528

File tree

2 files changed

+177
-0
lines changed

2 files changed

+177
-0
lines changed

example/commonmark-03.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Markdom\Test;
4+
5+
use Markdom\Dispatcher\CommonmarkDispatcher;
6+
use Markdom\Dispatcher\JsonDispatcher;
7+
use Markdom\Handler\CommonmarkHandler;
8+
9+
require_once(__DIR__ . '/../vendor/autoload.php');
10+
11+
$handler = new CommonmarkHandler();
12+
$dispatcher = new JsonDispatcher(file_get_contents(__DIR__ . '/example-data.json'));
13+
$dispatcher->dispatchTo($handler);
14+
fwrite(STDOUT, $handler->getResult());

example/example-data-full.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# some markdown
2+
3+
## some markdown
4+
5+
### some markdown
6+
7+
<!--
8+
Etiam porta sem malesuada magna mollis euismod.
9+
wich is multiline
10+
-->
11+
12+
<!-- Etiam porta sem malesuada magna mollis euismod. -->
13+
14+
#### some markdown
15+
16+
##### some markdown
17+
18+
###### some markdown
19+
20+
in markdown süntax
21+
a simple para-graph can
22+
span more than one line
23+
24+
this *is* a not so simple **paragraph** with different kinds of `emphasises` ``​`​``, ~~an obolete section~~, and even *nested **[emphasises](http://google.de "Link to Google")***
25+
26+
![alt text](test.png "Title")
27+
28+
### non-trivial nested list
29+
30+
*
31+
1.
32+
item number one, subitem one. **an introduction**
33+
this one covers more than one line
34+
in fact, it covers three lines
35+
36+
*
37+
item number one, subitem one, subsubitem one. the 1st paragraph
38+
this one covers more than one line
39+
in fact, it covers three lines
40+
41+
> item number one, subitem one, subsubitem one. the 2st paragraph
42+
> this one covers more than one line
43+
> in fact, it covers three lines
44+
*
45+
item number one, subitem one, subsubitem two. the 1st paragraph
46+
this one covers more than one line
47+
in fact, it covers three lines
48+
49+
```
50+
item number one, subitem one, subsubitem two. the 2nd paragraph
51+
this one covers more than one line
52+
in fact, it covers three lines
53+
```
54+
55+
> item number one, subitem one. **some final words**
56+
> this one covers more than one line
57+
> in fact, it covers three lines
58+
2.
59+
item number one, subitem two. **an introduction**
60+
this one covers more than one line
61+
in fact, it covers three lines
62+
63+
*
64+
item number one, subitem two, subsubitem one. the 1st paragraph
65+
this one covers more than one line
66+
in fact, it covers three lines
67+
68+
> item number one, subitem two, subsubitem one. the 2nd paragraphthis one covers more than one line
69+
*
70+
item number one, subitem two, subsubitem two. the 1st paragraph
71+
this one covers more than one line
72+
in fact, it covers three lines
73+
74+
```
75+
item number one, subitem two, subsubitem two. the 2nd paragraph
76+
this one covers more than one line
77+
```
78+
79+
> item number one, subitem two.**some final words**
80+
> this one covers more than one line
81+
> in fact, it covers three lines
82+
*
83+
> item number two. **an introduction**
84+
> this one covers more than one line
85+
>
86+
> *
87+
> item number two, subitem one. the 1st paragraph
88+
> this one covers more than one line
89+
>
90+
> > item number two, subitem one. the 2nd paragraph
91+
> > this one covers more than one line
92+
> *
93+
> item number two, subitem two. the 1st paragraph
94+
> this one covers more than one line
95+
>
96+
> ```
97+
> item number two, subitem two. the 2nd paragraph
98+
> this one covers more than one line
99+
> ```
100+
>
101+
> > item number two. **some final words**
102+
> > this one covers more than two line
103+
104+
### HTML Block
105+
106+
<p>Test</p>
107+
108+
### blocks in a quote block
109+
110+
> #### heading block in quote block
111+
>
112+
> paragraph block in quote block using some <span style="color:red;">CSS</span> in inline HTML
113+
>
114+
> ```hint
115+
> code block in quote block
116+
> ```
117+
>
118+
> ---
119+
>
120+
> 1.
121+
> list block in quote block
122+
>
123+
> > quote block in quote block
124+
125+
### blocks in list items
126+
127+
*
128+
#### heading block in list item
129+
*
130+
paragraph block in list item
131+
132+
second paragraph block in a single list item
133+
*
134+
```hint
135+
code block in list item
136+
```
137+
*
138+
---
139+
*
140+
1.
141+
list block in list item
142+
*
143+
> quote block in list item
144+
145+
### an empty quote
146+
147+
>
148+
149+
### an empty list
150+
151+
### some empty list items
152+
153+
25240.
154+
>
155+
25241.
156+
####
157+
25242.
158+
159+
25243.
160+
161+
162+
this is the end my friend
163+
this is the änd my friend

0 commit comments

Comments
 (0)