{"repo":"stephenafamo/goldmark-pdf","free":true,"listed":false,"github":"https://github.com/stephenafamo/goldmark-pdf","clone":"git clone https://github.com/stephenafamo/goldmark-pdf.git","description":"A PDF renderer for the goldmark markdown parser.","language":"Go","stars":145,"topics":["go","golang","markdown","pdf","commonmark","goldmark","goldmark-extension"],"license":"MIT","category":"media-processing","readme_excerpt":"goldmark-pdf goldmark-pdf is a renderer for goldmark that allows rendering to PDF. Reference See Usage Care has been taken to match the semantics of goldmark and its extensions. The PDF renderer can be initiated with pdf.New() and the returned value satisfies goldmark 's renderer.Renderer interface, so it can be passed to goldmark.New() using the goldmark.WithRenderer() option. Options can also be passed to pdf.New() , the options interface to be satisfied is: Here is the Config struct that is to be modified: Some helper functions for adding options are already provided. See option.go An example with some more options: HTML escaping By default, the renderer HTML-escapes literal text, which means characters like , and & are written into the PDF as &lt; , &gt; , &amp; — the right thing for an HTML document but visible noise in a PDF. Pass pdf.WithEscapeHTML(false) to emit those characters as-is. This is what you want when the source contains inline code or fenced blocks with HTML-like content, e.g. bold should appear with its angle brackets intact rather than as &lt;strong&gt;bold&lt;/strong&gt; . Logging The renderer emits two kinds of events through log/slog : - Debug — verbose AST-walk trace (one record per node enter/leave), useful for diagnosing layout issues. Each record carries msg (detail) and depth (stack depth) attributes. - Warn — recoverable problems such as a missing image. The PDF is still produced; the warning lets the caller know something was skipped. Logging i","default_branch":null,"files":null,"tree":[],"storefront":"/r/stephenafamo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/stephenafamo/goldmark-pdf/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}