Adding versioning support to DocumentGenerator #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have added:
--branch : an argparse to get branch/tag name from user which documentation will be created based on it.
VERSION_PATTERN: hard coded pattern for branch/tag inputs coming from users. Only allows RX.X or RX.X.X
is_branch_name_valid(): method to check if --branch(argparse) is matching with VERSION_PATTERN
collect_existing_versions: it checks all the folders in ServicesInterfaceDocumentation repo and create a list if folder name matches with VERSION_PATTERN to find existing versions.
create_root_index: this method will create the index file which holds a dropbox and an iframe to show mkdocs files.
versions: this variable created to check if we are overriding an existing version or creating a new one
sorted_versions: variable to fill dropbox values
Also:
site_name changed from "Documentation" to branch_name to understand which version is currently shown on webpage.
if branch is given as RX.X, script automatically changes . with _ to download correct repository.
Instead of using mkdocs gh-deploy, we now use mkdocs build -d{branch_name} to create files locally in a folder
and then adding, commiting and pushing index.html and the folder that is holding mkdocs files to remote.