Commit: b87c21731a552d996ba12f72d8beea7357dced5a
Parent: 77cf7d6a51966f926df49e62122a671b0dfd9337
Author: Randy Palamar
Date: Tue, 24 Oct 2023 18:18:20 -0600
replace cmark with md4c/md2html
it supports tables and is also smaller
Diffstat:
12 files changed, 36 insertions(+), 49 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -58,9 +58,9 @@
[submodule "pkg/sys/sbase/src"]
path = pkg/sys/sbase/src
url = git://git.suckless.org/sbase
-[submodule "pkg/textproc/cmark/src"]
- path = pkg/textproc/cmark/src
- url = https://github.com/commonmark/cmark.git
+[submodule "pkg/textproc/md4c/src"]
+ path = pkg/textproc/md4c/src
+ url = https://github.com/mity/md4c.git
[submodule "pkg/www/stagit/src"]
path = pkg/www/stagit/src
url = git://git.codemadness.org/stagit
diff --git a/pkg/textproc/cmark/cmark_export.h b/pkg/textproc/cmark/cmark_export.h
@@ -1 +0,0 @@
-#define CMARK_EXPORT
diff --git a/pkg/textproc/cmark/cmark_version.h b/pkg/textproc/cmark/cmark_version.h
@@ -1,2 +0,0 @@
-#define CMARK_VERSION ((0 << 16) | (30 << 8) | 2)
-#define CMARK_VERSION_STRING "0.30.2"
diff --git a/pkg/textproc/cmark/config.h b/pkg/textproc/cmark/config.h
@@ -1,3 +0,0 @@
-#include <stdbool.h>
-#define HAVE___BUILTIN_EXPECT 1
-#define CMARK_INLINE inline
diff --git a/pkg/textproc/cmark/gen.lua b/pkg/textproc/cmark/gen.lua
@@ -1,36 +0,0 @@
-cflags({ '-I $dir' })
-
-pkg.hdrs = {
- copy('$outdir/include', '$srcdir/src', {'cmark.h'}),
- copy('$outdir/include', '$dir', {'cmark_export.h', 'cmark_version.h'}),
- install=true,
-}
-
-lib('libcmark.a', expand{'src/', {
- 'cmark.c',
- 'node.c',
- 'iterator.c',
- 'blocks.c',
- 'inlines.c',
- 'scanners.c',
- 'utf8.c',
- 'buffer.c',
- 'references.c',
- 'render.c',
- 'man.c',
- 'xml.c',
- 'html.c',
- 'commonmark.c',
- 'latex.c',
- 'houdini_href_e.c',
- 'houdini_html_e.c',
- 'houdini_html_u.c',
- 'cmark_ctype.c',
-}})
-file('lib/libcmark.a', '644', '$outdir/libcmark.a')
-
-exe('cmark', {'src/main.c', 'libcmark.a'})
-file('bin/cmark', '755', '$outdir/cmark')
-man({'man/man1/cmark.1'})
-
-fetch('git')
diff --git a/pkg/textproc/cmark/src b/pkg/textproc/cmark/src
@@ -1 +0,0 @@
-Subproject commit 5ba25ff40eba44c811f79ab6a792baf945b8307c
diff --git a/pkg/textproc/cmark/ver b/pkg/textproc/cmark/ver
@@ -1 +0,0 @@
-0.30.3 r0
diff --git a/pkg/textproc/gen.lua b/pkg/textproc/gen.lua
@@ -1 +1 @@
-subgen('cmark')
+subgen('md4c')
diff --git a/pkg/textproc/md4c/gen.lua b/pkg/textproc/md4c/gen.lua
@@ -0,0 +1,29 @@
+cflags({
+ '-I $dir',
+ '-I $srcdir/src',
+ '-D MD4C_USE_UTF8',
+ '-D MD_VERSION_MAJOR=0',
+ '-D MD_VERSION_MINOR=4',
+ '-D MD_VERSION_RELEASE=8',
+})
+
+pkg.hdrs = {
+ copy('$outdir/include', '$srcdir/src', {'md4c.h', 'md4c-html.h'}),
+ install=true,
+}
+
+lib('libmd4c.a', {'src/md4c.c'})
+file('lib/libmd4c.a', '644', '$outdir/libmd4c.a')
+
+lib('libmd4c-html.a', expand({'src/', {'md4c-html.c', 'entity.c'}}))
+file('lib/libmd4c-html.a', '644', '$outdir/libmd4c-html.a')
+
+exe('md2html-bin', [[
+ md2html/(cmdline.c md2html.c)
+ libmd4c-html.a.d
+ libmd4c.a.d
+]])
+file('bin/md2html', '755', '$outdir/md2html-bin')
+man({'md2html/md2html.1'})
+
+fetch('git')
diff --git a/pkg/textproc/md4c/src b/pkg/textproc/md4c/src
@@ -0,0 +1 @@
+Subproject commit c3340b480e5232711858108be07460a9836c8ab5
diff --git a/pkg/textproc/md4c/ver b/pkg/textproc/md4c/ver
@@ -0,0 +1 @@
+0.4.8 r0
diff --git a/sets.lua b/sets.lua
@@ -2,12 +2,12 @@ local S = {}
S.bin = {
'awk',
- 'cmark',
'curl',
'git',
'hyx',
'man-pages-posix',
'mandoc',
+ 'md4c',
'openbsd',
'pigz',
'pwgen',