-
-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Memoize generation of plugin parameter docs
- Loading branch information
Showing
6 changed files
with
46 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ dist.zip | |
packages/jspsych/README.md | ||
.turbo | ||
*.pyc | ||
cache.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
from logging import getLogger | ||
from pathlib import Path | ||
|
||
from docs.__generator__.plugins import generate_plugin_parameters_section | ||
from docs.__generator__.utils import hash_file | ||
|
||
logger = getLogger("mkdocs") | ||
|
||
# https://mkdocs-macros-plugin.readthedocs.io/en/latest/macros/ | ||
def define_env(env): | ||
@env.macro | ||
def plugin_parameters(plugin_dir: str): | ||
logger.info(f"Collecting parameter infos for plugin {plugin_dir}...") | ||
return generate_plugin_parameters_section(plugin_dir) | ||
def plugin_parameters(plugin: str): | ||
plugin_dir = Path(f"packages/plugin-{plugin}") | ||
|
||
return generate_plugin_parameters_section( | ||
plugin_dir, hash_file(plugin_dir / "src/index.ts") | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters