Documentation ¶
Overview ¶
Package gemini provides functions to convert Markdown files to Gemtext. It supports the use of YAML front matter in Markdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPostIsDraft = errors.New("post is draft")
ErrPostIsDraft indicates the post rendered is a draft and is not supposed to be rendered.
Functions ¶
This section is empty.
Types ¶
type HugoMetadata ¶
type HugoMetadata struct { PostTitle string `yaml:"title"` PostIsDraft bool `yaml:"draft"` PostLayout string `yaml:"layout"` PostDate time.Time `yaml:"date"` }
HugoMetadata implements gemini.Metadata, providing the bare minimum of possible post props.
func RenderMarkdown ¶
func RenderMarkdown(md []byte, settings Settings) (geminiText []byte, metadata HugoMetadata, err error)
RenderMarkdown converts Markdown text to Gemtext using gomarkdown. It appends Hugo YAML front matter data to the post header if WithMetadata is set.
Only a subset of front matter data parsed by Hugo is included in the final document. At this point it's just title and date.
Draft posts are still rendered, but with an error of type ErrPostIsDraft.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
gmnhg
gmnhg converts Hugo content files to a Gemini site.
|
gmnhg converts Hugo content files to a Gemini site. |
md2gmn
md2gmn converts Markdown text files to text/gemini.
|
md2gmn converts Markdown text files to text/gemini. |
internal
|
|
gemini
Package gemini contains an implementation of markdown => text/gemini renderer for github.com/gomarkdown/markdown.
|
Package gemini contains an implementation of markdown => text/gemini renderer for github.com/gomarkdown/markdown. |