Merge branch 'master' into core-updates
[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 (gnu packages compression)
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages python)
32 #:use-module (gnu packages web))
33
34 (define-public hoedown
35 (package
36 (name "hoedown")
37 (version "3.0.7")
38 (source (origin
39 (method url-fetch)
40 (uri (string-append "https://github.com/hoedown/hoedown/archive/"
41 version ".tar.gz"))
42 (file-name (string-append name "-" version ".tar.gz"))
43 (sha256
44 (base32
45 "0859dc2xjasd6kgkshi8mb20kbyw5sql1ln0hw3bfaf33qdh5dh1"))))
46 (build-system gnu-build-system)
47 (arguments
48 '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
49 #:phases (modify-phases %standard-phases
50 (delete 'configure)) ; no configure script
51 #:test-target "test"))
52 (native-inputs
53 `(("python" ,python-2)
54 ("tidy" ,tidy)))
55 (synopsis "Markdown processing library")
56 (description "Hoedown is a standards compliant, fast, secure markdown
57 processing library written in C.")
58 (home-page "https://github.com/hoedown/hoedown")
59 (license expat)))
60
61 (define-public markdown
62 (package
63 (name "markdown")
64 (version "1.0.1")
65 (source
66 (origin
67 (method url-fetch)
68 (uri (string-append
69 "http://daringfireball.net/projects/downloads/"
70 (string-capitalize name) "_" version ".zip"))
71 (sha256
72 (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
73 (build-system trivial-build-system)
74 (arguments
75 '(#:modules ((guix build utils))
76 #:builder
77 (begin
78 (use-modules (guix build utils))
79 (let ((source (assoc-ref %build-inputs "source"))
80 (out (assoc-ref %outputs "out"))
81 (perlbd (string-append (assoc-ref %build-inputs "perl") "/bin"))
82 (unzip (string-append (assoc-ref %build-inputs "unzip")
83 "/bin/unzip")))
84 (mkdir-p out)
85 (with-directory-excursion out
86 (system* unzip source)
87 (mkdir "bin")
88 (mkdir-p "share/doc")
89 (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
90 (rename-file "Markdown_1.0.1/Markdown Readme.text"
91 "share/doc/README")
92 (patch-shebang "bin/markdown" (list perlbd))
93 (delete-file-recursively "Markdown_1.0.1"))))))
94 (native-inputs `(("unzip" ,unzip)))
95 (inputs `(("perl" ,perl)))
96 (home-page "http://daringfireball.net/projects/markdown")
97 (synopsis "Text-to-HTML conversion tool")
98 (description
99 "Markdown is a text-to-HTML conversion tool for web writers. It allows
100 you to write using an easy-to-read, easy-to-write plain text format, then
101 convert it to structurally valid XHTML (or HTML).")
102 (license (non-copyleft "file://License.text"
103 "See License.text in the distribution."))))
104
105 (define-public cmark
106 (package
107 (name "cmark")
108 (version "0.28.0")
109 (source (origin
110 (method url-fetch)
111 (uri (string-append "https://github.com/jgm/cmark/archive/"
112 version ".tar.gz"))
113 (file-name (string-append name "-" version ".tar.gz"))
114 (sha256
115 (base32
116 "03pypf2mcacfa7lrwz66lh5hydsycc33arp1nx1lljbq98gikkv8"))))
117 (build-system cmake-build-system)
118 (arguments
119 '(#:test-target "test"))
120 (native-inputs `(("python" ,python)))
121 (synopsis "CommonMark Markdown reference implementation")
122 (description "CommonMark is a strongly defined, highly compatible
123 specification of Markdown. cmark is the C reference implementation of
124 CommonMark. It provides @code{libcmark} shared library for parsing
125 CommonMark to an abstract syntax tree (AST) and rendering the document
126 as HTML, groff man, LaTeX, CommonMark, or an XML representation of the
127 AST. The package also provides the command-line program @command{cmark}
128 for parsing and rendering CommonMark.")
129 (home-page "http://commonmark.org")
130 ;; cmark is distributed with a BSD-2 license, but some components are Expat
131 ;; licensed. The CommonMark specification is Creative Commons CC-BY-SA 4.0
132 ;; licensed. See 'COPYING' in the source distribution for more information.
133 (license (list bsd-2 expat cc-by-sa4.0))))
134
135 (define-public smu
136 (package
137 (name "smu")
138 (version "1.4")
139 (source
140 (origin
141 (method url-fetch)
142 (uri (string-append "https://github.com/Gottox/smu/archive/v"
143 version ".tar.gz"))
144 (file-name (string-append name "-" version ".tar.gz"))
145 (sha256
146 (base32
147 "0iazl45rkz8ngsb5hpykl76w0ngvdvqqhym1qz5wykgmrzk293rp"))))
148 (build-system gnu-build-system)
149 (arguments
150 `(#:make-flags (list "CC=gcc"
151 (string-append "PREFIX="
152 (assoc-ref %outputs "out")))
153 #:tests? #f ;No tests included
154 #:phases
155 (modify-phases %standard-phases
156 (delete 'configure))))
157 (home-page "https://github.com/Gottox/smu")
158 (synopsis "Simple markup")
159 (description
160 "Smu is a very simple and minimal markup language. It is
161 designed for using in wiki-like environments. Smu makes it very
162 easy to write your documents on the fly and convert them into HTML.
163 Smu is capable to parse very large documents. As long as you avoid an huge
164 amount of indents it scales just great.
165
166 Smu was started as a rewrite of Markdown but became something more
167 lightweight and consistent. The biggest difference between Markdown
168 and smu is that smu doesn't support reference style links.")
169 (license x11)))