UNPKG

@meldscience/meld

Version:

pipeable one-shot prompt scripting toolkit

35 lines (24 loc) 1.27 kB
I want to extend the `meld` tool in this code to also be able to grab a section from any markdown doc or JS/TS object and embed its content in the built output using imports For markdown imports: - dumb matching: don’t care how many # in the header level in the doc, just select the first one in the targeted document - select the content up until the next # header - skip matching any # inside backtick fences for both startpoints and endpoints - just error and break the build if a doc or header isn’t found or if multiple matches or some other logical error ## Basic Import from markdown @import[../docs/setup.md # Installation] ## Import from markdown with Level Adjustment @import[../docs/api.md # Endpoints] as ### ## Import from markdown with Title Override @import[../docs/guide.md # Setup] as ### Quick Start ## import function from code @import[src/meld.ts # myFunction] ## Use braces to export all of x @import[src/meld.ts # {interface}] @import[src/meld.ts # {type}] # Use brackets to import multiple @import[src/meld.ts # [{interface}, {type}]] @import[src/meld.ts # [myFunction, otherFunction]] # Path aliases - defined in a `meldconfig.json` in project root or in `~/.meldrc` globally # Import from alias @import[@docs/setup.md # Installation]