web.mdbook #
mdbook
To get started
import freeflowuniverse.herolib.clients. mdbook
mut client:= mdbook.get()!
client...
example heroscript
!!mdbook.configure
secret: '...'
host: 'localhost'
port: 8888
Constants #
const version = '1.14.3'
fn book_edit #
fn book_edit(name string) !
fn book_open #
fn book_open(name string) !
fn get #
fn get(args_ ArgsGet) !&MDBooks
fn heroscript_default #
fn heroscript_default() !string
Todo: THIS IS EXAMPLE CODE AND NEEDS TO BE CHANGED IN LINE TO STRUCT BELOW, IS STRUCTURED AS HEROSCRIPT
fn play #
fn play(args_ PlayArgs) !
fn switch #
fn switch(name string)
switch instance to be used for mdbook
struct ArgsGet #
@[params]
struct ArgsGet {
pub mut:
name string = 'default'
}
///////FACTORY
struct ErrorArgs #
@[params]
struct ErrorArgs {
pub mut:
path string
msg string
cat collection.CollectionErrorCat
}
struct FileLoader #
@[heap]
struct FileLoader {
pub mut:
embedded_files []embed_file.EmbedFileData @[skip; str: skip]
}
struct MDBook #
@[heap]
struct MDBook {
pub mut:
name string
books &MDBooks @[skip; str: skip]
path_build pathlib.Path
path_publish pathlib.Path
args MDBookArgs
errors []collection.CollectionError
}
fn (MDBook) error #
fn (mut book MDBook) error(args ErrorArgs)
fn (MDBook) generate #
fn (mut book MDBook) generate() !
fn (MDBook) open #
fn (mut book MDBook) open() !
fn (MDBook) summary #
fn (mut book MDBook) summary(production bool) !Summary
struct MDBookArgs #
@[params]
struct MDBookArgs {
pub mut:
name string @[required]
title string
foldlevel int
printbook bool
// summary_url string // url of the summary.md file
summary_path string // can also give the path to the summary file (can be the dir or the summary itself)
// doctree_url string
// doctree_path string
publish_path string
build_path string
production bool
collections []string
description string
export bool // whether mdbook should be built
}
struct MDBooks #
@[heap]
struct MDBooks {
pub mut:
name string
path_build string
path_publish string
}
THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED
fn (MDBooks) generate #
fn (mut books MDBooks) generate(args_ MDBookArgs) !&MDBook
struct PlayArgs #
@[params]
struct PlayArgs {
pub mut:
name string = 'default'
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
start bool
stop bool
restart bool
delete bool
configure bool // make sure there is at least one installed
}
struct Summary #
@[heap]
struct Summary {
pub mut:
items []SummaryItem
errors []SummaryItem // means we found errors, so we need to add to summary
addpages []SummaryItem // means we found pages as links, so we need to add them to the summary
collections []string
production bool
}
fn (Summary) str #
fn (mut self Summary) str() string
struct SummaryItem #
struct SummaryItem {
pub mut:
level int
description string
relpath string // relative path of summary item to source
collection string
pagename string
}