HammeriteManualPage
Editor. Inherits RefCounted
One page of the manual: its front matter, its headings and its markdown.
path is where the page sits in the manual's virtual tree, <section>/<page>.md, which is what links name; file is where it was read from.
Properties
| Type | Name | Default |
|---|---|---|
String | path | "" |
String | file | "" |
String | title | "" |
int | order | 0 |
PackedStringArray | keywords | PackedStringArray() |
HammeriteManualPage.Heading[] | headings | [] |
String | body | "" |
String | plain_text | "" |
PackedStringArray | problems | PackedStringArray() |
int | modified | 0 |
Methods
| Returns | Method |
|---|---|
HammeriteManualPage | load_file(page_path: String, page_file: String) static |
HammeriteManualPage | parse(source: String, page_path: String, page_file: String = "") static |
String | anchor_for(heading_text: String) static |
String | plain(markdown: String) static |
bool | is_table_rule(line: String) static |
PackedStringArray | anchors() |
bool | has_anchor(anchor: String) |
StringName | section_id() |
Property descriptions
path
var path: String = ""
Where the page sits in the manual, <section>/<page>.md: what links name.
file
var file: String = ""
The file it was read from.
title
var title: String = ""
Its front matter's title.
order
var order: int = 0
Where it stands in its section, lowest first after the index page.
keywords
var keywords: PackedStringArray = PackedStringArray()
Its front matter's keywords, for search.
headings
var headings: HammeriteManualPage.Heading[] = []
Its headings, in order.
body
var body: String = ""
The markdown after the front matter.
plain_text
var plain_text: String = ""
The body without markup, for search.
problems
var problems: PackedStringArray = PackedStringArray()
What is wrong with the page's format, one line each.
modified
var modified: int = 0
The file's modification time when it was read, to notice an edit.
Method descriptions
load_file()
static func load_file(page_path: String, page_file: String) -> HammeriteManualPage
Undocumented.
parse()
static func parse(source: String, page_path: String, page_file: String = "") -> HammeriteManualPage
Undocumented.
anchor_for()
static func anchor_for(heading_text: String) -> String
The anchor a heading is linked by: lowercase, spaces to hyphens, punctuation dropped. The same rule as GitHub's, so a link works on a website unchanged.
plain()
static func plain(markdown: String) -> String
Inline markdown as the words it shows.
is_table_rule()
static func is_table_rule(line: String) -> bool
Whether line is the row under a table's header, |---|:--|.
anchors()
func anchors() -> PackedStringArray
Undocumented.
has_anchor()
func has_anchor(anchor: String) -> bool
Undocumented.
section_id()
func section_id() -> StringName
Undocumented.
class Heading
One of a page's headings.
Properties
| Type | Name | Default |
|---|---|---|
int | level | 0 |
String | text | "" |
String | anchor | "" |
Property descriptions
level
var level: int = 0
1 for #, 2 for ## and so on.
text
var text: String = ""
As written, without the hashes.
anchor
var anchor: String = ""
What a link names it by: page.md#anchor.