aboutsummaryrefslogtreecommitdiffstats
path: root/docs/gen/layout.moon
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-06-12 13:29:59 +0000
committers-ol <s+removethis@s-ol.nu>2025-06-12 13:35:43 +0000
commita668ad6c7523c010b129d9c21fdf90830bcbf77b (patch)
tree2d06e4c429dc12e6577ee01fe992a7f41d2bab8d /docs/gen/layout.moon
parentline comments (diff)
downloadalive-a668ad6c7523c010b129d9c21fdf90830bcbf77b.tar.gz
alive-a668ad6c7523c010b129d9c21fdf90830bcbf77b.zip
use cmark instead of discount for markdown docs
Diffstat (limited to 'docs/gen/layout.moon')
-rw-r--r--docs/gen/layout.moon9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/gen/layout.moon b/docs/gen/layout.moon
index 895baaa..93a7851 100644
--- a/docs/gen/layout.moon
+++ b/docs/gen/layout.moon
@@ -1,8 +1,12 @@
version = require 'alv.version'
dom = require 'docs.gen.dom'
-import compile from require 'discount'
+cmark = require 'cmark'
import opairs from require 'alv.util'
+compile = (md) ->
+ doc = cmark.parse_string md, cmark.OPT_DEFAULT
+ cmark.render_html doc, cmark.OPT_DEFAULT + cmark.OPT_UNSAFE
+
render_meta = (meta) ->
import p, code from dom
contents = {}
@@ -12,7 +16,7 @@ render_meta = (meta) ->
table.insert contents, examples
if meta.description
description = compile meta.description\match '^\n*(.+)\n*$'
- table.insert contents, description.body
+ table.insert contents, description
contents
@@ -215,6 +219,7 @@ layout = (opts) ->
{
+ :compile
:autoref
:render
:layout