Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitb9c9916c071be1bdd5d855f652c6bc46c972a936 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-19 09:24:05 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-19 09:24:05 +0300
Files0c27c3b74e72c41f7c7368693bd71c90db77d869
syndamia.com-b9c9916c071be1bdd5d855f652c6bc46c972a936.tar
syndamia.com-b9c9916c071be1bdd5d855f652c6bc46c972a936.tar.gz
syndamia.com-b9c9916c071be1bdd5d855f652c6bc46c972a936.zip
Parent26399584792adef3896c92025353ec482cfa2d3d (diff)
feat: Add basic Markdown to dunbar convertion script
This marks the start of the dunbar rewrite
1 files changed, 22 insertions, 0 deletions
-rwxr-xr-xmd-to-du.sed22
diff --git a/md-to-du.sed b/md-to-du.sed
new file mode 100755
index 0000000..2b315e2
--- /dev/null
+++ b/md-to-du.sed
@@ -0,0 +1,22 @@
+#!/usr/bin/env -S sed -rf
+
+#== Inline elements ==#
+
+# <br> -> \n
+s/<br>/\\n/g
+
+# `...` -> `[...]`
+s/`([^`]+)`/`[\1]`/g
+# **...** -> =[...]=
+s/\*\*([^*]+)\*\*/=[\1]=/g
+# *...* -> *[...]*
+s/\*([^*]+)\*/*[\1]*/g
+
+# [TITLE](URL) -> [url URL TITLE]
+s/\[([^]]*)\]\(([^)]*)\)/[url \2 \1]/g
+
+#== syndamia.com specifics ==#
+
+#-- MEL --#
+# &.x -> [$x]
+s/&\.([a-z]+)/[$\1]/g