You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- description: "Executes a regex on a string and returns the matches"
- input: md: string, pattern: string
- output: matches: array
- template: regex_executor_template
- description: "Parses a specific section using a given regex pattern"
- input: md: string, pattern: string
- output: sections: array
- template: section_parser_template
- description: "Parses a line starting with # or ### and generates an ID"
- input: line: string, parent_id: string
- output: header: string, id: string
- template: header_parser_template
Template: header_parser_template
- input_placeholder: "{{line}}, {{parent_id}}"
- transform: |
let id = parent_id ? `${parent_id}.` : '';
if (line.startsWith('# ')) {
id += line.replace('# ', '').toLowerCase().replace(/\s+/g, '_');
return { header: line.replace('# ', ''), id: id };
} else if (line.startsWith('## ')) {
id += line.replace('## ', '').toLowerCase().replace(/\s+/g, '_');
return { header: line.replace('## ', ''), id: id };
} else {
return null;
}
- output_format: object
Function: extract_section
- description: "Extracts all section content using a given regex pattern"
- input: md: string, pattern: string
- output: sections: array
- template: section_parser_template