mirror of
https://github.com/The1Penguin/org-to-mafiauniverse.git
synced 2024-11-24 10:58:12 +00:00
Added example, drops until first empty line, todo list
Drops the usually headers of the document until there is a empty line
This commit is contained in:
parent
96180d8ffc
commit
2cd0d66bb3
@ -14,3 +14,7 @@ The name is pronounced like autumn.
|
||||
| - | [*] | Needs a [LIST] around all |
|
||||
| [[]] | [IMG][/IMG] or [VIDEO][/VIDEO] or [URL="link"][/URL] | Figure out what type of link it is |
|
||||
| #+BEGIN #+END | [SPOILER][/SPOILER] | |
|
||||
|
||||
* Todo [0/2]
|
||||
- [ ] Image or Video parser
|
||||
- [ ] Properly support normal links
|
||||
|
@ -56,7 +56,7 @@ parseHelper parser x = case parse parser "" x of
|
||||
Right text -> text
|
||||
|
||||
parseFile :: String -> Post
|
||||
parseFile = Post . reduce . map (parseHelper fileParser) . lines
|
||||
parseFile = Post . reduce . map (parseHelper fileParser) . dropWhile (/= "") . lines
|
||||
|
||||
fileParser :: Parser Info
|
||||
fileParser =
|
||||
@ -70,8 +70,8 @@ fileParser =
|
||||
Image . URL <$> between (string' "[[") (string' "]]") (takeWhileP Nothing (/= ']')),
|
||||
Video . URL <$> between (string' "[[") (string' "]]") (takeWhileP Nothing (/= ']')),
|
||||
-- parseLink,
|
||||
Spoiler . (: []) . Bread <$> (string' "+BEGIN" >> return ""),
|
||||
Spoiler . (: []) . Bread <$> (string' "+END" >> return ""),
|
||||
Spoiler . (: []) . Bread <$> (string' "#+BEGIN" >> return ""),
|
||||
Spoiler . (: []) . Bread <$> (string' "#+END" >> return ""),
|
||||
Bread <$> takeRest
|
||||
]
|
||||
|
||||
|
9
example text.org
Normal file
9
example text.org
Normal file
@ -0,0 +1,9 @@
|
||||
#+title: Example Text
|
||||
|
||||
* Hello there
|
||||
- Zeus has been scummy
|
||||
- Wisdom is just flopping around
|
||||
|
||||
#+Begin
|
||||
[[https://media.discordapp.net/attachments/866979075360555033/1019126077542629436/Tumblr_l_204100096696723.jpg]]
|
||||
#+end
|
Loading…
Reference in New Issue
Block a user