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 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
6 ;;; Copyright © 2017, 2018 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 packages)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system trivial)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system perl)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages web))
37 (define-public hoedown
43 (uri (string-append "https://github.com/hoedown/hoedown/archive/"
45 (file-name (string-append name "-" version ".tar.gz"))
48 "0859dc2xjasd6kgkshi8mb20kbyw5sql1ln0hw3bfaf33qdh5dh1"))))
49 (build-system gnu-build-system)
51 '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
52 #:phases (modify-phases %standard-phases
53 (delete 'configure)) ; no configure script
54 #:test-target "test"))
56 `(("python" ,python-2)
58 (synopsis "Markdown processing library")
59 (description "Hoedown is a standards compliant, fast, secure markdown
60 processing library written in C.")
61 (home-page "https://github.com/hoedown/hoedown")
64 (define-public markdown
72 "http://daringfireball.net/projects/downloads/"
73 (string-capitalize name) "_" version ".zip"))
75 (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
76 (build-system trivial-build-system)
78 '(#:modules ((guix build utils))
81 (use-modules (guix build utils))
82 (let ((source (assoc-ref %build-inputs "source"))
83 (out (assoc-ref %outputs "out"))
84 (perlbd (string-append (assoc-ref %build-inputs "perl") "/bin"))
85 (unzip (string-append (assoc-ref %build-inputs "unzip")
88 (with-directory-excursion out
92 (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
93 (rename-file "Markdown_1.0.1/Markdown Readme.text"
95 (patch-shebang "bin/markdown" (list perlbd))
96 (delete-file-recursively "Markdown_1.0.1"))
98 (native-inputs `(("unzip" ,unzip)))
99 (inputs `(("perl" ,perl)))
100 (home-page "http://daringfireball.net/projects/markdown")
101 (synopsis "Text-to-HTML conversion tool")
103 "Markdown is a text-to-HTML conversion tool for web writers. It allows
104 you to write using an easy-to-read, easy-to-write plain text format, then
105 convert it to structurally valid XHTML (or HTML).")
106 (license (non-copyleft "file://License.text"
107 "See License.text in the distribution."))))
109 (define-public discount
116 "http://www.pell.portland.or.us/~orc/Code/"
117 name "/" name "-" version ".tar.bz2"))
120 "199hwajpspqil0a4y3yxsmhdp2dm73gqkzfk4mrwzsmlq8y1xzbl"))))
121 (build-system gnu-build-system)
123 `(#:test-target "test"
125 (string-append "LFLAGS=-L. -Wl,-rpath="
126 (assoc-ref %outputs "out") "/lib"))
128 (modify-phases %standard-phases
129 (add-before 'configure 'set-AC_PATH
131 ;; The default value is not suitable, so override using an
132 ;; environment variable. This just affects the build, and not the
133 ;; resulting store item.
134 (setenv "AC_PATH" (getenv "PATH"))
137 (lambda* (#:key inputs outputs #:allow-other-keys)
139 (invoke "./configure.sh"
140 (string-append "--prefix=" (assoc-ref outputs "out"))
142 (synopsis "Markdown processing library, written in C")
144 "Discount is a markdown implementation, written in C. It provides a
145 @command{markdown} command, and a library.")
146 (home-page "https://www.pell.portland.or.us/~orc/Code/discount/")
149 (define-public perl-text-markdown-discount
151 (name "perl-text-markdown-discount")
157 "mirror://cpan/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-"
162 "1xx7v3wnla7m6wa3h33whxw3vvincaicg4yra1b9wbzf2aix9rnw"))
164 (search-patches "perl-text-markdown-discount-unbundle.patch"))))
165 (build-system perl-build-system)
168 (modify-phases %standard-phases
169 (add-before 'build 'set-ldflags
170 (lambda* (#:key inputs #:allow-other-keys)
171 (substitute* "Makefile"
174 "OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
175 (assoc-ref inputs "discount")
179 `(("discount" ,discount)))
181 "https://metacpan.org/release/Text-Markdown-Discount")
183 "Fast function for converting Markdown to HTML using Discount")
185 "Text::Markdown::Discount is a Perl extension to the Discount markdown
189 use Text::Markdown::Discount;
190 my $html = markdown($text)
192 (license perl-license)))
200 (uri (string-append "https://github.com/jgm/cmark/archive/"
202 (file-name (string-append name "-" version ".tar.gz"))
205 "1z71pacl3ni1286c206pl8lazbcd32ackivsg3zibdf1sf2qdjdc"))))
206 (build-system cmake-build-system)
208 '(#:test-target "test"))
209 (native-inputs `(("python" ,python)))
210 (synopsis "CommonMark Markdown reference implementation")
211 (description "CommonMark is a strongly defined, highly compatible
212 specification of Markdown. cmark is the C reference implementation of
213 CommonMark. It provides @code{libcmark} shared library for parsing
214 CommonMark to an abstract syntax tree (@dfn{AST}) and rendering the document
215 as HTML, groff man, LaTeX, CommonMark, or an XML representation of the
216 AST. The package also provides the command-line program @command{cmark}
217 for parsing and rendering CommonMark.")
218 (home-page "http://commonmark.org")
219 ;; cmark is distributed with a BSD-2 license, but some components are Expat
220 ;; licensed. The CommonMark specification is Creative Commons CC-BY-SA 4.0
221 ;; licensed. See 'COPYING' in the source distribution for more information.
222 (license (list bsd-2 expat cc-by-sa4.0))))
231 (uri (string-append "https://github.com/Gottox/smu/archive/v"
233 (file-name (string-append name "-" version ".tar.gz"))
236 "0iazl45rkz8ngsb5hpykl76w0ngvdvqqhym1qz5wykgmrzk293rp"))))
237 (build-system gnu-build-system)
239 `(#:make-flags (list "CC=gcc"
240 (string-append "PREFIX="
241 (assoc-ref %outputs "out")))
242 #:tests? #f ;No tests included
244 (modify-phases %standard-phases
245 (delete 'configure))))
246 (home-page "https://github.com/Gottox/smu")
247 (synopsis "Simple markup")
249 "Smu is a very simple and minimal markup language. It is
250 designed for using in wiki-like environments. Smu makes it very
251 easy to write your documents on the fly and convert them into HTML.
252 Smu is capable to parse very large documents. As long as you avoid an huge
253 amount of indents it scales just great.
255 Smu was started as a rewrite of Markdown but became something more
256 lightweight and consistent. The biggest difference between Markdown
257 and smu is that smu doesn't support reference style links.")