You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

271 lines
10 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Mathieu Lirzin <>
;;; Copyright © 2015 David Thompson <>
;;; Copyright © 2016, 2019 Efraim Flashner <>
;;; Copyright © 2017 Nikita <>
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <>
;;; Copyright © 2020 Marius Bakke <>
;;; This file is part of GNU Guix.
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <>.
(define-module (gnu packages markup)
#:use-module (guix licenses)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:use-module (guix build-system cmake)
#:use-module (guix build-system perl)
#:use-module (gnu packages compression)
#:use-module (gnu packages)
#:use-module (gnu packages perl)
#:use-module (gnu packages python)
#:use-module (gnu packages web))
(define-public hoedown
(name "hoedown")
(version "3.0.7")
(source (origin
(method git-fetch)
(uri (git-reference
(url "")
(commit version)))
(file-name (git-file-name name version))
(build-system gnu-build-system)
'(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
#:phases (modify-phases %standard-phases
(delete 'configure)) ; no configure script
#:test-target "test"))
`(("python" ,python-2)
("tidy" ,tidy)))
(synopsis "Markdown processing library")
(description "Hoedown is a standards compliant, fast, secure markdown
processing library written in C.")
(home-page "")
(license expat)))
(define-public markdown
(name "markdown")
(version "1.0.1")
(method url-fetch)
(uri (string-append
(string-capitalize name) "_" version ".zip"))
(base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
(build-system trivial-build-system)
'(#:modules ((guix build utils))
(use-modules (guix build utils))
(let ((source (assoc-ref %build-inputs "source"))
(out (assoc-ref %outputs "out"))
(perlbd (string-append (assoc-ref %build-inputs "perl") "/bin"))
(unzip (string-append (assoc-ref %build-inputs "unzip")
(mkdir-p out)
(with-directory-excursion out
(invoke unzip source)
(mkdir "bin")
(mkdir-p "share/doc")
(rename-file "Markdown_1.0.1/" "bin/markdown")
(rename-file "Markdown_1.0.1/Markdown Readme.text"
(patch-shebang "bin/markdown" (list perlbd))
(delete-file-recursively "Markdown_1.0.1"))
(native-inputs `(("unzip" ,unzip)))
(inputs `(("perl" ,perl)))
(home-page "")
(synopsis "Text-to-HTML conversion tool")
"Markdown is a text-to-HTML conversion tool for web writers. It allows
you to write using an easy-to-read, easy-to-write plain text format, then
convert it to structurally valid XHTML (or HTML).")
(license (non-copyleft "file://License.text"
"See License.text in the distribution."))))
(define-public discount
(name "discount")
(version "2.2.4")
(source (origin
(method url-fetch)
(uri (string-append
"discount/discount-" version ".tar.bz2"))
(build-system gnu-build-system)
`(#:test-target "test"
#:make-flags (list
(string-append "LFLAGS=-L. -Wl,-rpath="
(assoc-ref %outputs "out") "/lib"))
(modify-phases %standard-phases
(add-before 'configure 'set-AC_PATH
(lambda _
;; The default value is not suitable, so override using an
;; environment variable. This just affects the build, and not the
;; resulting store item.
(setenv "AC_PATH" (getenv "PATH"))
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(setenv "CC" "gcc")
(invoke "./"
(string-append "--prefix=" (assoc-ref outputs "out"))
(synopsis "Markdown processing library, written in C")
"Discount is a markdown implementation, written in C. It provides a
@command{markdown} command, and a library.")
(home-page "")
(license bsd-3)))
(define-public perl-text-markdown-discount
(name "perl-text-markdown-discount")
(version "0.11")
(method url-fetch)
(uri (string-append
(search-patches "perl-text-markdown-discount-unbundle.patch"))))
(build-system perl-build-system)
(modify-phases %standard-phases
(add-before 'build 'set-ldflags
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "Makefile"
"OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
(assoc-ref inputs "discount")
`(("discount" ,discount)))
"Fast function for converting Markdown to HTML using Discount")
"Text::Markdown::Discount is a Perl extension to the Discount markdown
use Text::Markdown::Discount;
my $html = markdown($text)
@end example")
(license perl-license)))
(define-public cmark
(name "cmark")
(version "0.29.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "")
(commit version)))
(file-name (git-file-name name version))
(modules '((guix build utils)))
;; Mimic upstream commit 68c3a91166347 to fix a test failure
;; when using Python 3.8. Remove for versions > 0.29.
;; See <>.
(substitute* "test/"
(("cgi") "html"))
(build-system cmake-build-system)
'(#:test-target "test"))
(native-inputs `(("python" ,python)))
(synopsis "CommonMark Markdown reference implementation")
(description "CommonMark is a strongly defined, highly compatible
specification of Markdown. cmark is the C reference implementation of
CommonMark. It provides @code{libcmark} shared library for parsing
CommonMark to an abstract syntax tree (@dfn{AST}) and rendering the document
as HTML, groff man, LaTeX, CommonMark, or an XML representation of the
AST. The package also provides the command-line program @command{cmark}
for parsing and rendering CommonMark.")
(home-page "")
;; cmark is distributed with a BSD-2 license, but some components are Expat
;; licensed. The CommonMark specification is Creative Commons CC-BY-SA 4.0
;; licensed. See 'COPYING' in the source distribution for more information.
(license (list bsd-2 expat cc-by-sa4.0))))
(define-public smu
(name "smu")
(version "1.5")
(method git-fetch)
(uri (git-reference
(url "")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(base32 "1jm7lhnzjx4q7gcwlkvsbffcy0zppywyh50d71ami6dnq182vvcc"))))
(build-system gnu-build-system)
`(#:make-flags (list "CC=gcc"
(string-append "PREFIX="
(assoc-ref %outputs "out")))
#:tests? #f ; no tests included
(modify-phases %standard-phases
(delete 'configure))))
(home-page "")
(synopsis "Simple markup")
"Smu is a very simple and minimal markup language. It is
designed for using in wiki-like environments. Smu makes it very
easy to write your documents on the fly and convert them into HTML.
Smu is capable to parse very large documents. As long as you avoid an huge
amount of indents it scales just great.
Smu was started as a rewrite of Markdown but became something more
lightweight and consistent. The biggest difference between Markdown
and smu is that smu doesn't support reference style links.")
(license x11)))