markdown

package
v0.188.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package markdown provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

Functions

func ToHTML

func ToHTML(input []byte) ([]byte, error)

ToHTML treats the given string data input as Markdown formatted plain-text and returns an appropriate HTML representation.

Types

type File added in v0.181.4

type File struct {
	Content []byte `json:"content"`

	// Frontmatter contains metadata about a markdown file that allows mapping it to a path under a documentation directory.
	Frontmatter FrontMatter `json:"frontmatter" toml:"doc_metadata"`

	// JsonLD is the JSON-LD format for the file.
	JsonLD *json.RawMessage `json:"jsonLD,omitempty"`
}

File contains the raw markdown file data and its frontmatter.

func ReadDir added in v0.181.4

func ReadDir(dir embed.FS, path string) ([]*File, error)

ReadDir reads a list of Markdown files from the given path in an embed.FS.

func ReadFile added in v0.181.4

func ReadFile(dir embed.FS, path string, details fs.DirEntry) (*File, error)

ReadFile reads a file at the given path in an embed.FS.

type FrontMatter added in v0.181.4

type FrontMatter struct {
	// Author the person who wrote or is responsible for the document.
	Author *string `json:"author,omitempty" toml:"author"`

	// CreatedAt is when the post was created.
	CreatedAt string `json:"created_at" toml:"created_at" validate:"required,datetime=2006-01-02"`

	// Description is a description of the document, used in metadata headers of the page.
	Description string `json:"description" toml:"description" validate:"required"`

	// Image is a URL to an image to represent the file.
	Image *string `json:"image,omitempty" toml:"image" validate:"omitempty,url"`

	// PageTitle is the title rendered in the page header (i.e., <title/>).
	PageTitle string `json:"page_title" toml:"page_title" validate:"required"`

	// Slug is a URL safe slug to indicate the path to the file.
	Slug string `json:"slug" toml:"slug" validate:"required"`

	// Title is the in-page title of the document.
	Title string `json:"title" toml:"title" validate:"required"`

	// UpdatedAt is when the post was updated.
	UpdatedAt *string `json:"updated_at,omitempty" toml:"updated_at" validate:"omitempty,datetime=2006-01-02"`
}

FrontMatter contains metadata about a markdown file that allows mapping it to a path under a documentation directory.

func (*FrontMatter) GetCreatedDate added in v0.181.4

func (fm *FrontMatter) GetCreatedDate() time.Time

func (*FrontMatter) GetUpdatedDate added in v0.181.4

func (fm *FrontMatter) GetUpdatedDate() time.Time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL