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

Code-based plugin parameter docs #2877

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Code-based plugin parameter docs #2877

wants to merge 4 commits into from

Conversation

bjoluc
Copy link
Member

@bjoluc bjoluc commented Nov 21, 2022

Making this PR against core-rewrite for cleaner diffs, but it should target v8 once #2858 is merged.

We can have mkdocs auto-generate plugin parameter tables to reduce some redundancy, prevent mismatches, and – by moving extended parameter descriptions into source files – improve in-editor code hints 🎉
This setup uses the mkdocs-macros plugin and TypeDoc under the hood: When writing {{ plugin_parameters('html-keyboard-response') }} in a plugin's documentation, mkdocs invokes a python function that uses TypeDoc to parse the plugin's index.ts, retrieving a JSON representation which it uses to generate and return the markdown table ✨

To try it, check out the PR, run npm install, poetry install and npm run docs:preview. The html-keyboard-response.md docs look the same, but were generated on-the-fly 👍 Editing packages/plugin-html-keyboard-response/src/index.ts rebuilds the documentation.

@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2022

⚠️ No Changeset found

Latest commit: 8be09f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jodeleeuw
Copy link
Member

Oh that's fantastic. I've been dreaming of something like this for a while and never had the time to figure out how to pull it off. Excited to try it out and make the switch.

Base automatically changed from core-rewrite to v8 October 24, 2023 09:11
@jodeleeuw jodeleeuw added this to the 8.0 milestone Oct 28, 2023
Base automatically changed from v8 to main July 16, 2024 19:19
@jodeleeuw
Copy link
Member

@Bankminer78 and @vzhang03 - this could be another thing we do over the next 2 weeks.

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

Successfully merging this pull request may close these issues.

2 participants