Commit Graph
59 Commits
Author SHA1 Message Date
Christian Muehlhaeuser 35342a2061 Decode style JSON into a typed struct 2019-12-13 03:04:48 +01:00
Christian Muehlhaeuser e310343e4a Support rendering definition lists 2019-12-13 03:00:45 +01:00
Christian Muehlhaeuser 0a3ba0ae35 Support strikethrough elements 2019-12-13 03:00:45 +01:00
Christian Muehlhaeuser 7c15f8780e Remove header/footer functions from blackfriday 2019-12-13 03:00:45 +01:00
Christian Muehlhaeuser 07f52dd42a Switch to goldmark parser 2019-12-13 03:00:45 +01:00
Christian Muehlhaeuser 50046dd6b3 Move text sanitizing to RenderContext 2019-12-10 17:32:49 +01:00
Christian Muehlhaeuser 9e615ab474 Remove (now) superfluous NewPlainTermRenderer 2019-12-10 17:19:29 +01:00
Christian Muehlhaeuser fd9a0d6f25 Add godoc comments to public types 2019-12-10 17:18:59 +01:00
Christian Muehlhaeuser 58f00893c7 Use strings.TrimPrefix to simplify code 2019-12-10 15:56:02 +01:00
Christian Muehlhaeuser 81d39f19bc Handle relative URLs with empty path 2019-12-10 10:49:46 +01:00
Christian Muehlhaeuser b4c77e8101 Add BlockStack.Len() for convenience 2019-12-08 13:52:22 +01:00
Christian Muehlhaeuser 71e84251b3 Calculate block width from BlockStack & RenderContext 2019-12-07 19:49:24 +01:00
Christian Muehlhaeuser 897b2dbd1e Decouple render elements from blackfriday parser 2019-12-07 18:48:08 +01:00
Christian Muehlhaeuser 665477d690 Move stateful objects to RenderContext struct 2019-12-07 15:40:42 +01:00
Christian Muehlhaeuser 37a171cc8e Simplify TermRender init 2019-12-07 09:28:29 +01:00
Christian Muehlhaeuser 6fe32ed145 Embed styles in gold library 2019-12-06 01:34:27 +01:00
Christian Muehlhaeuser 78e36a02d0 Use ElementStyle as a value instead of pointer, so we can drop all the annoying nil checks 2019-12-05 18:05:29 +01:00
Christian Muehlhaeuser 5096c6696e Write Element's Entering-output to the correct buffer 2019-12-04 13:54:17 +01:00
Christian Muehlhaeuser 038f2dd684 Handle write buffers & cascading styles in BlockStack 2019-12-04 13:36:31 +01:00
Christian Muehlhaeuser afd83210ea Simplify code 2019-12-04 05:38:54 +01:00
Christian Muehlhaeuser d0b616b12b Children in a Document or Paragraph element inherit their parent's color styles 2019-12-02 15:23:45 +01:00
Christian Muehlhaeuser bbd7dfecce Initialize paragraph buffer in ParagraphElement 2019-12-02 15:22:30 +01:00
Christian Muehlhaeuser d6d52829bb Make document indentable 2019-11-30 08:07:40 +01:00
Christian Muehlhaeuser d37d023d5d Support styled indents for block elements 2019-11-30 06:43:13 +01:00
Christian Muehlhaeuser e768cd63bf Use io.Writer directly instead of using Fprintf to print strings 2019-11-28 05:48:31 +01:00
Christian Muehlhaeuser 59b8ecde6d Render each paragraph individually and reflow text only inside paragraphs 2019-11-28 02:23:29 +01:00
Christian Muehlhaeuser 8f086bc134 Drop redundant TableData struct 2019-11-26 04:37:30 +01:00
Christian Muehlhaeuser 8fd35dc929 Simplify & cleanup RenderNode 2019-11-26 04:28:35 +01:00
Christian Muehlhaeuser 9eee4b13c3 Table rendering (#40)
Renders markdown tables.
2019-11-26 04:21:22 +01:00
Christian Muehlhaeuser 8f083a1043 Clean up pre/post ambiguity 2019-11-26 03:55:43 +01:00
Christian Muehlhaeuser c0d32b4fcb Abort on rendering error 2019-11-26 03:33:02 +01:00
Christian Muehlhaeuser 24a6306e1a Use a Renderer interface instead of rendering fragments 2019-11-26 03:24:56 +01:00
Christian Muehlhaeuser d438c26548 Correctly render nested lists 2019-11-26 01:20:59 +01:00
Christian Muehlhaeuser 18e173b10d Handle relative URLs in markdown, when a BaseURL is provided 2019-11-26 00:35:11 +01:00
Christian Muehlhaeuser c2af06bed0 Fix word-wrapping in colored output 2019-11-25 10:04:55 +01:00
Christian Muehlhaeuser 4de0a10e9e Disable syntax highlighting when output is no terminal 2019-11-25 07:58:13 +01:00
Christian Muehlhaeuser ef9ee10b74 Unescape sanitized HTML 2019-11-25 07:28:58 +01:00
Christian Muehlhaeuser 66d599db99 HTML-sanitize all text elements 2019-11-25 07:16:22 +01:00
Christian Muehlhaeuser fb7c07f593 Strip HTML tags and render plain-text content only 2019-11-25 06:45:55 +01:00
Christian Muehlhaeuser 937e525993 Let user pick a syntax color theme in Gold's style config 2019-11-25 06:02:50 +01:00
Christian Muehlhaeuser e6a9122041 Enable code highlighting with chroma 2019-11-25 05:47:14 +01:00
Christian Muehlhaeuser 16c2b7a239 Move style handling to style.go 2019-11-25 05:19:47 +01:00
Christian Muehlhaeuser 450c551f08 Use a plain-text renderer when not printing to Terminal 2019-11-25 04:32:24 +01:00
Christian Muehlhaeuser 6eb2d04812 Handle nested content inside links 2019-11-25 02:40:34 +01:00
Christian Muehlhaeuser d082cb2124 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 13d43240dc Move Render and RenderBytes to TermRenderer 2019-11-24 13:35:01 -06:00
Christian Muehlhaeuser f119aef232 Fix new-line before first paragraph 2019-11-24 05:09:07 +01:00
Christian Muehlhaeuser 5191ed1f9c Fix line-break before list items 2019-11-24 04:44:12 +01:00
Christian Muehlhaeuser 9a3c403d78 Fix markdown rendering for first and last paragraphs 2019-11-24 04:20:35 +01:00
Christian Muehlhaeuser 9d157bad5c Fix line-break issues in markdown rendering
Fixes #3.
2019-11-24 04:08:54 +01:00