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
Add docs/source/api
to docs/source/index
filemap AND add better versioning support
#13222
Conversation
because it is now handled by "website"
and dont import "api.js" directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great 👍 I was just having some trouble testing docs generation on 6.x branch, looks like this might help with that.
@vkarpov15 would you want a backport of this PR to the 6.x branch? |
Yeah backport would be nice. Merge conflicts will be a bit messy, but hopefully not too bad. |
Summary
This PR consists of 2 parts:
part 1:
dos/source/api
to thedocs/source/index
filemapdocs/source/splitApiDocs.js
to/scripts/website.js
docs/source/api
out
(/module.exports.docs
/data
)name
totitle
to matchdocs/source/index
schemepug.render
oncedocs/source/splitApiDocs.js
lib/*
filesdocs/api_split.pug
(reload all api files)scripts/generateSearch
for the changes madescripts/generateSearch
to use the already generated url instead of re-doing itdocs:generate
part 2:
git tag
)docs/6.x
fs-extra
to copy the full directories (not usingncp
because it is old and nodejs does not have a native way, would replacencp
later)fixes #13148
Notes on the new versioning:
the new version in made so that without environment variable
DOCS_DEPLOY=true
it will behave as if no versioning is present (not outputting any new sub-directories or adding things to urls), but once the environment variable is set, it will:docs/
like alwaysdocs/6.x
, including all files that are required (like js, css, and even<root>/index.pug
)this change makes it so that versioned docs can still be locally run without screwing up static paths (like js and css) but also easy to deploy to gh-pages (hopefully)
should i add a package.json script for deploying with
DOCS_DEPLOY=true
?