1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
3 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 ng0 <ng0@n0.is>
6 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages markup)
24 #:use-module (guix licenses)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix packages)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system trivial)
30 #:use-module (guix build-system cmake)
31 #:use-module (guix build-system perl)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages web))
38 (define-public hoedown
45 (url "https://github.com/hoedown/hoedown.git")
47 (file-name (git-file-name name version))
50 "1kr3hxjg2dgmwy9738qgj3sh3f5cygx0zxskkfhrg7x19bq9yd26"))))
51 (build-system gnu-build-system)
53 '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
54 #:phases (modify-phases %standard-phases
55 (delete 'configure)) ; no configure script
56 #:test-target "test"))
58 `(("python" ,python-2)
60 (synopsis "Markdown processing library")
61 (description "Hoedown is a standards compliant, fast, secure markdown
62 processing library written in C.")
63 (home-page "https://github.com/hoedown/hoedown")
66 (define-public markdown
74 "http://daringfireball.net/projects/downloads/"
75 (string-capitalize name) "_" version ".zip"))
77 (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
78 (build-system trivial-build-system)
80 '(#:modules ((guix build utils))
83 (use-modules (guix build utils))
84 (let ((source (assoc-ref %build-inputs "source"))
85 (out (assoc-ref %outputs "out"))
86 (perlbd (string-append (assoc-ref %build-inputs "perl") "/bin"))
87 (unzip (string-append (assoc-ref %build-inputs "unzip")
90 (with-directory-excursion out
94 (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
95 (rename-file "Markdown_1.0.1/Markdown Readme.text"
97 (patch-shebang "bin/markdown" (list perlbd))
98 (delete-file-recursively "Markdown_1.0.1"))
100 (native-inputs `(("unzip" ,unzip)))
101 (inputs `(("perl" ,perl)))
102 (home-page "http://daringfireball.net/projects/markdown")
103 (synopsis "Text-to-HTML conversion tool")
105 "Markdown is a text-to-HTML conversion tool for web writers. It allows
106 you to write using an easy-to-read, easy-to-write plain text format, then
107 convert it to structurally valid XHTML (or HTML).")
108 (license (non-copyleft "file://License.text"
109 "See License.text in the distribution."))))
111 (define-public discount
118 "http://www.pell.portland.or.us/~orc/Code/"
119 "discount/discount-" version ".tar.bz2"))
122 "199hwajpspqil0a4y3yxsmhdp2dm73gqkzfk4mrwzsmlq8y1xzbl"))))
123 (build-system gnu-build-system)
125 `(#:test-target "test"
127 (string-append "LFLAGS=-L. -Wl,-rpath="
128 (assoc-ref %outputs "out") "/lib"))
130 (modify-phases %standard-phases
131 (add-before 'configure 'set-AC_PATH
133 ;; The default value is not suitable, so override using an
134 ;; environment variable. This just affects the build, and not the
135 ;; resulting store item.
136 (setenv "AC_PATH" (getenv "PATH"))
139 (lambda* (#:key inputs outputs #:allow-other-keys)
141 (invoke "./configure.sh"
142 (string-append "--prefix=" (assoc-ref outputs "out"))
144 (synopsis "Markdown processing library, written in C")
146 "Discount is a markdown implementation, written in C. It provides a
147 @command{markdown} command, and a library.")
148 (home-page "https://www.pell.portland.or.us/~orc/Code/discount/")
151 (define-public perl-text-markdown-discount
153 (name "perl-text-markdown-discount")
159 "mirror://cpan/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-"
164 "1xx7v3wnla7m6wa3h33whxw3vvincaicg4yra1b9wbzf2aix9rnw"))
166 (search-patches "perl-text-markdown-discount-unbundle.patch"))))
167 (build-system perl-build-system)
170 (modify-phases %standard-phases
171 (add-before 'build 'set-ldflags
172 (lambda* (#:key inputs #:allow-other-keys)
173 (substitute* "Makefile"
176 "OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
177 (assoc-ref inputs "discount")
181 `(("discount" ,discount)))
183 "https://metacpan.org/release/Text-Markdown-Discount")
185 "Fast function for converting Markdown to HTML using Discount")
187 "Text::Markdown::Discount is a Perl extension to the Discount markdown
191 use Text::Markdown::Discount;
192 my $html = markdown($text)
194 (license perl-license)))
203 (url "https://github.com/jgm/cmark.git")
205 (file-name (git-file-name name version))
208 "0r7jpqhgnssq444i8pwji2g36058vfzwkl70wbiwj13h4w5rfc8f"))))
209 (build-system cmake-build-system)
211 '(#:test-target "test"))
212 (native-inputs `(("python" ,python)))
213 (synopsis "CommonMark Markdown reference implementation")
214 (description "CommonMark is a strongly defined, highly compatible
215 specification of Markdown. cmark is the C reference implementation of
216 CommonMark. It provides @code{libcmark} shared library for parsing
217 CommonMark to an abstract syntax tree (@dfn{AST}) and rendering the document
218 as HTML, groff man, LaTeX, CommonMark, or an XML representation of the
219 AST. The package also provides the command-line program @command{cmark}
220 for parsing and rendering CommonMark.")
221 (home-page "http://commonmark.org")
222 ;; cmark is distributed with a BSD-2 license, but some components are Expat
223 ;; licensed. The CommonMark specification is Creative Commons CC-BY-SA 4.0
224 ;; licensed. See 'COPYING' in the source distribution for more information.
225 (license (list bsd-2 expat cc-by-sa4.0))))
235 (url "https://github.com/Gottox/smu.git")
236 (commit (string-append "v" version))))
237 (file-name (git-file-name name version))
239 (base32 "1jm7lhnzjx4q7gcwlkvsbffcy0zppywyh50d71ami6dnq182vvcc"))))
240 (build-system gnu-build-system)
242 `(#:make-flags (list "CC=gcc"
243 (string-append "PREFIX="
244 (assoc-ref %outputs "out")))
245 #:tests? #f ; no tests included
247 (modify-phases %standard-phases
248 (delete 'configure))))
249 (home-page "https://github.com/Gottox/smu")
250 (synopsis "Simple markup")
252 "Smu is a very simple and minimal markup language. It is
253 designed for using in wiki-like environments. Smu makes it very
254 easy to write your documents on the fly and convert them into HTML.
255 Smu is capable to parse very large documents. As long as you avoid an huge
256 amount of indents it scales just great.
258 Smu was started as a rewrite of Markdown but became something more
259 lightweight and consistent. The biggest difference between Markdown
260 and smu is that smu doesn't support reference style links.")