Documentation
¶
Index ¶
- Constants
- func RenderBreadcrumpComponent(w io.Writer, data BreadcrumbData) error
- type ArticleData
- type BreadcrumbData
- type BreadcrumbPart
- type Component
- type DirData
- type DirLinkType
- type FilesLinks
- type FooterData
- type FooterLink
- type FooterSection
- type FullFileLink
- type HeadData
- type HeaderData
- type HeaderLink
- type HeaderLinks
- type HelpData
- type HelpTocData
- type HelpTocItem
- type IndexData
- type QueryParam
- type RealmData
- type RealmTOCData
- type RedirectData
- type SourceData
- type SourceTocData
- type SourceTocItem
- type StatusData
- type TemplateComponent
- type View
- func DirectoryView(pkgPath string, files []string, fileCounter int, linkType DirLinkType, ...) *View
- func HelpView(data HelpData) *View
- func NewTemplateView(typ ViewType, name string, data any) *View
- func RealmView(data RealmData) *View
- func RedirectView(data RedirectData) *View
- func SourceView(data SourceData) *View
- func StatusErrorComponent(message string) *View
- func StatusNoRenderComponent(pkgPath string) *View
- type ViewMode
- type ViewType
Constants ¶
const ( SidebarLayout = "sidebar" FullLayout = "full" )
Layout
const RedirectViewType = "redirect-view"
Variables ¶
This section is empty.
Functions ¶
func RenderBreadcrumpComponent ¶
func RenderBreadcrumpComponent(w io.Writer, data BreadcrumbData) error
Types ¶
type ArticleData ¶
type BreadcrumbData ¶
type BreadcrumbData struct { Parts []BreadcrumbPart ArgParts []BreadcrumbPart Queries []QueryParam }
type BreadcrumbPart ¶
type DirData ¶
type DirData struct { PkgPath string Files []string FileCounter int FilesLinks FilesLinks Mode ViewMode }
type DirLinkType ¶
type DirLinkType int
const ( DirLinkTypeSource DirLinkType = iota DirLinkTypeFile )
func (DirLinkType) LinkPrefix ¶
func (d DirLinkType) LinkPrefix(pkgPath string) string
Get the prefixed link depending on link type - Package Source Code or Package File
type FilesLinks ¶
type FilesLinks []FullFileLink
FilesLinks has to be an array of FileLink
func GetFullLinks ¶
func GetFullLinks(files []string, linkType DirLinkType, pkgPath string) FilesLinks
type FooterData ¶
type FooterData struct {}
func EnrichFooterData ¶
func EnrichFooterData(data FooterData) FooterData
type FooterLink ¶
type FooterLink struct {}
type FooterSection ¶
type FooterSection struct {}
type FullFileLink ¶
Files has to be an array with Link (prefixed) and Name (filename)
type HeaderData ¶
type HeaderData struct { RealmPath string RealmURL weburl.GnoURL Breadcrumb BreadcrumbData Links HeaderLinks ChainId string Remote string Mode ViewMode }
func EnrichHeaderData ¶
func EnrichHeaderData(data HeaderData, mode ViewMode) HeaderData
type HeaderLink ¶
func StaticHeaderDevLinks ¶
func StaticHeaderDevLinks(u weburl.GnoURL, mode ViewMode) []HeaderLink
func StaticHeaderGeneralLinks ¶
func StaticHeaderGeneralLinks() []HeaderLink
type HeaderLinks ¶
type HeaderLinks struct { General []HeaderLink Dev []HeaderLink }
type HelpTocData ¶
type HelpTocData struct { Icon string Items []HelpTocItem }
type HelpTocItem ¶
type QueryParam ¶
type RealmData ¶
type RealmData struct { ComponentContent Component TocItems *RealmTOCData }
type RealmTOCData ¶
type RedirectData ¶
type SourceData ¶
type SourceTocData ¶
type SourceTocData struct { Icon string ReadmeFile SourceTocItem GnoFiles []SourceTocItem GnoTestFiles []SourceTocItem }
type SourceTocItem ¶
type StatusData ¶
StatusData holds the dynamic fields for the "status" template
type TemplateComponent ¶
type TemplateComponent struct {
// contains filtered or unexported fields
}
type View ¶
func DirectoryView ¶
func RedirectView ¶
func RedirectView(data RedirectData) *View
func SourceView ¶
func SourceView(data SourceData) *View
func StatusErrorComponent ¶
StatusErrorComponent returns a view for error scenarios
func StatusNoRenderComponent ¶
StatusNoRenderComponent returns a view for non-error notifications
type ViewMode ¶
type ViewMode int
ViewMode represents the current view mode of the application It affects the layout, navigation, and display of content
func (ViewMode) GetLayoutType ¶
GetLayoutType returns the appropriate layout type for the view mode
func (ViewMode) ShouldShowDevTools ¶
ShouldShowDevTools returns whether dev tools should be shown for this mode
func (ViewMode) ShouldShowGeneralLinks ¶
ShouldShowGeneralLinks returns whether general navigation links should be shown