You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've noticed that the processing here can significantly slows down building the docs, probably because of BeautifulSoup.
On my website, running the plugin added an overhead of about 27s. Because I know the files where I want the swagger-ui tags to be used, I've added a simple filename filter patch to avoid trying to lookup on every single file. That improved the performance to only 2s!
defon_post_page(self, output, page, config, **kwargs):
"""Replace swagger-ui tag with iframe Add javascript code to update iframe height Create a html with Swagger UI for iframe """ifpage.file.namenotin ("rest_api", "rest-api"):
returnoutput
...
Proposal
My proposal is:
Add an option (e.g, filter_filenames), which provides an optional list of filenames to match before proceding the processing.
For backward-compat, if this option is not provided the plugin continue with its current behavior.
What do you think? I can open a PR next week
The text was updated successfully, but these errors were encountered:
pedro-psb
added a commit
to pedro-psb/mkdocs-swagger-ui-tag
that referenced
this issue
May 13, 2024
Another similar approach is to mark specific markdown pages using the yaml frontmatter and add a global option to not process a page unless its marked.
# some markdown page frontmatter
---
swagger-ui:
process-page: true
---
# mkdocs.yamlplugins:
mkdocs-swagger-ui:
process_all: false # default true for compatibility
Hello, I've noticed that the processing here can significantly slows down building the docs, probably because of BeautifulSoup.
On my website, running the plugin added an overhead of about 27s. Because I know the files where I want the swagger-ui tags to be used, I've added a simple filename filter patch to avoid trying to lookup on every single file. That improved the performance to only 2s!
Proposal
My proposal is:
filter_filenames
), which provides an optional list of filenames to match before proceding the processing.What do you think? I can open a PR next week
The text was updated successfully, but these errors were encountered: