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