READMEs Programming System
version : 1.0
context : enabled
variables :
readme_content : " "
previous_output : " "
system_state : " "
topic : " "
parser :
heading_section : ^##\s+(.+)$
heading_function : ^#\s+(.+)$
list_item : ^(\s+)-\s+(.+)$
key_value : ^(\s+)-\s+(\w+):\s*(.+)$
nested_list : ^(\s+)-\s+(\w+):$
indentation : 2
const parseLibrary = md => md . match ( / ^#\s+(.+)$/ gm)
const parseTemplate = md => md . match ( / ^###\s+(.+)$/ gm)
const parseContext = md => JSON . parse ( md . match ( / \{[\s\S]+\}/ m) [ 0 ] )
## CORE
# system_init
- description: Bootstrap system from README
- parameters:
- content: string
- returns:
- system_state: ready
- functions: loaded
- templates: parsed
# system_execute
- description: Run template with context
- parameters:
- template: string
- input: string
- context: object
# system_compose_program
- description: Generates a composed program by combining README.md with custom libraries
- parameters:
- readme_file: string
- libraries: [ string]
- returns:
- composed_readme: string
- execution_state: ready
## CUSTOM
### Bootstrap
# Execute
- function: system_init
- input: "{{readme_content}}"
- outputs:
- system_state
- functions
- templates
### Program Composing
# Execute
- function: system_compose_program
- libraries:
- my_first_library.md
- readme_content: "{{readme_content}}"
{
"previous_output" : " " ,
"variables" : {},
"state" : " ready"
}
# Execute
- function: system_init
- input: "{{readme_content}}"
- outputs:
- system_state
- functions
- templates
# Execute
- function: system_compose_program
- libraries:
- my_first_library.md
- readme_content: "{{readme_content}}"