gnu: fontconfig: Add replacement with font-dejavu instead of gs-fonts.
[jackhill/guix/guix.git] / gnu / packages / markup.scm
CommitLineData
7782d3a6 1;;; GNU Guix --- Functional package management for GNU
bae87762 2;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
7782d3a6 3;;; Copyright © 2015 David Thompson <davet@gnu.org>
d71af69d 4;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
3c986a7d 5;;; Copyright © 2017 Nikita <nikita@n0.is>
67e4abc5 6;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
49279343 7;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
7782d3a6
DT
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
e5eede3f 24(define-module (gnu packages markup)
7782d3a6
DT
25 #:use-module (guix licenses)
26 #:use-module (guix download)
62b3a9b4 27 #:use-module (guix git-download)
7782d3a6
DT
28 #:use-module (guix packages)
29 #:use-module (guix build-system gnu)
bae87762 30 #:use-module (guix build-system trivial)
80588800 31 #:use-module (guix build-system cmake)
9d46919f 32 #:use-module (guix build-system perl)
148585c2 33 #:use-module (gnu packages compression)
9d46919f 34 #:use-module (gnu packages)
bae87762 35 #:use-module (gnu packages perl)
7782d3a6 36 #:use-module (gnu packages python)
148585c2 37 #:use-module (gnu packages web))
7782d3a6
DT
38
39(define-public hoedown
40 (package
41 (name "hoedown")
67eb3857 42 (version "3.0.7")
7782d3a6 43 (source (origin
d71af69d
EF
44 (method git-fetch)
45 (uri (git-reference
46 (url "https://github.com/hoedown/hoedown.git")
47 (commit version)))
48 (file-name (git-file-name name version))
7782d3a6
DT
49 (sha256
50 (base32
d71af69d 51 "1kr3hxjg2dgmwy9738qgj3sh3f5cygx0zxskkfhrg7x19bq9yd26"))))
7782d3a6
DT
52 (build-system gnu-build-system)
53 (arguments
606a106f
MW
54 '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
55 #:phases (modify-phases %standard-phases
7782d3a6
DT
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
63processing library written in C.")
64 (home-page "https://github.com/hoedown/hoedown")
65 (license expat)))
bae87762
ML
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
e3cfef22 92 (invoke unzip source)
bae87762
ML
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))
e3cfef22
MW
99 (delete-file-recursively "Markdown_1.0.1"))
100 #t))))
bae87762
ML
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
107you to write using an easy-to-read, easy-to-write plain text format, then
108convert it to structurally valid XHTML (or HTML).")
109 (license (non-copyleft "file://License.text"
110 "See License.text in the distribution."))))
80588800 111
31d3a7c7
CB
112(define-public discount
113 (package
114 (name "discount")
7e72f547 115 (version "2.2.4")
31d3a7c7
CB
116 (source (origin
117 (method url-fetch)
118 (uri (string-append
119 "http://www.pell.portland.or.us/~orc/Code/"
ad0b91bd 120 "discount/discount-" version ".tar.bz2"))
31d3a7c7
CB
121 (sha256
122 (base32
7e72f547 123 "199hwajpspqil0a4y3yxsmhdp2dm73gqkzfk4mrwzsmlq8y1xzbl"))))
31d3a7c7
CB
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")
3a28209c 142 (invoke "./configure.sh"
31d3a7c7 143 (string-append "--prefix=" (assoc-ref outputs "out"))
3a28209c 144 "--shared"))))))
31d3a7c7
CB
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.")
7fcb3935 149 (home-page "https://www.pell.portland.or.us/~orc/Code/discount/")
31d3a7c7
CB
150 (license bsd-3)))
151
9d46919f
CB
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
1da3d2a3 167 (search-patches "perl-text-markdown-discount-unbundle.patch"))))
9d46919f
CB
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")
4851af9e
MW
179 "/lib")))
180 #t)))))
9d46919f
CB
181 (inputs
182 `(("discount" ,discount)))
183 (home-page
9aba9b12 184 "https://metacpan.org/release/Text-Markdown-Discount")
9d46919f
CB
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
189implementation.
190
191@example
192 use Text::Markdown::Discount;
193 my $html = markdown($text)
194@end example")
195 (license perl-license)))
196
80588800
EE
197(define-public cmark
198 (package
199 (name "cmark")
88409717 200 (version "0.29.0")
80588800 201 (source (origin
2c24b96b
EF
202 (method git-fetch)
203 (uri (git-reference
204 (url "https://github.com/jgm/cmark.git")
205 (commit version)))
206 (file-name (git-file-name name version))
80588800
EE
207 (sha256
208 (base32
49279343
MB
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))))
80588800
EE
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
225specification of Markdown. cmark is the C reference implementation of
226CommonMark. It provides @code{libcmark} shared library for parsing
554245da 227CommonMark to an abstract syntax tree (@dfn{AST}) and rendering the document
80588800
EE
228as HTML, groff man, LaTeX, CommonMark, or an XML representation of the
229AST. The package also provides the command-line program @command{cmark}
230for parsing and rendering CommonMark.")
231 (home-page "http://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))))
83f0d3a5 236
237(define-public smu
238 (package
239 (name "smu")
67e4abc5 240 (version "1.5")
83f0d3a5 241 (source
242 (origin
62b3a9b4
TGR
243 (method git-fetch)
244 (uri (git-reference
245 (url "https://github.com/Gottox/smu.git")
246 (commit (string-append "v" version))))
247 (file-name (git-file-name name version))
83f0d3a5 248 (sha256
62b3a9b4 249 (base32 "1jm7lhnzjx4q7gcwlkvsbffcy0zppywyh50d71ami6dnq182vvcc"))))
83f0d3a5 250 (build-system gnu-build-system)
251 (arguments
252 `(#:make-flags (list "CC=gcc"
253 (string-append "PREFIX="
254 (assoc-ref %outputs "out")))
67e4abc5 255 #:tests? #f ; no tests included
83f0d3a5 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
263designed for using in wiki-like environments. Smu makes it very
264easy to write your documents on the fly and convert them into HTML.
265Smu is capable to parse very large documents. As long as you avoid an huge
266amount of indents it scales just great.
267
268Smu was started as a rewrite of Markdown but became something more
269lightweight and consistent. The biggest difference between Markdown
270and smu is that smu doesn't support reference style links.")
271 (license x11)))