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

allowing to activate/deactivate runnable examples #1

Open
edublancas opened this issue Apr 23, 2024 · 1 comment
Open

allowing to activate/deactivate runnable examples #1

edublancas opened this issue Apr 23, 2024 · 1 comment

Comments

@edublancas
Copy link
Contributor

edublancas commented Apr 23, 2024

for more context on this, see: https://github.com/ploomber/ploomber.io/issues/164

we are going to deploy interactive docs for mirascope

This codebase works, but there is one feature we're missing: deactivating runnable examples. currently, when configuring this plugin, all pages will have runnable examples, but there might be cases where we want to deactivate them for specific pages.

I started doing the work, this is how I think we can achieve it: pages can set arbitrary values by editing the front matter: https://raw.githubusercontent.com/ploomber/mkdocs-thebe/main/sample-mkdocs-project/docs/index.md

---
runnable_examples: false
---

then, we can read those values in the main template: https://github.com/ploomber/mkdocs-thebe/blob/main/src/mkdocs_thebe/assets/main.html and use that to determine whether we activate examples or not.

currently, the logic to activate the examples is on a separate file: https://github.com/ploomber/mkdocs-thebe/blob/main/src/mkdocs_thebe/assets/mkdocs-thebe.js

the easiest option is to move the content from mkddocs-thebe.js into main.html

and remove the file from here:

config["extra_javascript"].append("mkdocs-thebe.js")

@edublancas edublancas assigned bryannho and unassigned bryannho Apr 23, 2024
@edublancas
Copy link
Contributor Author

@bryannho let's put this on hold

@edublancas edublancas removed the stash label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants