Skip to content

wbamberg/query-kumascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This package can be used to look for KumaScript macro invocations. It uses a copy of the parser that's built into KumaScript itself, so it should be reliable.

Usage:

import { queryTree } from "query-kumascript";

const root = process.argv[2];
const result = await queryTree(root);
console.log(JSON.stringify(result, null, "  "));

It has a single export, queryTree(), which takes as an argument a path. It looks for all "index.md" files under that path, and looks for KumaScript macro invocations in them.

It returns an array of objects, one for each file processed. Each object has two properties:

  • file: the path to the file
  • macros: an array of any macro invocations found. Each entry here is an object with two properties:
    • name: the normalized name of the macro (lower case, ":" converted to "-")
    • args: any arguments passed to the macro, as an array of strings

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published