Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ src/Example.mad
.DS_Store
.coverage
.tests
.vscode
25 changes: 25 additions & 0 deletions FIXTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@

###### are needed

List of stuff:
* spades
* hearts
* clubs
* diamonds

List of stuff in order:
1. January
1. February
1. March
1. April
1. May
1. June
1. July
1. August
1. September
1. October
1. November
1. December

Impossibly *charming* and _sophisticated_. **Delightfully** jejeune. How __droll__.

```javascript
Expand All @@ -31,3 +51,8 @@ more more more more text
[link](//madlib.biz)

And another thing…

[[internal links are magical]]

Sometimes you want an [[internal link|with different display text]]
Other times you have text before [[an internal link]]
14 changes: 14 additions & 0 deletions YAML_FIXTURE.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Madlib
year: 2020
functional: true
imperative: # this is an empty field
contributors:
- Brekk
- Arnaud
link: "[[Installation]]"
links:
- "[[The Fence]]"
- "[[Comments]]"
effort: 4.5
start: 2020-08-27
starttime: 2020-08-27T08:00:00
2 changes: 1 addition & 1 deletion madlib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "MadMarkdownParser",
"version": "0.0.6",
"madlibVersion": "0.23.14",
"main": "src/Main.mad",
"main": "src/MadMarkdownParser.mad",
"importAliases": {
".": "src"
},
Expand Down
15 changes: 15 additions & 0 deletions src/Combinators.mad
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Parser } from "Parse"

import { apL } from "Applicative"
import { identity } from "Function"
import { mapL } from "Functor"
import { lookAhead, manyTill } from "Parse"



between :: Parser a -> Parser b -> Parser c -> Parser b
export between = (start, mid, end) => pipe(
mapL(identity),
ap($, mid),
apL($, end),
)(start)
30 changes: 30 additions & 0 deletions src/Link.mad
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import P from "Parse"
import String from "String"



// https://stackoverflow.com/questions/1547899/which-characters-make-a-url-invalid
linkCharacter :: P.Parser Char
export linkCharacter = P.choice([
P.letter,
P.digit,
P.char('!'),
P.char('#'),
P.char('$'),
P.char('%'),
P.char('&'),
P.char('\''),
P.char('*'),
P.char('+'),
P.char(','),
P.char('-'),
P.char('.'),
P.char('/'),
P.char(':'),
P.char(';'),
P.char('='),
P.char('?'),
P.char('@'),
P.char('_'),
P.char('~'),
])
Loading