gnu: Add wl-clipboard.
[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>
67eb3857 4;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4a78fd46 5;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
3a28209c 6;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7782d3a6
DT
7;;;
8;;; This file is part of GNU Guix.
9;;;
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.
14;;;
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.
19;;;
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/>.
22
e5eede3f 23(define-module (gnu packages markup)
7782d3a6
DT
24 #:use-module (guix licenses)
25 #:use-module (guix download)
26 #:use-module (guix packages)
27 #:use-module (guix build-system gnu)
bae87762 28 #:use-module (guix build-system trivial)
80588800 29 #:use-module (guix build-system cmake)
9d46919f 30 #:use-module (guix build-system perl)
148585c2 31 #:use-module (gnu packages compression)
9d46919f 32 #:use-module (gnu packages)
bae87762 33 #:use-module (gnu packages perl)
7782d3a6 34 #:use-module (gnu packages python)
148585c2 35 #:use-module (gnu packages web))
7782d3a6
DT
36
37(define-public hoedown
38 (package
39 (name "hoedown")
67eb3857 40 (version "3.0.7")
7782d3a6
DT
41 (source (origin
42 (method url-fetch)
43 (uri (string-append "https://github.com/hoedown/hoedown/archive/"
44 version ".tar.gz"))
45 (file-name (string-append name "-" version ".tar.gz"))
46 (sha256
47 (base32
67eb3857 48 "0859dc2xjasd6kgkshi8mb20kbyw5sql1ln0hw3bfaf33qdh5dh1"))))
7782d3a6
DT
49 (build-system gnu-build-system)
50 (arguments
606a106f
MW
51 '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
52 #:phases (modify-phases %standard-phases
7782d3a6
DT
53 (delete 'configure)) ; no configure script
54 #:test-target "test"))
55 (native-inputs
56 `(("python" ,python-2)
57 ("tidy" ,tidy)))
58 (synopsis "Markdown processing library")
59 (description "Hoedown is a standards compliant, fast, secure markdown
60processing library written in C.")
61 (home-page "https://github.com/hoedown/hoedown")
62 (license expat)))
bae87762
ML
63
64(define-public markdown
65 (package
66 (name "markdown")
67 (version "1.0.1")
68 (source
69 (origin
70 (method url-fetch)
71 (uri (string-append
72 "http://daringfireball.net/projects/downloads/"
73 (string-capitalize name) "_" version ".zip"))
74 (sha256
75 (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
76 (build-system trivial-build-system)
77 (arguments
78 '(#:modules ((guix build utils))
79 #:builder
80 (begin
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")
86 "/bin/unzip")))
87 (mkdir-p out)
88 (with-directory-excursion out
e3cfef22 89 (invoke unzip source)
bae87762
ML
90 (mkdir "bin")
91 (mkdir-p "share/doc")
92 (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
93 (rename-file "Markdown_1.0.1/Markdown Readme.text"
94 "share/doc/README")
95 (patch-shebang "bin/markdown" (list perlbd))
e3cfef22
MW
96 (delete-file-recursively "Markdown_1.0.1"))
97 #t))))
bae87762
ML
98 (native-inputs `(("unzip" ,unzip)))
99 (inputs `(("perl" ,perl)))
100 (home-page "http://daringfireball.net/projects/markdown")
101 (synopsis "Text-to-HTML conversion tool")
102 (description
103 "Markdown is a text-to-HTML conversion tool for web writers. It allows
104you to write using an easy-to-read, easy-to-write plain text format, then
105convert it to structurally valid XHTML (or HTML).")
106 (license (non-copyleft "file://License.text"
107 "See License.text in the distribution."))))
80588800 108
31d3a7c7
CB
109(define-public discount
110 (package
111 (name "discount")
7e72f547 112 (version "2.2.4")
31d3a7c7
CB
113 (source (origin
114 (method url-fetch)
115 (uri (string-append
116 "http://www.pell.portland.or.us/~orc/Code/"
117 name "/" name "-" version ".tar.bz2"))
31d3a7c7
CB
118 (sha256
119 (base32
7e72f547 120 "199hwajpspqil0a4y3yxsmhdp2dm73gqkzfk4mrwzsmlq8y1xzbl"))))
31d3a7c7
CB
121 (build-system gnu-build-system)
122 (arguments
123 `(#:test-target "test"
124 #:make-flags (list
125 (string-append "LFLAGS=-L. -Wl,-rpath="
126 (assoc-ref %outputs "out") "/lib"))
127 #:phases
128 (modify-phases %standard-phases
129 (add-before 'configure 'set-AC_PATH
130 (lambda _
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"))
135 #t))
136 (replace 'configure
137 (lambda* (#:key inputs outputs #:allow-other-keys)
138 (setenv "CC" "gcc")
3a28209c 139 (invoke "./configure.sh"
31d3a7c7 140 (string-append "--prefix=" (assoc-ref outputs "out"))
3a28209c 141 "--shared"))))))
31d3a7c7
CB
142 (synopsis "Markdown processing library, written in C")
143 (description
144 "Discount is a markdown implementation, written in C. It provides a
145@command{markdown} command, and a library.")
7fcb3935 146 (home-page "https://www.pell.portland.or.us/~orc/Code/discount/")
31d3a7c7
CB
147 (license bsd-3)))
148
9d46919f
CB
149(define-public perl-text-markdown-discount
150 (package
151 (name "perl-text-markdown-discount")
152 (version "0.11")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (string-append
157 "mirror://cpan/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-"
158 version
159 ".tar.gz"))
160 (sha256
161 (base32
162 "1xx7v3wnla7m6wa3h33whxw3vvincaicg4yra1b9wbzf2aix9rnw"))
163 (patches
1da3d2a3 164 (search-patches "perl-text-markdown-discount-unbundle.patch"))))
9d46919f
CB
165 (build-system perl-build-system)
166 (arguments
167 `(#:phases
168 (modify-phases %standard-phases
169 (add-before 'build 'set-ldflags
170 (lambda* (#:key inputs #:allow-other-keys)
171 (substitute* "Makefile"
172 (("OTHERLDFLAGS = ")
173 (string-append
174 "OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
175 (assoc-ref inputs "discount")
4851af9e
MW
176 "/lib")))
177 #t)))))
9d46919f
CB
178 (inputs
179 `(("discount" ,discount)))
180 (home-page
9aba9b12 181 "https://metacpan.org/release/Text-Markdown-Discount")
9d46919f
CB
182 (synopsis
183 "Fast function for converting Markdown to HTML using Discount")
184 (description
185 "Text::Markdown::Discount is a Perl extension to the Discount markdown
186implementation.
187
188@example
189 use Text::Markdown::Discount;
190 my $html = markdown($text)
191@end example")
192 (license perl-license)))
193
80588800
EE
194(define-public cmark
195 (package
196 (name "cmark")
e7ef061b 197 (version "0.28.3")
80588800
EE
198 (source (origin
199 (method url-fetch)
200 (uri (string-append "https://github.com/jgm/cmark/archive/"
201 version ".tar.gz"))
202 (file-name (string-append name "-" version ".tar.gz"))
203 (sha256
204 (base32
e7ef061b 205 "1z71pacl3ni1286c206pl8lazbcd32ackivsg3zibdf1sf2qdjdc"))))
80588800
EE
206 (build-system cmake-build-system)
207 (arguments
208 '(#:test-target "test"))
209 (native-inputs `(("python" ,python)))
210 (synopsis "CommonMark Markdown reference implementation")
211 (description "CommonMark is a strongly defined, highly compatible
212specification of Markdown. cmark is the C reference implementation of
213CommonMark. It provides @code{libcmark} shared library for parsing
554245da 214CommonMark to an abstract syntax tree (@dfn{AST}) and rendering the document
80588800
EE
215as HTML, groff man, LaTeX, CommonMark, or an XML representation of the
216AST. The package also provides the command-line program @command{cmark}
217for 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))))
83f0d3a5 223
224(define-public smu
225 (package
226 (name "smu")
227 (version "1.4")
228 (source
229 (origin
230 (method url-fetch)
231 (uri (string-append "https://github.com/Gottox/smu/archive/v"
232 version ".tar.gz"))
233 (file-name (string-append name "-" version ".tar.gz"))
234 (sha256
235 (base32
236 "0iazl45rkz8ngsb5hpykl76w0ngvdvqqhym1qz5wykgmrzk293rp"))))
237 (build-system gnu-build-system)
238 (arguments
239 `(#:make-flags (list "CC=gcc"
240 (string-append "PREFIX="
241 (assoc-ref %outputs "out")))
242 #:tests? #f ;No tests included
243 #:phases
244 (modify-phases %standard-phases
245 (delete 'configure))))
246 (home-page "https://github.com/Gottox/smu")
247 (synopsis "Simple markup")
248 (description
249 "Smu is a very simple and minimal markup language. It is
250designed for using in wiki-like environments. Smu makes it very
251easy to write your documents on the fly and convert them into HTML.
252Smu is capable to parse very large documents. As long as you avoid an huge
253amount of indents it scales just great.
254
255Smu was started as a rewrite of Markdown but became something more
256lightweight and consistent. The biggest difference between Markdown
257and smu is that smu doesn't support reference style links.")
258 (license x11)))