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