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>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
36 (define-public hoedown
42 (uri (string-append "https://github.com/hoedown/hoedown/archive/"
44 (file-name (string-append name "-" version ".tar.gz"))
47 "0859dc2xjasd6kgkshi8mb20kbyw5sql1ln0hw3bfaf33qdh5dh1"))))
48 (build-system gnu-build-system)
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"))
55 `(("python" ,python-2)
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")
63 (define-public markdown
71 "http://daringfireball.net/projects/downloads/"
72 (string-capitalize name) "_" version ".zip"))
74 (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
75 (build-system trivial-build-system)
77 '(#:modules ((guix build utils))
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")
87 (with-directory-excursion out
88 (system* unzip source)
91 (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
92 (rename-file "Markdown_1.0.1/Markdown Readme.text"
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")
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."))))
107 (define-public discount
114 "http://www.pell.portland.or.us/~orc/Code/"
115 name "/" name "-" version ".tar.bz2"))
116 (file-name (string-append name "-" version ".tar.gz"))
119 "0r4gjyk1ngx47zhb25q0gkjm3bz2m5x8ngrk6rim3y1y3rricygc"))))
120 (build-system gnu-build-system)
122 `(#:test-target "test"
124 (string-append "LFLAGS=-L. -Wl,-rpath="
125 (assoc-ref %outputs "out") "/lib"))
127 (modify-phases %standard-phases
128 (add-before 'configure 'set-AC_PATH
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"))
136 (lambda* (#:key inputs outputs #:allow-other-keys)
140 (string-append "--prefix=" (assoc-ref outputs "out"))
142 (synopsis "Markdown processing library, written in C")
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/")
149 (define-public perl-text-markdown-discount
151 (name "perl-text-markdown-discount")
157 "mirror://cpan/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-"
162 "1xx7v3wnla7m6wa3h33whxw3vvincaicg4yra1b9wbzf2aix9rnw"))
164 (search-patches "perl-text-markdown-discount-use-system-markdown.patch"))))
165 (build-system perl-build-system)
168 (modify-phases %standard-phases
169 (add-before 'build 'set-ldflags
170 (lambda* (#:key inputs #:allow-other-keys)
171 (substitute* "Makefile"
174 "OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
175 (assoc-ref inputs "discount")
178 `(("discount" ,discount)))
180 "http://search.cpan.org/dist/Text-Markdown-Discount")
182 "Fast function for converting Markdown to HTML using Discount")
184 "Text::Markdown::Discount is a Perl extension to the Discount markdown
188 use Text::Markdown::Discount;
189 my $html = markdown($text)
191 (license perl-license)))
199 (uri (string-append "https://github.com/jgm/cmark/archive/"
201 (file-name (string-append name "-" version ".tar.gz"))
204 "03pypf2mcacfa7lrwz66lh5hydsycc33arp1nx1lljbq98gikkv8"))))
205 (build-system cmake-build-system)
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))))
230 (uri (string-append "https://github.com/Gottox/smu/archive/v"
232 (file-name (string-append name "-" version ".tar.gz"))
235 "0iazl45rkz8ngsb5hpykl76w0ngvdvqqhym1qz5wykgmrzk293rp"))))
236 (build-system gnu-build-system)
238 `(#:make-flags (list "CC=gcc"
239 (string-append "PREFIX="
240 (assoc-ref %outputs "out")))
241 #:tests? #f ;No tests included
243 (modify-phases %standard-phases
244 (delete 'configure))))
245 (home-page "https://github.com/Gottox/smu")
246 (synopsis "Simple markup")
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.
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.")