Skip to content

Commit

Permalink
Update syntax tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ReMinoer authored and Rémi Morillon committed Aug 7, 2019
1 parent c05de5e commit 8cdcfe8
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 64 deletions.
17 changes: 16 additions & 1 deletion doc.dh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
@[[https://github.com/ReMinoer/Dash/blob/master/doc.dh]]
@[[https://github.com/ReMinoer/Dast]]

<-> Identity

- Identity

This language is called Dash. It's a markup language to write structured documents with a good plain-text feel.

Expand All @@ -48,6 +49,7 @@

Majuscule extensions are also tolerated.


<-> Paragraphs

<< .dash-+ >>
Expand All @@ -62,6 +64,7 @@
< Design note >
Come back to the line in the same paragraph is handled in the language because it's a common plain text formatting.


<-> Lists

You can list items by using {-} at the beginning of lines.
Expand Down Expand Up @@ -157,6 +160,7 @@

<...>


<-> Titles

To add a title, use {<->} at the beginning of the line.
Expand All @@ -175,6 +179,7 @@

<...>


<-> Blocks

You can also define structural blocks for highlight some paragraphs. For that, you must add a header before the paragraph, like so: {< Type >}
Expand Down Expand Up @@ -209,6 +214,7 @@
< Design note >
In fact, titles are blocks. Because there are very common, they have there own syntax, combining lists and blocks syntax.


<-> Emphasis

The language handle the four most famous emphasis :
Expand Down Expand Up @@ -238,6 +244,7 @@

<...>


<-> Links

You can put external links in your note by using {[content][adress]}.
Expand All @@ -256,6 +263,7 @@

<...>


<-> Targets

You can define internal target at a specific position in your document with {@[identifier]}.
Expand Down Expand Up @@ -295,6 +303,7 @@
< Design note >
You can also use [ and ] as text if needed.


<-> Notes

You can write a note on a line beginning by a target with a number or without identifier.
Expand All @@ -319,6 +328,7 @@

<...>


<-> Media

If you want to insert a media (like a picture, a video or a table) or some text written in another language (like a code sample), you must use {{ ... }}.
Expand Down Expand Up @@ -390,16 +400,19 @@

<...>


<--> Images

< .dh-+ > { < .jpg > { http://www.gstatic.com/webp/gallery/1.jpg } }
< .dh-+ > { < .png > { https://www.gstatic.com/webp/gallery3/1.png } }


<--> Videos

< .dh-+ > { < .mp4 > { http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4 } }
< .dh-+ > { < .youtube.com > { hqW4qLcRD3w } }


<--> Tables

<< .dash-+ >>
Expand All @@ -412,6 +425,7 @@
<...>
<...>


<--> Code

<< .dash-+ >>
Expand All @@ -423,6 +437,7 @@
<...>
<...>


<-> Comments

You can use comments by using {~~} at the beginning of a line.
Expand Down
139 changes: 76 additions & 63 deletions test-syntax.dh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,89 @@
- Performance issue with complex lists
- Rewrite code snippets and examples
- Ideas / Needs
.- More emphasizing titles
- More emphasizing titles
o- Simplier notes ({[text]*, [other text]**})
.- Simplier link variants
o- Simplier link variants
x- Bold as default emphasis {[bold text]}
o- Definition {-[word]:[definition]}
.- Better emphasis tokens
.- Emphasis blocks (standard block already handled)
- Better emphasis tokens
- Emphasis blocks (standard block already handled)
o- See if {$} can be remove of the language
.- Sections / Sub-documents {<[ Section ]>}
.- Block syntax
.- Target condition {<!>[sample]}
.- Other standard blocks
.- Patterns
- Sections / Sub-documents {<[ Section ]>}
- Block syntax
- Target condition {<!>[sample]}
- Other standard blocks
- Patterns
###

- Title 1
- Title 2
- Title 3
- Title 3
- Title 2
- Title 3
- Title 3
- Title 1
- Title 2
- Title 3
- Title 3
- Title 2
- Title 3
- Title 3

__Title 1__

__Title 2__
<=> Document Title
<=> Sub-title

<-> Title 1

<--> Title 1

<--> Title 2

<---> Title 3
<---> Title 3
<--> Title 2
<---> Title 3
<---> Title 3
<-> Title 1
<--> Title 2
<--> Title 2
<--> Title 2

# Title 1
## Title 2
### Title 3
### Tile 3
### Title 3
## Title 2
### Title 3
### Title 3
# Title 1
## Title 2
## Title 2
## Title 2

- Title 1

-- Title 2

--- Title 3

--- Title 3

-- Title 2

--- Title 3

--- Title 3
- Title 1
-- Title 2
-- Title 2
-- Title 2


<-> Title 1

Alios autem dicere aiunt multo etiam inhumanius (quem locum breviter paulo ante perstrinxi) praesidii adiumentique causa, non benevolentiae neque caritatis, amicitias esse expetendas; itaque, ut quisque minimum firmitatis haberet minimumque virium, ita amicitias appetere maxime; ex eo fieri ut mulierculae magis amicitiarum praesidia quaerant quam viri et inopes quam opulenti et calamitosi quam ii qui putentur beati.


<--> Title 2

Cumque pertinacius ut legum gnarus accusatorem flagitaret atque sollemnia, doctus id Caesar libertatemque superbiam ratus tamquam obtrectatorem audacem excarnificari praecepit, qui ita evisceratus ut cruciatibus membra deessent, inplorans caelo iustitiam, torvum renidens fundato pectore mansit inmobilis nec se incusare nec quemquam alium passus et tandem nec confessus nec confutatus cum abiecto consorte poenali est morte multatus. et ducebatur intrepidus temporum iniquitati insultans, imitatus Zenonem illum veterem Stoicum qui ut mentiretur quaedam laceratus diutius, avulsam sedibus linguam suam cum cruento sputamine in oculos interrogantis Cyprii regis inpegit.


<--> Title 2

In his tractibus navigerum nusquam visitur flumen sed in locis plurimis aquae suapte natura calentes emergunt ad usus aptae multiplicium medelarum. verum has quoque regiones pari sorte Pompeius Iudaeis domitis et Hierosolymis captis in provinciae speciem delata iuris dictione formavit.


<---> Title 3

Hac ita persuasione reducti intra moenia bellatores obseratis undique portarum aditibus, propugnaculis insistebant et pinnis, congesta undique saxa telaque habentes in promptu, ut si quis se proripuisset interius, multitudine missilium sterneretur et lapidum.

Sin autem ad adulescentiam perduxissent, dirimi tamen interdum contentione vel uxoriae condicionis vel commodi alicuius, quod idem adipisci uterque non posset. Quod si qui longius in amicitia provecti essent, tamen saepe labefactari, si in honoris contentionem incidissent; pestem enim nullam maiorem esse amicitiis quam in plerisque pecuniae cupiditatem, in optimis quibusque honoris certamen et gloriae; ex quo inimicitias maximas saepe inter amicissimos exstitisse.

> Title 1
>> Title 2
>> Title 2
>>> Title 3
>>> Title 3
>>> Title 3
>> Title 2
> Title 1

I'm a [text]* with [notes]** and *[bold] words.
You can also use [ids]3 or redirect to [links]2.

2 : [www.google.fr]>
3 : Note about ids
* : *[Note] about text
2: [www.google.fr]>
3: Note about ids
*: *[Note] about text
**: [www.twitter.com]>

The rest of the article can be read at this adress: [www.journalist.com/article/super_news]>.
Expand All @@ -101,34 +103,45 @@ Et [un]1, et [deux]2, et [trois]3, et [quatre]4, et [cinq]5, et [six]6, et [sept

*[Bold]
/[Italic]
+[Mark]
"[Quote]
=[Mark]
#[Obsolete]
[Link]>
[Note]*
[Note]1

*[[Bold note]*]
[*[Bold note]]*

<*> Bold text
</> Italic text
<+> Marked text
<#> Obsolete text
"[*[Bold quote]]

<-> This block is a title.
<*> This block is really important.
</> This block is important.
<"> This block is a quote.
<=> This block is relevant in the context.
<#> This block is outdated.

## Comment

###
Multi-line comment
###

[Word]: Definition
[Second word]:
Other definition

- Firts item
- Second item
- Third item

*- Firts item
*- Second item
*- Third item
1- Firts item
2- Second item
3- Third item

- Undetermined
x- Checked

.- Undetermined
- Undetermined
o- Checked

- Undetermined
o- Validated
x- Refused
x- Refused

0 comments on commit 8cdcfe8

Please sign in to comment.