Skip to content

Commit d2d0255

Browse files
committed
update docs
1 parent 17feedf commit d2d0255

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1701
-1207
lines changed

build

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
if [ "$1" == "gendoc" ]; then
3+
if [ "$1" == "doc" ]; then
44
for d in */; do
55
d=${d::${#d}-1}
66
count=`ls -1 $d/*.go 2>/dev/null | wc -l`
@@ -14,6 +14,6 @@ elif [ "$1" == "help" ]; then
1414
elif [ "$1" == "test" ]; then
1515
./quiki -wiki=test -force-gen
1616
else
17-
echo "Usage: $0 {gendoc|help|test}"
17+
echo "Usage: $0 {doc|help|test}"
1818
exit 1
1919
fi

doc/technical/wikifier.md

+76-22
Original file line numberDiff line numberDiff line change
@@ -163,27 +163,96 @@ func NewList(mb block) *List
163163
NewList creates a new list, given the main block of the page it is to be
164164
associated with.
165165

166-
#### func (List) Fmt
166+
#### func (List) Get
167167

168168
```go
169-
func (b List) Fmt(text string, pos Position) HTML
169+
func (scope List) Get(key string) (any, error)
170170
```
171-
Fmt generates HTML from a quiki-encoded formatted string.
171+
Get fetches a a value regardless of type.
172+
173+
The key may be segmented to indicate properties of each object (e.g.
174+
person.name).
175+
176+
If attempting to read a property of an object that does not support properties,
177+
such as a string, Get returns an error.
178+
179+
If the key is valid but nothing exists at it, Get returns (nil, nil).
180+
181+
#### func (List) GetBlock
182+
183+
```go
184+
func (scope List) GetBlock(key string) (block, error)
185+
```
186+
GetBlock is like Get except it always returns a block.
187+
188+
#### func (List) GetBool
189+
190+
```go
191+
func (scope List) GetBool(key string) (bool, error)
192+
```
193+
GetBool is like Get except it always returns a boolean.
194+
195+
#### func (List) GetObj
196+
197+
```go
198+
func (scope List) GetObj(key string) (AttributedObject, error)
199+
```
200+
GetObj is like Get except it always returns an AttributedObject.
201+
202+
#### func (List) GetStr
203+
204+
```go
205+
func (scope List) GetStr(key string) (string, error)
206+
```
207+
GetStr is like Get except it always returns a string.
208+
209+
If the value is HTML, it is converted to a string.
210+
211+
#### func (List) GetStrList
212+
213+
```go
214+
func (scope List) GetStrList(key string) ([]string, error)
215+
```
216+
GetStrList is like Get except it always returns a list of strings.
172217

173-
#### func (List) FmtOpts
218+
If the value is a `list{}` block, the list's values are returned, with
219+
non-strings quietly filtered out.
220+
221+
If the value is a string, it is treated as a comma-separated list, and each item
222+
is trimmed of prepending or suffixing whitespace.
223+
224+
#### func (List) Set
174225
175226
```go
176-
func (b List) FmtOpts(text string, pos Position, o FmtOpt) HTML
227+
func (scope List) Set(key string, value any) error
177228
```
178-
FmtOpts is like Fmt except you can specify additional options with the FmtOpt
179-
argument.
229+
Set sets a value at the given key.
230+
231+
The key may be segmented to indicate properties of each object (e.g.
232+
person.name).
233+
234+
If attempting to write to a property of an object that does not support
235+
properties, such as a string, Set returns an error.
180236

181237
#### func (List) String
182238

183239
```go
184240
func (b List) String() string
185241
```
186242

243+
#### func (List) Unset
244+
245+
```go
246+
func (scope List) Unset(key string) error
247+
```
248+
Unset removes a value at the given key.
249+
250+
The key may be segmented to indicate properties of each object (e.g.
251+
person.name).
252+
253+
If attempting to unset a property of an object that does not support properties,
254+
such as a string, Unset returns an error.
255+
187256
#### type Map
188257

189258
```go
@@ -202,21 +271,6 @@ func NewMap(mb block) *Map
202271
NewMap creates a new map, given the main block of the page it is to be
203272
associated with.
204273

205-
#### func (Map) Fmt
206-
207-
```go
208-
func (b Map) Fmt(text string, pos Position) HTML
209-
```
210-
Fmt generates HTML from a quiki-encoded formatted string.
211-
212-
#### func (Map) FmtOpts
213-
214-
```go
215-
func (b Map) FmtOpts(text string, pos Position, o FmtOpt) HTML
216-
```
217-
FmtOpts is like Fmt except you can specify additional options with the FmtOpt
218-
argument.
219-
220274
#### func (Map) Get
221275

222276
```go

help-wiki/cache/meta/page/doc/blocks.cat

+1-1
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"file":"doc/configuration.cat","name":"doc/configuration","file_ne":"doc/configuration","created":"2025-02-23T10:03:06.941006-05:00","created_http":"Sun, 23 Feb 2025 15:03:06 GMT","modified":"2025-02-23T10:03:07.16111-05:00","modified_http":"Sun, 23 Feb 2025 15:03:07 GMT","pages":{"doc/language.md":{"asof":"2025-02-23T10:03:06.941099-05:00","file":"doc/language.md","file_ne":"doc/language","created":"2025-02-23T09:41:58.234670181-05:00","modified":"2025-02-23T09:41:58.234670181-05:00","generated":true,"external":true,"fmt_title":"Language","title":"Language","author":"Markdown","preview":"Contents Language Syntax Comments Escapes Blocks Nameless blocks Named blocks Block type inference Model shorthand Data types Variables Assignment","warnings":[{"message":"No such code{} style 'monokailight' (from config)","position":[15,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[59,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[67,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[174,20]},{"message":"No such code{} style 'monokailight' (from config)","position":[203,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[228,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[238,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[258,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[268,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[286,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[298,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[330,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[346,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[381,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[390,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[399,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[415,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[425,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[436,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[448,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[467,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[483,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[507,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[531,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[553,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[567,7]}],"lines":[619,681]},"main.page":{"asof":"2025-02-23T10:03:07.16111-05:00","file":"main.page","file_ne":"main","created":"2020-03-29T22:23:32Z","modified":"2025-02-23T09:41:53.584630772-05:00","fmt_title":"Help","title":"Help","author":"quiki authors","preview":"Documentation Language spec Configuration spec Block reference Models (Templating) Styling (CSS) Additional help quiki website Report a bug or issue","lines":[8]}},"preserve":true,"type":"page","page_info":{"file":"doc/configuration.md","file_ne":"doc/configuration","created":"2025-02-23T09:41:58.236688692-05:00","modified":"2025-02-23T09:41:58.236688692-05:00","generated":true,"external":true,"fmt_title":"Configuration","title":"Configuration","author":"Markdown","preview":"Contents Configuration Configuration files wikifier options name host.wiki dir.wiki root external page.enable.title page.code.lang page.code.style","warnings":[{"message":"No such code{} style 'monokailight' (from config)","position":[22,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[149,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[216,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[228,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[245,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[398,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[448,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[486,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[495,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[519,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[535,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[555,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[579,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[591,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[613,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[633,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[651,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[708,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[723,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[731,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[747,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[823,7]}]}}
1+
{"file":"doc/configuration.cat","name":"doc/configuration","file_ne":"doc/configuration","created":"2025-02-23T10:03:06.941006-05:00","created_http":"Sun, 23 Feb 2025 15:03:06 GMT","modified":"2025-02-23T10:03:07.16111-05:00","modified_http":"Sun, 23 Feb 2025 15:03:07 GMT","pages":{"doc/language.md":{"asof":"2025-02-23T10:03:06.941099-05:00","file":"doc/language.md","file_ne":"doc/language","created":"2025-02-23T09:41:58.234670181-05:00","modified":"2025-02-23T09:41:58.234670181-05:00","generated":true,"external":true,"fmt_title":"Language","title":"Language","author":"Markdown","preview":"Contents Language Syntax Comments Escapes Blocks Nameless blocks Named blocks Block type inference Model shorthand Data types Variables Assignment","warnings":[{"message":"No such code{} style 'monokailight' (from config)","position":[15,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[59,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[67,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[174,20]},{"message":"No such code{} style 'monokailight' (from config)","position":[203,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[228,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[238,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[258,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[268,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[286,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[298,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[330,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[346,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[381,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[390,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[399,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[415,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[425,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[436,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[448,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[467,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[483,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[507,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[531,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[553,7]},{"message":"No such code{} style 'monokailight' (from config)","position":[567,7]}],"lines":[619,681]},"main.page":{"asof":"2025-02-23T10:03:07.16111-05:00","file":"main.page","file_ne":"main","created":"2020-03-29T22:23:32Z","modified":"2025-02-23T09:41:53.584630772-05:00","fmt_title":"Help","title":"Help","author":"quiki authors","preview":"Documentation Language spec Configuration spec Block reference Models (Templating) Styling (CSS) Additional help quiki website Report a bug or issue","lines":[8]}},"preserve":true,"type":"page","page_info":{"file":"doc/configuration.md","file_ne":"doc/configuration","created":"2025-02-23T09:41:58.236688692-05:00","modified":"2025-02-23T09:41:58.236688692-05:00","generated":true,"external":true,"fmt_title":"Configuration","title":"Configuration","author":"Markdown","preview":"Contents Configuration Configuration files wikifier options name host.wiki dir.wiki root external page.enable.title page.code.lang page.code.style"}}

0 commit comments

Comments
 (0)