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

[Docs] reload api js files on change #13313

Merged
merged 5 commits into from Apr 25, 2023

Conversation

hasezoey
Copy link
Collaborator

Summary

This PR changes the documentation to be able to re-load the api js file to reflect any changes, previously api would be reload-able, but the reload would not reflect any changes from the original js file, only if the pug files were changed

in more detail:

  • changes the parse function in docs/source/api to be in 3 different functions:
    • process the properties processFile
    • load a file with dox and process file parseFile
    • load and process all defined files parseAllFiles
  • removes the global storage of the raw js parsed js files in docs/source/api (because it only needs to be loaded once and on reload would need to reload the anyway)
  • update scripts/website to be able to use the reload function
  • fix a accidental wrong type import in docs/source/utils.js from a previous PR

PS: the current approach is a little "hacky" because the docs/source/api file will always load it once at file-load time and the file-map docs/source/index will always store this one value and not update on reload, but the filemap.apiDocs value will update, this means that unless specifically loaded, the file-maps value will never update beyond the initial load - which should not pose a problem with the way the documentation is currently done (and for any scripts which will not make use of reload)

@hasezoey hasezoey added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label Apr 22, 2023
@hasezoey hasezoey requested a review from vkarpov15 April 22, 2023 12:47
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@vkarpov15 vkarpov15 added this to the 7.1.0 milestone Apr 25, 2023
@vkarpov15 vkarpov15 merged commit e446aa3 into Automattic:master Apr 25, 2023
1 check passed
@hasezoey hasezoey deleted the reloadableAPI branch April 25, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants