README.md
1Showdown
2========
3
4Showdown is a simple [Markdown] viewer written in [Vala] and [GTK]. It
5converts Markdown into HTML, then presents it in a [WebKit2GTK] view. So
6instead of doing this:
7
8 markdown somefile.md > tmp.html
9 $BROWSER tmp.html
10 rm tmp.html
11
12you can use:
13
14 showdown somefile.md
15
16Features
17--------
18
19* GitHub inspired default stylesheet.
20* Table of contents navigation.
21* Integrated search bar
22* User styles (`~/.config/showdown/stylesheet.css`)
23* User scripts (`~/.config/showdown/script.js`)
24
25Screenshot
26----------
27
28![Showdown screenshot](https://craigbarnes.bitbucket.io/img/showdown.png)
29
30Installing
31----------
32
33The easiest way to install Showdown is via [Flatpak] (0.8+), using the command:
34
35 flatpak install https://craigbarnes.gitlab.io/showdown/showdown.flatpakref
36
37Building
38--------
39
40To build Showdown from source, first install the following dependencies:
41
42* [Vala]
43* [GNU Make] (3.81+)
44* [GTK] (3.20+)
45* [GLib] (2.48+)
46* [WebKit2GTK] (2.8.4+)
47* [Discount] (2.1.7+)
48* [xmllint] (*optional* -- used to shrink XML [resources], if available)
49
50...which are available via package manager on most Linux distros:
51
52 # Debian 8+/Ubuntu 15.04+:
53 sudo apt-get -y install valac gcc make libgtk-3-dev libwebkit2gtk-4.0-dev libmarkdown2-dev libxml2-utils
54
55 # Fedora 21+:
56 sudo dnf -y install vala gcc make webkitgtk4-devel libmarkdown-devel libxml2
57
58 # Arch Linux
59 # (Compile and install Discount, either from source or via AUR)
60 sudo pacman --needed -Sy vala gcc make webkitgtk libxml2
61
62...then download and extract the latest release tarball:
63
64 curl -LO https://craigbarnes.gitlab.io/dist/showdown/showdown-0.6.tar.gz
65 tar -xzf showdown-0.6.tar.gz
66 cd showdown-0.6/
67
68...and compile and install:
69
70 make && sudo make install
71
72Packaging
73---------
74
75**Variables:**
76
77The makefile supports most common packaging conventions, such as the
78[`DESTDIR`] variable and various other [install path variables].
79
80Example usage:
81
82 make V=1
83 make install V=1 prefix=/usr DESTDIR=PKG
84
85**Post-install commands:**
86
87The makefile automatically [updates][POSTINSTALL] the system icon and
88MIME type caches after installation, *unless* the `DESTDIR` variable is
89set.
90
91If `DESTDIR` is set, it is assumed that the installation is being used
92for packaging purposes, in which case the packager should use the
93equivalent, distro-provided macros/hooks instead. The icon and MIME
94type caches should also be updated after *uninstallation*.
95
96License
97-------
98
99Copyright (C) 2015-2017 Craig Barnes
100
101This program is free software; you can redistribute it and/or modify it
102under the terms of the GNU [General Public License version 3], as published
103by the Free Software Foundation.
104
105This program is distributed in the hope that it will be useful, but
106WITHOUT ANY WARRANTY; without even the implied warranty of
107MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
108Public License version 3 for more details.
109
110
111[General Public License version 3]: https://www.gnu.org/licenses/gpl-3.0.html
112[Markdown]: https://en.wikipedia.org/wiki/Markdown
113[Vala]: https://wiki.gnome.org/Projects/Vala
114[GTK]: https://www.gtk.org/
115[GLib]: https://developer.gnome.org/glib/
116[GNU Make]: https://www.gnu.org/software/make/
117[Discount]: http://www.pell.portland.or.us/~orc/Code/discount/
118[WebKit2GTK]: https://webkitgtk.org/
119[Flatpak]: http://flatpak.org/
120[xmllint]: http://xmlsoft.org/xmllint.html
121[resources]: https://github.com/craigbarnes/showdown/blob/master/res/resources.xml
122[`DESTDIR`]: https://www.gnu.org/prep/standards/html_node/DESTDIR.html
123[install path variables]: https://github.com/craigbarnes/showdown/blob/master/GNUmakefile#L8-L14
124[POSTINSTALL]: https://github.com/craigbarnes/showdown/blob/master/GNUmakefile#L19-L23
125