Skip to content

Commit

Permalink
Add all structure-related things (docs)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudocode1 committed Oct 18, 2021
1 parent 8b011cd commit cd935e2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ None

## Docs
### Additions
None
- Add all structure-related things
### Doc Fixes
- Fix end
### Docgen updates
Expand Down
26 changes: 25 additions & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,28 @@
- Usage: @redefine name = value
- Parameters
- name - The variable's name.
- value - The variable's value.
- value - The variable's value.
# @structure
- Start a structure.
- Usage: @structure
# @struct_access_property
- Output a structure property.
- Usage: @struct_access_property type variable.property
- Parameters
- type - The property type.
- variable.property - The variable and the property you want to output.
# @create_struct
- Create a variable based on a structure.
- Usage: @create_struct struct name
- Parameters
- struct - The structure name.
- name - The variable name.
# @endstructure
- End a structure definition.
- Usage: @endstructure
# @property
- Add a structure property (within structure definition).
- Usage: @property type name
- Parameters
- type - The property type.
- name - The property name.
5 changes: 5 additions & 0 deletions docs/docgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const data = [
['if', 'Adds an if statement.', cond, ['else if', 'elif', 'else'].map(x => [x, `Adds an ${x === 'elif' ? 'else if' : x} statement.`, cond])],
['while', 'Adds a while statement.', cond],
['@redefine', 'Redefines an already existing variable.', varDef],
['@structure', 'Start a structure.'],
['@struct_access_property', 'Output a structure property.', [['type', 'The property type.'], ['variable.property', 'The variable and the property you want to output.']]],
['@create_struct', 'Create a variable based on a structure.', [['struct', 'The structure name.'], ['name', 'The variable name.']]],
['@endstructure', 'End a structure definition.'],
['@property', 'Add a structure property (within structure definition).', [['type', 'The property type.'], ['name', 'The property name.']]]
];
// invalid ratio detected
const render = (a, indent) => a.map(x => `${'#'.repeat(indent)} ${x[0]}
Expand Down

0 comments on commit cd935e2

Please sign in to comment.