Documentation ¶
Overview ¶
Package gemtext implements shared logic related to gemtext files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeedTranslator ¶
type FeedTranslator struct { // Required. When interpreting links from the gemlog, all links will be // interpreted as being relative to this URL. BaseURL *url.URL // Optional strings to use in the top-level 'author' field of the resulting // feed. AuthorName, AuthorEmail string }
FeedTranslator is used to translate a gemtext file, interpreted as a gemlog, into an RSS, Atom, or JSON feed.
func (FeedTranslator) ToAtom ¶
ToAtom translates the input gemtext document into an Atom feed.
func (FeedTranslator) ToJSON ¶
ToJSON translates the input gemtext document into an JSON feed.
type HTML ¶
HTML contains the result of a translation from gemtext. The Body will be the translated body itself, and Title will correspond to the first primary header of the gemtext file, if there was one.
type HTMLTranslator ¶
type HTMLTranslator struct { // RenderHeading, if given can be used to override how headings are // rendered. The level indicates which heading level is being rendered: 1, // 2, or 3. RenderHeading func(w io.Writer, level int, text string) error // RenderLink, if given, can be used to override how links are rendered. RenderLink func(w io.Writer, url, label string) error }
HTMLTranslator is used to translate a gemtext file into equivalent HTML DOM elements.
Click to show internal directories.
Click to hide internal directories.