Commit graph

46 commits

Author SHA1 Message Date
Christian Muehlhaeuser
e8152b914f
Use pixterm to render images 2019-11-25 22:24:22 +01:00
Christian Muehlhaeuser
b7fc18e6e0 Fix word-wrapping in colored output 2019-11-25 10:04:55 +01:00
Christian Muehlhaeuser
501f4e3b6a Disable syntax highlighting when output is no terminal 2019-11-25 07:58:13 +01:00
Christian Muehlhaeuser
959958d280 Unescape sanitized HTML 2019-11-25 07:28:58 +01:00
Christian Muehlhaeuser
b25fcb31fb HTML-sanitize all text elements 2019-11-25 07:16:22 +01:00
Christian Muehlhaeuser
9589289d60 Basic GitLab support 2019-11-25 06:57:44 +01:00
Christian Muehlhaeuser
f8cc1b7e02 Strip HTML tags and render plain-text content only 2019-11-25 06:45:55 +01:00
Christian Muehlhaeuser
10da623e26 Word-wrap text at 100 chars per default
The default can be overwritten by the user:

./gold -w 80
2019-11-25 06:44:10 +01:00
Christian Muehlhaeuser
67685a4ebe Let user pick a syntax color theme in Gold's style config 2019-11-25 06:02:50 +01:00
Christian Muehlhaeuser
51ffc0d1ad Enable code highlighting with chroma 2019-11-25 05:47:14 +01:00
Christian Muehlhaeuser
9291f45faa Move style handling to style.go 2019-11-25 05:19:47 +01:00
Christian Muehlhaeuser
31d8ca6346 Check for supported HTTP/HTTPS protocols explicitly 2019-11-25 05:15:35 +01:00
Christian Muehlhaeuser
4e4fca4e34 Update README 2019-11-25 05:04:17 +01:00
Christian Muehlhaeuser
66e19cac3c Link to cmd/gold instead of main.go 2019-11-25 05:00:01 +01:00
Christian Muehlhaeuser
8b2817be1f Support github URLs without protocol 2019-11-25 04:55:54 +01:00
Christian Muehlhaeuser
c604c99640 Use a plain-text renderer when not printing to Terminal 2019-11-25 04:32:24 +01:00
Christian Muehlhaeuser
b289f59056 Handle nested content inside links 2019-11-25 02:40:34 +01:00
Christian Muehlhaeuser
b600bc47ef Use ElementStyles to determine rendering style
Since BlackFriday's Nodes are limiting us a bit in rendering
flexibility, I've introduced Gold's own ElementStyles (a bit of
code repetition here, but alas).

Nodes can now be divided into multiple fragments, which means we
are able to display the link's URL and text in different styles.

Updated the dark theme to demo the newly gained flexibility.
2019-11-24 23:33:25 +01:00
Toby Padilla
d3fbd57839 Move Render and RenderBytes to TermRenderer 2019-11-24 13:35:01 -06:00
Christian Muehlhaeuser
0ef5821e6a Add screenshot of dark theme 2019-11-24 05:21:12 +01:00
Christian Muehlhaeuser
b60105d515 Fix new-line before first paragraph 2019-11-24 05:09:07 +01:00
Christian Muehlhaeuser
2961562967 Find README(.md) in current working dir when no arg was supplied 2019-11-24 05:07:14 +01:00
Christian Muehlhaeuser
d0d74077c8 Fix line-break before list items 2019-11-24 04:44:12 +01:00
Christian Muehlhaeuser
5bb6091094 Fix markdown rendering for first and last paragraphs 2019-11-24 04:20:35 +01:00
Christian Muehlhaeuser
605848a4da Fix line-break issues in markdown rendering
Fixes #3.
2019-11-24 04:08:54 +01:00
Christian Muehlhaeuser
9d14f27700 Fix rendering of list items 2019-11-24 03:51:30 +01:00
Christian Muehlhaeuser
8ce98625ab Cleanup/simplify main.go 2019-11-24 02:41:03 +01:00
Christian Muehlhaeuser
b4f76ed085 Add goreleaser config to help automate builds for various platforms
We're currently building the following targets:
- Linux 386/x64/armv6/arm64
- Windows 386/x64
- macOS x64
2019-11-24 02:39:02 +01:00
Christian Muehlhaeuser
354439e273 Support fetching markdown from arbitrary HTTP sources 2019-11-24 02:04:12 +01:00
Christian Muehlhaeuser
2b0603a675 Update gold usage in README 2019-11-22 18:48:22 +01:00
Christian Muehlhaeuser
2774bf7e60 Use cobra to handle command line parameters 2019-11-22 18:47:42 +01:00
Christian Muehlhaeuser
41f9c1792e Support reading from stdin
When you start gold with "-" as an argument it will read directly
from stdin, instead of opening a file.

Example calls:

./gold -s dark.json README.md

or

cat README.md | ./gold -s dark.json
2019-11-22 04:23:02 +01:00
Christian Muehlhaeuser
55eb9ee65a
Support fetching READMEs from GitHub
When passing a valid GitHub URL instead of a filename to gold,
it will fetch either README.md or README (in that order) from
GitHub and displays the markdown content.

Example:

./gold -s dark.json https://github.com/muesli/beehive
2019-11-22 03:52:21 +01:00
Toby Padilla
abdc2bb390 Update repo org 2019-11-15 12:35:04 -06:00
Toby Padilla
9fb7e211ba Link to main.go 2019-11-15 12:28:33 -06:00
Toby Padilla
892e2e0198 README and LICENSE 2019-11-15 12:27:41 -06:00
Toby Padilla
3b0f6f8207 Update repo org 2019-11-15 12:02:39 -06:00
Toby Padilla
1642207b78 Remove redundant else 2019-11-15 12:01:12 -06:00
Toby Padilla
f6dd895862 Move important stuff up top 2019-11-12 16:39:26 -05:00
Toby Padilla
218aff99ae Remove blackfriday requirement from clients 2019-11-12 16:36:51 -05:00
Toby Padilla
985a7e5178 Fix child element rendering 2019-11-12 15:53:11 -05:00
Toby Padilla
132da36b1a Remove old consts 2019-11-09 16:29:04 -06:00
Toby Padilla
a1f213d1af Remove test md 2019-11-09 16:24:57 -06:00
Toby Padilla
9701392dc4 Much better parsing, README example 2019-11-09 16:12:54 -06:00
Toby Padilla
a89ebe80b5 Load style from json 2019-11-09 14:07:01 -06:00
Toby Padilla
f3c759655a init 2019-11-04 17:35:50 -06:00