| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 |
|
| 37 | (define-module (gnu packages markup)
|
| 38 | #:use-module ((guix licenses) #:prefix license:)
|
| 39 | #:use-module (guix download)
|
| 40 | #:use-module (guix git-download)
|
| 41 | #:use-module (guix gexp)
|
| 42 | #:use-module (guix packages)
|
| 43 | #:use-module (guix build-system gnu)
|
| 44 | #:use-module (guix build-system meson)
|
| 45 | #:use-module (guix build-system go)
|
| 46 | #:use-module (guix build-system trivial)
|
| 47 | #:use-module (guix build-system cmake)
|
| 48 | #:use-module (guix build-system perl)
|
| 49 | #:use-module (guix build-system pyproject)
|
| 50 | #:use-module (guix utils)
|
| 51 | #:use-module (guix gexp)
|
| 52 | #:use-module (gnu packages)
|
| 53 | #:use-module (gnu packages base)
|
| 54 | #:use-module (gnu packages bash)
|
| 55 | #:use-module (gnu packages check)
|
| 56 | #:use-module (gnu packages compression)
|
| 57 | #:use-module (gnu packages databases)
|
| 58 | #:use-module (gnu packages glib)
|
| 59 | #:use-module (gnu packages gtk)
|
| 60 | #:use-module (gnu packages libffi)
|
| 61 | #:use-module (gnu packages imagemagick)
|
| 62 | #:use-module (gnu packages perl)
|
| 63 | #:use-module (gnu packages perl-check)
|
| 64 | #:use-module (gnu packages perl-compression)
|
| 65 | #:use-module (gnu packages pkg-config)
|
| 66 | #:use-module (gnu packages python)
|
| 67 | #:use-module (gnu packages python-build)
|
| 68 | #:use-module (gnu packages python-xyz)
|
| 69 | #:use-module (gnu packages tex)
|
| 70 | #:use-module (gnu packages web)
|
| 71 | #:use-module (gnu packages xml))
|
| 72 |
|
| 73 | (define-public gofrundis
|
| 74 | (package
|
| 75 | (name "gofrundis")
|
| 76 | (version "0.16.0")
|
| 77 | (source
|
| 78 | (origin
|
| 79 | (method git-fetch)
|
| 80 | (uri (git-reference
|
| 81 | (url "https://codeberg.org/anaseto/gofrundis")
|
| 82 | (commit (string-append "v" version))))
|
| 83 | (file-name (git-file-name name version))
|
| 84 | (sha256
|
| 85 | (base32 "11821nmx9rnxff8pm08dbdzc6rqv4xliw9kx3pdfmxjf8n6p58xj"))))
|
| 86 | (build-system go-build-system)
|
| 87 | (arguments
|
| 88 | (list
|
| 89 | #:install-source? #f
|
| 90 | #:import-path "codeberg.org/anaseto/gofrundis/cmd/frundis"
|
| 91 | #:unpack-path "codeberg.org/anaseto/gofrundis"
|
| 92 | #:test-subdirs
|
| 93 | #~(list "../../...")
|
| 94 | #:phases
|
| 95 | #~(modify-phases %standard-phases
|
| 96 | (add-after 'unpack 'fix-paths
|
| 97 | (lambda* (#:key unpack-path #:allow-other-keys)
|
| 98 | (substitute* (string-append "src/" unpack-path
|
| 99 | "/frundis/utils.go")
|
| 100 | (("/bin/sh")
|
| 101 | (string-append #$(this-package-input "bash-minimal")
|
| 102 | "/bin/sh"))))))))
|
| 103 | (inputs (list bash-minimal))
|
| 104 | (native-inputs (list perl)) |
| 105 | (home-page "https://anaseto.codeberg.page/frundis/")
|
| 106 | (synopsis "Tool for compiling documents written in the frundis")
|
| 107 | (description
|
| 108 | "@command{frundis} is a tool for compiling documents written in the
|
| 109 | frundis language, a semantic markup language primarily intended for supporting
|
| 110 | authoring of novels, but also well suited for many other kinds of documents.
|
| 111 | The frundis tool can export documents to LaTeX, XHTML 5, EPUB, markdown and
|
| 112 | groff mom.
|
| 113 |
|
| 114 | The language has a focus on simplicity. It provides a few flexible built-in
|
| 115 | macros with extensible semantics. It strives to provide good error messages
|
| 116 | and catch typos, while still allowing one to finely control output for a
|
| 117 | specific format when needed.")
|
| 118 | (license license:isc)))
|
| 119 |
|
| 120 | (define-public hoedown
|
| 121 | (package
|
| 122 | (name "hoedown")
|
| 123 | (version "3.0.7")
|
| 124 | (source (origin
|
| 125 | (method git-fetch)
|
| 126 | (uri (git-reference
|
| 127 | (url "https://github.com/hoedown/hoedown")
|
| 128 | (commit version)))
|
| 129 | (file-name (git-file-name name version))
|
| 130 | (sha256
|
| 131 | (base32
|
| 132 | "1kr3hxjg2dgmwy9738qgj3sh3f5cygx0zxskkfhrg7x19bq9yd26"))))
|
| 133 | (build-system gnu-build-system)
|
| 134 | (arguments
|
| 135 | '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
|
| 136 | #:phases (modify-phases %standard-phases
|
| 137 | (delete 'configure)) |
| 138 | #:test-target "test"))
|
| 139 | (native-inputs
|
| 140 | `(("python" ,python-minimal-wrapper)
|
| 141 | ("tidy" ,tidy-html)))
|
| 142 | (synopsis "Markdown processing library")
|
| 143 | (description "Hoedown is a standards compliant, fast, secure markdown
|
| 144 | processing library written in C.")
|
| 145 | (home-page "https://github.com/hoedown/hoedown")
|
| 146 | (license license:expat)))
|
| 147 |
|
| 148 | (define-public markdown
|
| 149 | (package
|
| 150 | (name "markdown")
|
| 151 | (version "1.0.1")
|
| 152 | (source
|
| 153 | (origin
|
| 154 | (method url-fetch)
|
| 155 | (uri (string-append
|
| 156 | "http://daringfireball.net/projects/downloads/"
|
| 157 | (string-capitalize name) "_" version ".zip"))
|
| 158 | (sha256
|
| 159 | (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
|
| 160 | (build-system trivial-build-system)
|
| 161 | (arguments
|
| 162 | '(#:modules ((guix build utils))
|
| 163 | #:builder
|
| 164 | (begin
|
| 165 | (use-modules (guix build utils))
|
| 166 | (let ((source (assoc-ref %build-inputs "source"))
|
| 167 | (out (assoc-ref %outputs "out"))
|
| 168 | (perlbd (string-append (assoc-ref %build-inputs "perl") "/bin"))
|
| 169 | (unzip (search-input-file %build-inputs "/bin/unzip")))
|
| 170 | (mkdir-p out)
|
| 171 | (with-directory-excursion out
|
| 172 | (invoke unzip source)
|
| 173 | (mkdir "bin")
|
| 174 | (mkdir-p "share/doc")
|
| 175 | (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
|
| 176 | (rename-file "Markdown_1.0.1/Markdown Readme.text"
|
| 177 | "share/doc/README")
|
| 178 | (patch-shebang "bin/markdown" (list perlbd))
|
| 179 | (delete-file-recursively "Markdown_1.0.1"))
|
| 180 | #t))))
|
| 181 | (native-inputs (list unzip))
|
| 182 | (inputs (list perl))
|
| 183 | (home-page "http://daringfireball.net/projects/markdown")
|
| 184 | (synopsis "Text-to-HTML conversion tool")
|
| 185 | (description
|
| 186 | "Markdown is a text-to-HTML conversion tool for web writers. It allows
|
| 187 | you to write using an easy-to-read, easy-to-write plain text format, then
|
| 188 | convert it to structurally valid XHTML (or HTML).")
|
| 189 | (license (license:non-copyleft "file://License.text"
|
| 190 | "See License.text in the distribution."))))
|
| 191 |
|
| 192 | (define-public latexml
|
| 193 | (package
|
| 194 | (name "latexml")
|
| 195 | (version "0.8.8")
|
| 196 | (source
|
| 197 | (origin
|
| 198 | (method git-fetch)
|
| 199 | (uri (git-reference
|
| 200 | (url "https://github.com/brucemiller/LaTeXML")
|
| 201 | (commit (string-append "v" version))))
|
| 202 | (file-name (git-file-name name version))
|
| 203 | (sha256
|
| 204 | (base32
|
| 205 | "0lppm66fxadsbn73xh0nfqdi4y6d9j6xph1slvlp6ynrfbnn5p6s"))))
|
| 206 | (build-system perl-build-system)
|
| 207 | (arguments
|
| 208 | (let ((wraplibs
|
| 209 | (list "perl-archive-zip"
|
| 210 | "perl-common-sense"
|
| 211 | "perl-db-file"
|
| 212 | "perl-encode-locale"
|
| 213 | "perl-file-which"
|
| 214 | "perl-getopt-long"
|
| 215 | "perl-http-date"
|
| 216 | "perl-http-message"
|
| 217 | "perl-image-magick"
|
| 218 | "perl-image-size"
|
| 219 | "perl-io-string"
|
| 220 | "perl-json-xs"
|
| 221 | "perl-libwww"
|
| 222 | "perl-mime-base64"
|
| 223 | "perl-parse-recdescent"
|
| 224 | "perl-pod-parser"
|
| 225 | "perl-text-unidecode"
|
| 226 | "perl-time-hires"
|
| 227 | "perl-try-tiny"
|
| 228 | "perl-types-serialiser"
|
| 229 | "perl-uri"
|
| 230 | "perl-xml-libxml"
|
| 231 | "perl-xml-libxslt"
|
| 232 | "perl-xml-sax-base")))
|
| 233 | (list
|
| 234 | |
| 235 | #:phases
|
| 236 | #~(modify-phases %standard-phases
|
| 237 | (add-after 'install 'find-itself
|
| 238 | |
| 239 | |
| 240 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 241 | (with-directory-excursion (string-append #$output "/bin")
|
| 242 | (for-each
|
| 243 | (lambda* (program)
|
| 244 | (wrap-program program
|
| 245 | `("PERL5LIB" ":" prefix
|
| 246 | (,(string-append #$output "/lib/perl5/site_perl")
|
| 247 | ,#$@(map (lambda (in)
|
| 248 | (file-append
|
| 249 | (this-package-input in) "/lib/perl5/site_perl"))
|
| 250 | wraplibs)))))
|
| 251 | (find-files "." ".*")))))))))
|
| 252 | (inputs
|
| 253 | (list bash-minimal
|
| 254 | libxml2
|
| 255 | libxslt
|
| 256 | perl
|
| 257 | perl-archive-zip
|
| 258 | perl-common-sense
|
| 259 | perl-db-file
|
| 260 | perl-encode-locale
|
| 261 | perl-file-which
|
| 262 | perl-getopt-long
|
| 263 | perl-http-date
|
| 264 | perl-http-message
|
| 265 | perl-image-magick
|
| 266 | perl-image-size
|
| 267 | perl-io-string
|
| 268 | perl-json-xs
|
| 269 | perl-libwww
|
| 270 | perl-mime-base64
|
| 271 | perl-parse-recdescent
|
| 272 | perl-pod-parser
|
| 273 | perl-text-unidecode
|
| 274 | perl-time-hires
|
| 275 | perl-try-tiny
|
| 276 | perl-types-serialiser
|
| 277 | perl-uri
|
| 278 | perl-xml-libxml
|
| 279 | perl-xml-libxslt
|
| 280 | perl-xml-sax-base))
|
| 281 | (native-inputs
|
| 282 | (list texlive-bin
|
| 283 | perl-test-more-utf8
|
| 284 | perl-extutils-manifest
|
| 285 | perl-data-dumper
|
| 286 | perl-ipc-run3
|
| 287 | perl-file-temp))
|
| 288 | (home-page "https://math.nist.gov/~BMiller/LaTeXML/")
|
| 289 | (synopsis "LaTeX to XML, HTML, MathML, epub and Jats converter")
|
| 290 | (description "This package provides a LaTeX converter, with the following goals:
|
| 291 | @itemize
|
| 292 | @item Faithful emulation of TEX’s behaviour;
|
| 293 | @item Easily extensible;
|
| 294 | @item Lossless, preserving both semantic and presentation cues;
|
| 295 | @item Use an abstract LATEX-like, extensible, document type;
|
| 296 | @item Infer the semantics of mathematical content
|
| 297 | @end itemize")
|
| 298 | (license license:cc0)))
|
| 299 |
|
| 300 | (define-public lowdown
|
| 301 | (package
|
| 302 | (name "lowdown")
|
| 303 | (version "1.1.0")
|
| 304 | (source
|
| 305 | (origin
|
| 306 | (method url-fetch)
|
| 307 | (uri (string-append
|
| 308 | "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-"
|
| 309 | version ".tar.gz"))
|
| 310 | (sha256
|
| 311 | (base32 "0y88gffrg1zrin0y53j4gbkmpia0r8p0kyklj501wavkqi83j7pk"))))
|
| 312 | (build-system gnu-build-system)
|
| 313 | (arguments
|
| 314 | (list
|
| 315 | #:test-target "regress"
|
| 316 | #:phases
|
| 317 | #~(modify-phases %standard-phases
|
| 318 | (replace 'configure
|
| 319 | (lambda _
|
| 320 | (invoke "./configure"
|
| 321 | (string-append "PREFIX=" #$output)
|
| 322 | (string-append "MANDIR=" #$output "/share/man"))))
|
| 323 | (replace 'install
|
| 324 | (lambda _
|
| 325 | (invoke "make" "install" "install_libs"))))
|
| 326 | #:make-flags #~(list "CFLAGS=-fPIC")))
|
| 327 | (native-inputs
|
| 328 | (list which))
|
| 329 | (home-page "https://kristaps.bsd.lv/lowdown/")
|
| 330 | (synopsis "Simple Markdown translator")
|
| 331 | (description "Lowdown is a Markdown translator producing HTML5, roff
|
| 332 | documents in the ms and man formats, LaTeX, gemini, and terminal output.")
|
| 333 | (license license:isc)))
|
| 334 |
|
| 335 | (define-public discount
|
| 336 | (package
|
| 337 | (name "discount")
|
| 338 | (version "3.0.1.3")
|
| 339 | (source (origin
|
| 340 | (method url-fetch)
|
| 341 | (uri (string-append
|
| 342 | "http://www.pell.portland.or.us/~orc/Code/"
|
| 343 | "discount/discount-" version ".tar.bz2"))
|
| 344 | (sha256
|
| 345 | (base32
|
| 346 | "03m3xxcjcg0byiblq3jy7is30373zlf36m3rs2whaaa1sbmd9qx4"))))
|
| 347 | (build-system gnu-build-system)
|
| 348 | (arguments
|
| 349 | `(#:test-target "test"
|
| 350 | #:parallel-build? #f |
| 351 | #:make-flags (list
|
| 352 | (string-append "LFLAGS=-L. -Wl,-rpath="
|
| 353 | (assoc-ref %outputs "out") "/lib"))
|
| 354 | #:phases
|
| 355 | (modify-phases %standard-phases
|
| 356 | (add-before 'configure 'set-AC_PATH
|
| 357 | (lambda _
|
| 358 | |
| 359 | |
| 360 | |
| 361 | (setenv "AC_PATH" (getenv "PATH"))
|
| 362 | #t))
|
| 363 | (replace 'configure
|
| 364 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 365 | (let ((out (assoc-ref outputs "out")))
|
| 366 | (setenv "CC" (string-append
|
| 367 | ,(cc-for-target)
|
| 368 | " -g -O2"
|
| 369 | " -Wno-error=incompatible-pointer-types"))
|
| 370 | |
| 371 | (setenv "LDFLAGS" (string-append "-Wl,-rpath=" out "/lib"))
|
| 372 | (invoke "./configure.sh"
|
| 373 | (string-append "--prefix=" out)
|
| 374 | "--shared")))))))
|
| 375 | (native-inputs
|
| 376 | (list pkg-config))
|
| 377 | (synopsis "Markdown processing library, written in C")
|
| 378 | (description
|
| 379 | "Discount is a markdown implementation, written in C. It provides a
|
| 380 | @command{markdown} command, and a library.")
|
| 381 | (home-page "https://www.pell.portland.or.us/~orc/Code/discount/")
|
| 382 | (license license:bsd-3)))
|
| 383 |
|
| 384 | (define-public discount-2
|
| 385 | (package/inherit discount
|
| 386 | (version "2.2.7d")
|
| 387 | (source (origin
|
| 388 | (method url-fetch)
|
| 389 | (uri (string-append
|
| 390 | "http://www.pell.portland.or.us/~orc/Code/"
|
| 391 | "discount/discount-" version ".tar.bz2"))
|
| 392 | (sha256
|
| 393 | (base32
|
| 394 | "0lkvnysnnaw431dam3b8b1f0ln1iscas5wcgw0bxx35fjqg098hj"))))))
|
| 395 |
|
| 396 | (define-public perl-text-markdown
|
| 397 | (package
|
| 398 | (name "perl-text-markdown")
|
| 399 | (version "1.000031")
|
| 400 | (source
|
| 401 | (origin
|
| 402 | (method url-fetch)
|
| 403 | (uri (string-append
|
| 404 | "mirror://cpan/authors/id/B/BO/BOBTFISH/Text-Markdown-" version
|
| 405 | ".tar.gz"))
|
| 406 | (sha256
|
| 407 | (base32 "06y79lla8adkqhrs41xdddqjs81dcrh266b50mfbg37bxkawd4f1"))))
|
| 408 | (build-system perl-build-system)
|
| 409 | (native-inputs (list perl-list-moreutils
|
| 410 | perl-module-install
|
| 411 | perl-test-differences
|
| 412 | perl-test-exception))
|
| 413 | (home-page "https://metacpan.org/release/Text-Markdown")
|
| 414 | (synopsis "Convert Markdown syntax to (X)HTML")
|
| 415 | (description "@code{Text::Markdown} is a Perl module that provides an
|
| 416 | alternate implementation of the Markdown implementation by John Gruber (see
|
| 417 | the markdown package). It is a slower implementation, but better
|
| 418 | maintained.")
|
| 419 | (license license:bsd-3)))
|
| 420 |
|
| 421 | (define-public perl-text-markdown-discount
|
| 422 | (package
|
| 423 | (name "perl-text-markdown-discount")
|
| 424 | (version "0.11")
|
| 425 | (source
|
| 426 | (origin
|
| 427 | (method url-fetch)
|
| 428 | (uri (string-append
|
| 429 | "mirror://cpan/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-"
|
| 430 | version
|
| 431 | ".tar.gz"))
|
| 432 | (sha256
|
| 433 | (base32
|
| 434 | "1xx7v3wnla7m6wa3h33whxw3vvincaicg4yra1b9wbzf2aix9rnw"))
|
| 435 | (patches
|
| 436 | (search-patches "perl-text-markdown-discount-unbundle.patch"))))
|
| 437 | (build-system perl-build-system)
|
| 438 | (arguments
|
| 439 | `(#:phases
|
| 440 | (modify-phases %standard-phases
|
| 441 | (add-before 'build 'set-ldflags
|
| 442 | (lambda* (#:key inputs #:allow-other-keys)
|
| 443 | (substitute* "Makefile"
|
| 444 | (("OTHERLDFLAGS = ")
|
| 445 | (string-append
|
| 446 | "OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
|
| 447 | (assoc-ref inputs "discount")
|
| 448 | "/lib")))
|
| 449 | #t)))))
|
| 450 | (inputs
|
| 451 | (list discount-2))
|
| 452 | (home-page
|
| 453 | "https://metacpan.org/release/Text-Markdown-Discount")
|
| 454 | (synopsis
|
| 455 | "Fast function for converting Markdown to HTML using Discount")
|
| 456 | (description
|
| 457 | "Text::Markdown::Discount is a Perl extension to the Discount markdown
|
| 458 | implementation.
|
| 459 |
|
| 460 | @example
|
| 461 | use Text::Markdown::Discount;
|
| 462 | my $html = markdown($text)
|
| 463 | @end example")
|
| 464 | (license license:perl-license)))
|
| 465 |
|
| 466 | (define-public python-cmarkgfm
|
| 467 | (package
|
| 468 | (name "python-cmarkgfm")
|
| 469 | (version "2024.11.20")
|
| 470 | (source (origin
|
| 471 | (method url-fetch)
|
| 472 | (uri (pypi-uri "cmarkgfm" version))
|
| 473 | (sha256
|
| 474 | (base32
|
| 475 | "0siwyyfgp7v5vw6xd4zy2cph6dp9f3c5xvyd2draba3m37v1rl2x"))
|
| 476 | (modules '((guix build utils)))
|
| 477 | (snippet
|
| 478 | '(begin
|
| 479 | |
| 480 | (for-each delete-file-recursively
|
| 481 | '("third_party/cmark" "generated"))))))
|
| 482 | (build-system pyproject-build-system)
|
| 483 | (arguments
|
| 484 | (list #:phases
|
| 485 | #~(modify-phases %standard-phases
|
| 486 | (add-after 'unpack 'copy-cmark-gfm
|
| 487 | (lambda _
|
| 488 | |
| 489 | |
| 490 | (copy-recursively #+(package-source (this-package-input
|
| 491 | "cmark-gfm"))
|
| 492 | "third_party/cmark")))
|
| 493 | (add-after 'unpack 'install-cmark-headers
|
| 494 | (lambda* (#:key inputs #:allow-other-keys)
|
| 495 | |
| 496 | (let ((version.h (search-input-file
|
| 497 | inputs "/include/cmark-gfm_version.h")))
|
| 498 | (for-each (lambda (file)
|
| 499 | (install-file file "generated/unix/"))
|
| 500 | (cons version.h
|
| 501 | (find-files (dirname version.h)
|
| 502 | "_export\\.h$")))))))))
|
| 503 | (native-inputs (list python-pytest python-setuptools))
|
| 504 | (inputs (list cmark-gfm))
|
| 505 | (propagated-inputs (list python-cffi))
|
| 506 | (home-page "https://github.com/theacodes/cmarkgfm")
|
| 507 | (synopsis "Python bindings for GitHub's fork of cmark")
|
| 508 | (description
|
| 509 | "This package provides a minimal set of Python bindings for the
|
| 510 | GitHub cmark fork (@code{cmark-gfm}).")
|
| 511 | (license license:expat)))
|
| 512 |
|
| 513 | (define-public python-markdownify
|
| 514 | (package
|
| 515 | (name "python-markdownify")
|
| 516 | (version "1.1.0")
|
| 517 | (source
|
| 518 | (origin
|
| 519 | (method git-fetch) |
| 520 | (uri (git-reference
|
| 521 | (url "https://github.com/matthewwithanm/python-markdownify")
|
| 522 | (commit version)))
|
| 523 | (file-name (git-file-name name version))
|
| 524 | (sha256
|
| 525 | (base32 "09gh3grgiaiyhgpd1fias9xac45d4zw37ikkzyaavsixfzg0akbr"))))
|
| 526 | (build-system pyproject-build-system)
|
| 527 | (native-inputs (list python-pytest python-setuptools python-wheel))
|
| 528 | (propagated-inputs (list python-beautifulsoup4 python-six))
|
| 529 | (home-page "https://github.com/matthewwithanm/python-markdownify")
|
| 530 | (synopsis "Converts HTML to Markdown")
|
| 531 | (description "This package provides @code{markdownify} a Python library to
|
| 532 | convert HTML to Markdown.")
|
| 533 | (license license:expat)))
|
| 534 |
|
| 535 | (define-public cmark
|
| 536 | (package
|
| 537 | (name "cmark")
|
| 538 | (version "0.31.1")
|
| 539 | (source (origin
|
| 540 | (method git-fetch)
|
| 541 | (uri (git-reference
|
| 542 | (url "https://github.com/commonmark/cmark")
|
| 543 | (commit version)))
|
| 544 | (file-name (git-file-name name version))
|
| 545 | (sha256
|
| 546 | (base32
|
| 547 | "029x6rjlyxs50dxppaqk6lqzyy58hl0laqalmgiqr3m363pz14pq"))))
|
| 548 | (build-system cmake-build-system)
|
| 549 | (native-inputs (list python))
|
| 550 | (synopsis "CommonMark Markdown reference implementation")
|
| 551 | (description
|
| 552 | "CommonMark is a strongly defined, highly compatible specification of
|
| 553 | Markdown. @code{cmark} is the C reference implementation of CommonMark. It
|
| 554 | provides the @code{libcmark} shared library for parsing CommonMark to an
|
| 555 | abstract syntax tree (@dfn{AST}) and rendering the document as HTML, groff man,
|
| 556 | LaTeX, CommonMark, or an XML representation of the AST. It also provides the
|
| 557 | command-line program @command{cmark} for parsing and rendering CommonMark.")
|
| 558 | (home-page "https://commonmark.org")
|
| 559 | |
| 560 | |
| 561 | |
| 562 | (license (list license:bsd-2 license:expat license:cc-by-sa4.0))))
|
| 563 |
|
| 564 | (define-public perl-commonmark
|
| 565 | (package
|
| 566 | (name "perl-commonmark")
|
| 567 | (version "0.290000")
|
| 568 | (source (origin
|
| 569 | (method url-fetch)
|
| 570 | (uri (string-append
|
| 571 | "mirror://cpan/authors/id/N/NW/NWELLNHOF/CommonMark-"
|
| 572 | version ".tar.gz"))
|
| 573 | (sha256
|
| 574 | (base32
|
| 575 | "1pgaqa4f00i9r5z7l9xiya0q51ysq0nhpvgr0f3rza3cxz1v80d5"))))
|
| 576 | (build-system perl-build-system)
|
| 577 | (arguments
|
| 578 | `(#:make-maker-flags
|
| 579 | |
| 580 | (list (format #f "LIBS=-L~a/lib -lcmark"
|
| 581 | (assoc-ref %build-inputs "cmark")))))
|
| 582 | (inputs (list cmark perl-test-leaktrace perl-devel-checklib
|
| 583 | perl-module-build))
|
| 584 | (home-page "https://metacpan.org/release/CommonMark")
|
| 585 | (synopsis "Interface to the CommonMark C library")
|
| 586 | (description
|
| 587 | "This module is an XS wrapper around the official
|
| 588 | CommonMark C library libcmark. It closely follows the original API.")
|
| 589 | (license license:perl-license)))
|
| 590 |
|
| 591 | (define-public cmark-gfm
|
| 592 | (package
|
| 593 | (inherit cmark)
|
| 594 | (name "cmark-gfm")
|
| 595 | (version "0.29.0.gfm.13")
|
| 596 | (home-page "https://github.com/github/cmark-gfm")
|
| 597 | (source (origin
|
| 598 | (method git-fetch)
|
| 599 | (uri (git-reference (url home-page) (commit version)))
|
| 600 | (file-name (git-file-name name version))
|
| 601 | (sha256
|
| 602 | (base32
|
| 603 | "1apy9i76rgs0bmgdlpjszv0fpqhlap2s12m68wvnsv8j3fsqc90y"))))
|
| 604 | (arguments
|
| 605 | (list #:phases #~(modify-phases %standard-phases
|
| 606 | (add-after 'install 'install-config
|
| 607 | (lambda _
|
| 608 | |
| 609 | (install-file "src/config.h"
|
| 610 | (string-append #$output "/include")))))))
|
| 611 | (synopsis "GitHub flavored CommonMark")
|
| 612 | (description
|
| 613 | "This package is a fork of @code{cmark}, with GitHub-specific Markdown
|
| 614 | additions.")))
|
| 615 |
|
| 616 | (define-public smu
|
| 617 | (package
|
| 618 | (name "smu")
|
| 619 | (version "1.5")
|
| 620 | (source
|
| 621 | (origin
|
| 622 | (method git-fetch)
|
| 623 | (uri (git-reference
|
| 624 | (url "https://github.com/Gottox/smu")
|
| 625 | (commit (string-append "v" version))))
|
| 626 | (file-name (git-file-name name version))
|
| 627 | (sha256
|
| 628 | (base32 "1jm7lhnzjx4q7gcwlkvsbffcy0zppywyh50d71ami6dnq182vvcc"))))
|
| 629 | (build-system gnu-build-system)
|
| 630 | (arguments
|
| 631 | (list #:make-flags
|
| 632 | #~(list (string-append "CC=" #$(cc-for-target))
|
| 633 | (string-append "PREFIX=" #$output))
|
| 634 | #:tests? #f |
| 635 | #:phases
|
| 636 | #~(modify-phases %standard-phases
|
| 637 | (delete 'configure))))
|
| 638 | (home-page "https://github.com/Gottox/smu")
|
| 639 | (synopsis "Simple markup")
|
| 640 | (description
|
| 641 | "Smu is a very simple and minimal markup language. It is
|
| 642 | designed for using in wiki-like environments. Smu makes it very
|
| 643 | easy to write your documents on the fly and convert them into HTML.
|
| 644 | Smu is capable to parse very large documents. As long as you avoid an huge
|
| 645 | amount of indents it scales just great.
|
| 646 |
|
| 647 | Smu was started as a rewrite of Markdown but became something more
|
| 648 | lightweight and consistent. The biggest difference between Markdown
|
| 649 | and smu is that smu doesn't support reference style links.")
|
| 650 | (license license:x11)))
|
| 651 |
|
| 652 | (define-public md4c
|
| 653 | (package
|
| 654 | (name "md4c")
|
| 655 | (version "0.4.8")
|
| 656 | (source
|
| 657 | (origin
|
| 658 | (method git-fetch)
|
| 659 | (uri (git-reference
|
| 660 | (url "https://github.com/mity/md4c/")
|
| 661 | (commit (string-append "release-" version))))
|
| 662 | (file-name (git-file-name name version))
|
| 663 | (sha256
|
| 664 | (base32 "12pdh4rfjc3b0cblj5nz3jksr2376lx8ay0vw5dwa1s97q09pczq"))))
|
| 665 | (build-system cmake-build-system)
|
| 666 | (arguments '(#:tests? #f))
|
| 667 | (home-page "https://github.com/mity/md4c/")
|
| 668 | (synopsis "C Markdown parser compliant to CommonMark")
|
| 669 | (description "MD4C is a C Markdown parser with a
|
| 670 | SAX-like interface. It is compliant to the CommonMark specification,
|
| 671 | with a few extensions.")
|
| 672 | (license license:expat)))
|
| 673 |
|
| 674 | (define-public mdview-mtx
|
| 675 | (package
|
| 676 | (name "mdview-mtx")
|
| 677 | (version "2025.10.30")
|
| 678 | (source
|
| 679 | (origin
|
| 680 | (method git-fetch)
|
| 681 | (uri (git-reference
|
| 682 | (url "https://github.com/step-/mdview")
|
| 683 | (commit version)))
|
| 684 | (file-name (git-file-name name version))
|
| 685 | (sha256
|
| 686 | (base32 "0d9v7arbiw9q8bcfkak6v257f25pjigdm67fvw8f5xqbkmkjh0wj"))))
|
| 687 | (build-system meson-build-system)
|
| 688 | (inputs (list gtk+ md4c))
|
| 689 | (native-inputs (list `(,glib "bin") |
| 690 | pkg-config))
|
| 691 | (home-page "https://github.com/step-/mdview")
|
| 692 | (synopsis "GTK markdown viewer and CLI converter")
|
| 693 | (description
|
| 694 | "MDVIEW MTX is a graphical Markdown viewer and CLI converter
|
| 695 | supporting the CommonMark specification. Features include page and
|
| 696 | directory search, document and link navigation, hotkeys, and
|
| 697 | one-click export to web browser.")
|
| 698 | (license (list license:gpl2 license:expat))))
|
| 699 |
|
| 700 | (define-public python-mistletoe
|
| 701 | (package
|
| 702 | (name "python-mistletoe")
|
| 703 | (version "1.5.1")
|
| 704 | (source
|
| 705 | (origin
|
| 706 | (method git-fetch)
|
| 707 | (uri (git-reference
|
| 708 | (url "https://github.com/miyuchina/mistletoe")
|
| 709 | (commit (string-append "v" version))))
|
| 710 | (file-name (git-file-name name version))
|
| 711 | (sha256
|
| 712 | (base32 "1r279m8c0rx2vm7bhnax0q5zfzz3yf44qn057wa9bqng3nz0ls47"))))
|
| 713 | (build-system pyproject-build-system)
|
| 714 | (native-inputs
|
| 715 | (list python-parameterized
|
| 716 | python-pytest
|
| 717 | python-setuptools))
|
| 718 | (propagated-inputs
|
| 719 | (list python-pygments))
|
| 720 | (home-page "https://github.com/miyuchina/mistletoe")
|
| 721 | (synopsis "Extensible Markdown parser in pure Python")
|
| 722 | (description
|
| 723 | "The @code{mistletoe} Markdown parser is a CommonMark-compliant Markdown
|
| 724 | parser that supports definitions of custom tokens.
|
| 725 |
|
| 726 | Parsing Markdown into an abstract syntax tree also allows @code{mistletoe} to
|
| 727 | swap out renderers for different output formats, without touching any of the
|
| 728 | core components.")
|
| 729 | (license license:expat)))
|