aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/format/markdown.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/data/format/markdown.lux22
1 files changed, 15 insertions, 7 deletions
diff --git a/stdlib/source/library/lux/data/format/markdown.lux b/stdlib/source/library/lux/data/format/markdown.lux
index 08b26a686..281425105 100644
--- a/stdlib/source/library/lux/data/format/markdown.lux
+++ b/stdlib/source/library/lux/data/format/markdown.lux
@@ -52,7 +52,7 @@
(template [<name> <prefix>]
[(def: .public (<name> content)
- (-> Text Markdown)
+ (-> Text (Markdown Block))
(:abstraction (format <prefix> " " (..safe content) ..blank_line)))]
[heading/1 "#"]
@@ -110,10 +110,14 @@
(Markdown Block))
(|>> list.enumeration
(list\map (function (_ [idx [summary detail]])
- (format (%.nat (inc idx)) ". " (:representation summary) text.new_line
+ (format "1. " (:representation summary)
(case detail
(#.Some detail)
- (|> detail :representation ..indent (text.enclosed [text.new_line text.new_line]))
+ (|> detail
+ :representation
+ ..indent
+ (text.enclosed [text.new_line text.new_line])
+ (format text.new_line))
#.None
""))))
@@ -124,10 +128,14 @@
(-> (List [(Markdown Span) (Maybe (Markdown Block))])
(Markdown Block))
(|>> (list\map (function (_ [summary detail])
- (format "*. " (:representation summary) text.new_line
+ (format "* " (:representation summary)
(case detail
(#.Some detail)
- (|> detail :representation ..indent (text.enclosed [text.new_line text.new_line]))
+ (|> detail
+ :representation
+ ..indent
+ (text.enclosed [text.new_line text.new_line])
+ (format text.new_line))
#.None
""))))
@@ -137,7 +145,7 @@
(def: .public snippet
{#.doc "A snippet of code."}
(-> Text (Markdown Span))
- (|>> ..safe (text.enclosed ["`" "`"]) :abstraction))
+ (|>> (text.enclosed ["`` " " ``"]) :abstraction))
(def: .public code
{#.doc "A block of code."}
@@ -180,6 +188,6 @@
)
(def: .public markdown
- (-> (Markdown Any) Text)
+ (All [a] (-> (Markdown a) Text))
(|>> :representation))
)