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