Skip to content

data.doctree.collection.data #

fn new_file #

fn new_file(args NewFileArgs) !File

fn new_page #

fn new_page(args NewPageArgs) !Page

enum FileStatus #

enum FileStatus {
	unknown
	ok
	error
}

enum FileType #

enum FileType {
	file
	image
}

enum PageErrorCat #

enum PageErrorCat {
	unknown
	file_not_found
	image_not_found
	page_not_found
	def
}

enum PageStatus #

enum PageStatus {
	unknown
	ok
	error
}

struct File #

@[heap]
struct File {
pub mut:
	collection_path pathlib.Path
	name            string // received a name fix
	ext             string
	path            pathlib.Path
	pathrel         string
	state           FileStatus
	pages_linked    []&Page // pointer to pages which use this file
	ftype           FileType
	collection_name string
}

fn (File) file_name #

fn (file File) file_name() string

fn (File) init #

fn (mut file File) init() !

parses file name, extension and relative path

fn (File) copy #

fn (file_ File) copy(dest string) !

struct NewFileArgs #

@[params]
struct NewFileArgs {
pub:
	name            string // received a name fix
	collection_path pathlib.Path
	pathrel         string
	path            pathlib.Path
	collection_name string @[required]
}

struct NewPageArgs #

@[params]
struct NewPageArgs {
pub:
	name            string       @[required]
	path            pathlib.Path @[required]
	collection_name string       @[required]
}

struct Page #

@[heap]
struct Page {
mut:
	doc           &Doc @[str: skip]
	element_cache map[int]Element
	changed       bool
pub mut:
	name            string // received a name fix
	alias           string // a proper name for e.g. def
	path            pathlib.Path
	collection_name string
}

fn (Page) get_all_actions #

fn (mut page Page) get_all_actions() ![]&Action

Todo: this should not be allowed (giving access to modify page content to any caller)

fn (Page) get_def_actions #

fn (mut page Page) get_def_actions() ![]elements.Action

returns !!wiki.def actions

fn (Page) get_def_names #

fn (mut page Page) get_def_names() ![]string

returns all page def elements (similar to *DEF)

fn (Page) get_include_actions #

fn (page Page) get_include_actions() ![]Action

fn (Page) get_linked_pages #

fn (page Page) get_linked_pages() ![]string

fn (Page) get_markdown #

fn (page Page) get_markdown() !string

fn (Page) key #

fn (page Page) key() string

fn (Page) process_def_action #

fn (mut page Page) process_def_action(element_id int) ![]string

returns page aliases, and removes processed action's content

fn (Page) process_macros #

fn (mut page Page) process_macros() !

fn (Page) set_action_element_to_processed #

fn (mut page Page) set_action_element_to_processed(element_id int) !

fn (Page) set_content #

fn (mut page Page) set_content(content string) !

fn (Page) set_element_content_no_reparse #

fn (mut page Page) set_element_content_no_reparse(element_id int, content string) !

struct PageError #

struct PageError {
	Error
pub mut:
	path Path
	msg  string
	cat  PageErrorCat
}

struct PageMultiError #

struct PageMultiError {
	Error
pub mut:
	errs []PageError
}

fn (PageMultiError) msg #

fn (err PageMultiError) msg() string