Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evalCodeBlocks should accept configuration from an HTML comment within the input markdown #38

Open
pskfyi opened this issue May 2, 2023 · 0 comments
Labels
⚡️ effort:high enhancement New feature or request 🌶️ spicy Seems exciting to work on

Comments

@pskfyi
Copy link
Owner

pskfyi commented May 2, 2023

This would allow individual markdown files to contain their own find/replace strings, register language handlers, and other configurations. Here is a concept for discussion purposes:

<!--config:evalCodeBlocks:yaml

  fileHandler:
    py: "./python/evaulate.ts"
  replace:
  - ["hello", "goodbye"]
  - ["world", "mars"]
-->
  
```py
print("hello world!")
```
import { evalCodeBlocks } from "./handy/md/script/evalCodeBlocks.ts"

const markdown = Deno.readTextFileSync("./myFile.md") // the file above with the HTML comment

const results = evalCodeBlocks(markdown)

assert(results[0] === "goodbye mars")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡️ effort:high enhancement New feature or request 🌶️ spicy Seems exciting to work on
Projects
None yet
Development

No branches or pull requests

1 participant