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