document

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	HTML         string `json:"html"`
	Path         string `json:"path"`
	ModifiedAt   int64  `json:"modifiedAt"`
	ModifiedAtMs int64  `json:"modifiedAtMs"`
	Size         int64  `json:"size"`
}

Document はドキュメント情報を表す

type FrontmatterField

type FrontmatterField struct {
	Key   string
	Value string
}

FrontmatterField はパースされた frontmatter の一つのキー/値ペアを表す。 Order を保持するため map ではなくスライスで返す。

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer はMarkdownをHTMLに変換する

func NewRenderer

func NewRenderer(basePath string) *Renderer

NewRenderer は新しいRendererを作成する

func (*Renderer) Render

func (r *Renderer) Render(relativePath, worktreeName string) (*Document, error)

Render は指定されたパスのMarkdownファイルをHTMLに変換する。 worktreeName を渡すと、ドキュメント内の相対リンク・相対画像 URL を `?file=...&worktree=...` / `/api/raw?path=...&worktree=...` に書き換える。 worktreeName が空文字でも書き換えは行われ、worktree パラメータは省略される。

Jump to

Keyboard shortcuts

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