gnu: calibre: Wrap QTWEBENGINEPROCESS_PATH.
[jackhill/guix/guix.git] / gnu / packages / markup.scm
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 Nikita <nikita@n0.is>
6 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages markup)
25 #:use-module (guix licenses)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix packages)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system trivial)
31 #:use-module (guix build-system cmake)
32 #:use-module (guix build-system perl)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages web))
38
39 (define-public hoedown
40 (package
41 (name "hoedown")
42 (version "3.0.7")
43 (source (origin
44 (method git-fetch)
45 (uri (git-reference
46 (url "https://github.com/hoedown/hoedown")
47 (commit version)))
48 (file-name (git-file-name name version))
49 (sha256
50 (base32
51 "1kr3hxjg2dgmwy9738qgj3sh3f5cygx0zxskkfhrg7x19bq9yd26"))))
52 (build-system gnu-build-system)
53 (arguments
54 '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
55 #:phases (modify-phases %standard-phases
56 (delete 'configure)) ; no configure script
57 #:test-target "test"))
58 (native-inputs
59 `(("python" ,python-2)
60 ("tidy" ,tidy)))
61 (synopsis "Markdown processing library")
62 (description "Hoedown is a standards compliant, fast, secure markdown
63 processing library written in C.")
64 (home-page "https://github.com/hoedown/hoedown")
65 (license expat)))
66
67 (define-public markdown
68 (package
69 (name "markdown")
70 (version "1.0.1")
71 (source
72 (origin
73 (method url-fetch)
74 (uri (string-append
75 "http://daringfireball.net/projects/downloads/"
76 (string-capitalize name) "_" version ".zip"))
77 (sha256
78 (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
79 (build-system trivial-build-system)
80 (arguments
81 '(#:modules ((guix build utils))
82 #:builder
83 (begin
84 (use-modules (guix build utils))
85 (let ((source (assoc-ref %build-inputs "source"))
86 (out (assoc-ref %outputs "out"))
87 (perlbd (string-append (assoc-ref %build-inputs "perl") "/bin"))
88 (unzip (string-append (assoc-ref %build-inputs "unzip")
89 "/bin/unzip")))
90 (mkdir-p out)
91 (with-directory-excursion out
92 (invoke unzip source)
93 (mkdir "bin")
94 (mkdir-p "share/doc")
95 (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
96 (rename-file "Markdown_1.0.1/Markdown Readme.text"
97 "share/doc/README")
98 (patch-shebang "bin/markdown" (list perlbd))
99 (delete-file-recursively "Markdown_1.0.1"))
100 #t))))
101 (native-inputs `(("unzip" ,unzip)))
102 (inputs `(("perl" ,perl)))
103 (home-page "http://daringfireball.net/projects/markdown")
104 (synopsis "Text-to-HTML conversion tool")
105 (description
106 "Markdown is a text-to-HTML conversion tool for web writers. It allows
107 you to write using an easy-to-read, easy-to-write plain text format, then
108 convert it to structurally valid XHTML (or HTML).")
109 (license (non-copyleft "file://License.text"
110 "See License.text in the distribution."))))
111
112 (define-public discount
113 (package
114 (name "discount")
115 (version "2.2.4")
116 (source (origin
117 (method url-fetch)
118 (uri (string-append
119 "http://www.pell.portland.or.us/~orc/Code/"
120 "discount/discount-" version ".tar.bz2"))
121 (sha256
122 (base32
123 "199hwajpspqil0a4y3yxsmhdp2dm73gqkzfk4mrwzsmlq8y1xzbl"))))
124 (build-system gnu-build-system)
125 (arguments
126 `(#:test-target "test"
127 #:make-flags (list
128 (string-append "LFLAGS=-L. -Wl,-rpath="
129 (assoc-ref %outputs "out") "/lib"))
130 #:phases
131 (modify-phases %standard-phases
132 (add-before 'configure 'set-AC_PATH
133 (lambda _
134 ;; The default value is not suitable, so override using an
135 ;; environment variable. This just affects the build, and not the
136 ;; resulting store item.
137 (setenv "AC_PATH" (getenv "PATH"))
138 #t))
139 (replace 'configure
140 (lambda* (#:key inputs outputs #:allow-other-keys)
141 (setenv "CC" "gcc")
142 (invoke "./configure.sh"
143 (string-append "--prefix=" (assoc-ref outputs "out"))
144 "--shared"))))))
145 (synopsis "Markdown processing library, written in C")
146 (description
147 "Discount is a markdown implementation, written in C. It provides a
148 @command{markdown} command, and a library.")
149 (home-page "https://www.pell.portland.or.us/~orc/Code/discount/")
150 (license bsd-3)))
151
152 (define-public perl-text-markdown-discount
153 (package
154 (name "perl-text-markdown-discount")
155 (version "0.11")
156 (source
157 (origin
158 (method url-fetch)
159 (uri (string-append
160 "mirror://cpan/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-"
161 version
162 ".tar.gz"))
163 (sha256
164 (base32
165 "1xx7v3wnla7m6wa3h33whxw3vvincaicg4yra1b9wbzf2aix9rnw"))
166 (patches
167 (search-patches "perl-text-markdown-discount-unbundle.patch"))))
168 (build-system perl-build-system)
169 (arguments
170 `(#:phases
171 (modify-phases %standard-phases
172 (add-before 'build 'set-ldflags
173 (lambda* (#:key inputs #:allow-other-keys)
174 (substitute* "Makefile"
175 (("OTHERLDFLAGS = ")
176 (string-append
177 "OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
178 (assoc-ref inputs "discount")
179 "/lib")))
180 #t)))))
181 (inputs
182 `(("discount" ,discount)))
183 (home-page
184 "https://metacpan.org/release/Text-Markdown-Discount")
185 (synopsis
186 "Fast function for converting Markdown to HTML using Discount")
187 (description
188 "Text::Markdown::Discount is a Perl extension to the Discount markdown
189 implementation.
190
191 @example
192 use Text::Markdown::Discount;
193 my $html = markdown($text)
194 @end example")
195 (license perl-license)))
196
197 (define-public cmark
198 (package
199 (name "cmark")
200 (version "0.29.0")
201 (source (origin
202 (method git-fetch)
203 (uri (git-reference
204 (url "https://github.com/jgm/cmark")
205 (commit version)))
206 (file-name (git-file-name name version))
207 (sha256
208 (base32
209 "0r7jpqhgnssq444i8pwji2g36058vfzwkl70wbiwj13h4w5rfc8f"))
210 (modules '((guix build utils)))
211 (snippet
212 '(begin
213 ;; Mimic upstream commit 68c3a91166347 to fix a test failure
214 ;; when using Python 3.8. Remove for versions > 0.29.
215 ;; See <https://github.com/commonmark/cmark/issues/313>.
216 (substitute* "test/normalize.py"
217 (("cgi") "html"))
218 #t))))
219 (build-system cmake-build-system)
220 (arguments
221 '(#:test-target "test"))
222 (native-inputs `(("python" ,python)))
223 (synopsis "CommonMark Markdown reference implementation")
224 (description "CommonMark is a strongly defined, highly compatible
225 specification of Markdown. cmark is the C reference implementation of
226 CommonMark. It provides @code{libcmark} shared library for parsing
227 CommonMark to an abstract syntax tree (@dfn{AST}) and rendering the document
228 as HTML, groff man, LaTeX, CommonMark, or an XML representation of the
229 AST. The package also provides the command-line program @command{cmark}
230 for parsing and rendering CommonMark.")
231 (home-page "https://commonmark.org")
232 ;; cmark is distributed with a BSD-2 license, but some components are Expat
233 ;; licensed. The CommonMark specification is Creative Commons CC-BY-SA 4.0
234 ;; licensed. See 'COPYING' in the source distribution for more information.
235 (license (list bsd-2 expat cc-by-sa4.0))))
236
237 (define-public smu
238 (package
239 (name "smu")
240 (version "1.5")
241 (source
242 (origin
243 (method git-fetch)
244 (uri (git-reference
245 (url "https://github.com/Gottox/smu")
246 (commit (string-append "v" version))))
247 (file-name (git-file-name name version))
248 (sha256
249 (base32 "1jm7lhnzjx4q7gcwlkvsbffcy0zppywyh50d71ami6dnq182vvcc"))))
250 (build-system gnu-build-system)
251 (arguments
252 `(#:make-flags (list "CC=gcc"
253 (string-append "PREFIX="
254 (assoc-ref %outputs "out")))
255 #:tests? #f ; no tests included
256 #:phases
257 (modify-phases %standard-phases
258 (delete 'configure))))
259 (home-page "https://github.com/Gottox/smu")
260 (synopsis "Simple markup")
261 (description
262 "Smu is a very simple and minimal markup language. It is
263 designed for using in wiki-like environments. Smu makes it very
264 easy to write your documents on the fly and convert them into HTML.
265 Smu is capable to parse very large documents. As long as you avoid an huge
266 amount of indents it scales just great.
267
268 Smu was started as a rewrite of Markdown but became something more
269 lightweight and consistent. The biggest difference between Markdown
270 and smu is that smu doesn't support reference style links.")
271 (license x11)))