Definition
Object Hierarchy:
Description:
public class Definition : Object
One skill file: YAML header, then Refinement and Execution sections separated by "---". Constructor only stores path; call load() to read
and parse. Header is stored in a hash map; "name" etc. are read from the map after load.
Content:
Properties:
- public Document document { get; }
Parsed refine section as a markdown document (libocmarkdown).
- public string execute { get; }
Execution section (third part of file).
- public string full_content { get; }
- public HashMap<string,string> header { get; }
- public int64 mtime { get; }
File modification time; set in load().
- public string path { get; }
- public string refine { get; }
Refinement section (second part of file).
Creation methods:
Methods:
- public void apply_skills (HashMap<string,Definition> available)
First re-parses the document from this.refine; then finds the list
under "Available skills" and appends a nested list item with "***When to use*** " + description for each list item. Original item
label unchanged.
- public void load () throws Error
Load and parse the skill file. Validates content; throws on read or
validation failure.
- public string to_markdown ()
Returns this.document rendered to markdown. Call after apply_skills()
so the document includes appended descriptions.
- public ArrayList<string> validate_skills (HashMap<string,Definition> available)
Validates that skills referenced in this document are in the available
map (key = skill name). Returns list of skill names that are referenced but not in available. If the list is non-empty, caller must
not run the skill (error condition).
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref