wiki

package
v3.1.21 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddWikiPage

func AddWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, wikiName WebPath, content, message string) error

AddWikiPage adds a new wiki page with a given wikiPath.

func ChangeDefaultWikiBranch

func ChangeDefaultWikiBranch(ctx context.Context, repo *repo_model.Repository, newBranch string) error

func ClearWikiIndex

func ClearWikiIndex(ctx context.Context, repoID int64) error

ClearWikiIndex removes all indexed pages for a repository

func DeleteWiki

func DeleteWiki(ctx context.Context, repo *repo_model.Repository) error

DeleteWiki removes the actual and local copy of repository wiki.

func DeleteWikiPage

func DeleteWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, wikiName WebPath) (err error)

DeleteWikiPage deletes a wiki page identified by its path.

func EditWikiPage

func EditWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, oldWikiName, newWikiName WebPath, content, message string) error

EditWikiPage updates a wiki page identified by its wikiPath, optionally also changing wikiPath.

func GetDeadLinks(ctx context.Context, repoID int64) ([]map[string]string, error)

GetDeadLinks returns links to non-existent pages

func GetOrphanedPages

func GetOrphanedPages(ctx context.Context, repoID int64) ([]*repo_model.WikiIndex, error)

GetOrphanedPages returns pages with no incoming links

func GetWikiGraph

func GetWikiGraph(ctx context.Context, repoID int64) (
	nodes []map[string]any,
	edges []map[string]any,
	err error,
)

GetWikiGraph returns the link graph for a wiki

func GetWikiIncomingLinks(ctx context.Context, repoID int64, pageName string) ([]string, error)

GetWikiIncomingLinks returns pages that link to the given page

func IndexAllWikiPages

func IndexAllWikiPages(ctx context.Context, repo *repo_model.Repository) error

IndexAllWikiPages indexes all pages in a wiki

func IndexWikiPage

func IndexWikiPage(ctx context.Context, repo *repo_model.Repository, pageName string) error

IndexWikiPage indexes a single wiki page for search

func InitWiki

func InitWiki(ctx context.Context, repo *repo_model.Repository) error

InitWiki initializes a wiki for repository, it does nothing when repository already has wiki.

func RemoveWikiPageFromIndex

func RemoveWikiPageFromIndex(ctx context.Context, repoID int64, pageName string) error

RemoveWikiPageFromIndex removes a page from the search index

func ToWikiPageMetaData

func ToWikiPageMetaData(wikiName WebPath, lastCommit *git.Commit, repo *repo_model.Repository) *api.WikiPageMetaData

ToWikiPageMetaData converts meta information to a WikiPageMetaData

func WebPathSegments

func WebPathSegments(s WebPath) []string

func WebPathToGitPath

func WebPathToGitPath(s WebPath) string

func WebPathToURLPath

func WebPathToURLPath(s WebPath) string

func WebPathToUserTitle

func WebPathToUserTitle(s WebPath) (dir, display string)

Types

type WebPath

type WebPath string

func GitPathToWebPath

func GitPathToWebPath(s string) (wp WebPath, err error)

func UserTitleToWebPath

func UserTitleToWebPath(base, title string) WebPath

func WebPathFromRequest

func WebPathFromRequest(s string) WebPath

Source Files

  • wiki.go
  • wiki_index.go
  • wiki_path.go

Jump to

Keyboard shortcuts

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