Documentation
¶
Index ¶
- Constants
- func EntityConceptID(kind, key string) string
- func EntityPath(kind, key string) string
- func ItemConceptID(item model.Item) string
- func ItemPath(item model.Item) string
- func MarkdownLink(label, dest string) string
- func RelativeLink(fromPath, toPath string) (string, error)
- func RenderDocument(doc Document) (string, error)
- func SourceConceptID(source model.SourceDocument) string
- func SourcePath(source model.SourceDocument) string
- func TopicConceptID(topic string) string
- func TopicPath(topic string) string
- func ValidateConceptPath(rel string) error
- type Bundle
- type Concept
- type Document
- type ExportOptions
- type ExportResult
- type Field
- type Manifest
- type ManifestConcept
- type OmittedLink
- type SearchResult
- type ValidationDocument
- type ValidationResult
Constants ¶
View Source
const (
ProfilePrivate = "private"
)
Variables ¶
This section is empty.
Functions ¶
func EntityConceptID ¶
func EntityPath ¶
func ItemConceptID ¶
func MarkdownLink ¶
func RelativeLink ¶
func RenderDocument ¶
func SourceConceptID ¶
func SourceConceptID(source model.SourceDocument) string
func SourcePath ¶
func SourcePath(source model.SourceDocument) string
func TopicConceptID ¶
func ValidateConceptPath ¶
Types ¶
type Bundle ¶
type Bundle struct {
Documents []Document
Manifest Manifest
Stats ExportResult
}
func BuildBundle ¶
func BuildBundle(snapshot store.OKFExportSnapshot, opts ExportOptions) (Bundle, error)
type Concept ¶
type Concept struct {
Path string `json:"path"`
Type string `json:"type"`
Title string `json:"title"`
Description string `json:"description"`
ConceptID string `json:"dbrain_concept_id"`
SourceKey string `json:"dbrain_source_key,omitempty"`
SourceType string `json:"dbrain_source_type,omitempty"`
Frontmatter map[string]any `json:"frontmatter"`
Markdown string `json:"markdown"`
Body string `json:"body"`
}
type ExportOptions ¶
type ExportOptions struct {
OutDir string
Profile string
IncludeItems bool
IncludeSources bool
IncludeEntities bool
IncludeTopics bool
SourceTypes []string
Limit int
IncludeRaw bool
MaxRawChars int
MediaPublicBaseURL string
MediaProxyBaseURL string
Now time.Time
DbrainVersion string
Entities []entities.Entity
Topics []topics.TopicMap
}
type ExportResult ¶
type ExportResult struct {
Bundle string `json:"bundle"`
Profile string `json:"profile"`
ItemsWritten int `json:"items_written"`
SourcesWritten int `json:"sources_written"`
EntitiesWritten int `json:"entities_written"`
TopicsWritten int `json:"topics_written"`
IndexesWritten int `json:"indexes_written"`
ConceptsWritten int `json:"concepts_written"`
BrokenInternalLinks int `json:"broken_internal_links"`
OmittedByFilterLinks int `json:"omitted_by_filter_links"`
Errors []string `json:"errors"`
}
type Manifest ¶
type Manifest struct {
OKFVersion string `json:"okf_version"`
Profile string `json:"profile"`
ExportedAt string `json:"exported_at"`
Concepts []ManifestConcept `json:"concepts"`
OmittedLinks []OmittedLink `json:"omitted_links,omitempty"`
}
type ManifestConcept ¶
type ManifestConcept struct {
Path string `json:"path"`
Type string `json:"type"`
Title string `json:"title"`
Description string `json:"description"`
ConceptID string `json:"dbrain_concept_id"`
Kind string `json:"dbrain_kind"`
SourceKey string `json:"dbrain_source_key,omitempty"`
SourceType string `json:"dbrain_source_type,omitempty"`
}
type OmittedLink ¶
type SearchResult ¶
type SearchResult struct {
Path string `json:"path"`
Type string `json:"type"`
Title string `json:"title"`
Description string `json:"description"`
ConceptID string `json:"dbrain_concept_id"`
SourceKey string `json:"dbrain_source_key,omitempty"`
SourceType string `json:"dbrain_source_type,omitempty"`
Snippet string `json:"snippet,omitempty"`
}
func SearchBundle ¶
func SearchBundle(root string, query string, limit int) ([]SearchResult, error)
type ValidationDocument ¶
type ValidationResult ¶
type ValidationResult struct {
Bundle string `json:"bundle"`
Conformant bool `json:"conformant"`
Concepts int `json:"concepts"`
Indexes int `json:"indexes"`
BrokenInternalLinks int `json:"broken_internal_links"`
OmittedByFilterLinks int `json:"omitted_by_filter_links"`
Errors []string `json:"errors"`
Documents []ValidationDocument `json:"documents,omitempty"`
}
func ValidateBundle ¶
func ValidateBundle(root string) (ValidationResult, error)
Click to show internal directories.
Click to hide internal directories.