-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retrieve JSON data from an external source
Allow the user to define a custom URL to retrieve the JSON data (instead of hitting Read the Docs API) needed to add the banner into the page. This is useful when there is a git tag that doesn't want to be updated, but now the warning message is out of date. So, by defining a custom URL (potentially a JSON under the git repository served by github, for example) this file is retrieved by the documentation and displayed the custom message needed at certain date. The JSON file can be updated independently from the documentation/tag/etc.
- Loading branch information
Showing
5 changed files
with
83 additions
and
14 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
class ConfigError(Exception): | ||
""" | ||
Incompatible config exception. | ||
This exception is risen when the extension detects configs that are | ||
incompatible or that depends each other. | ||
""" | ||
|
||
NO_JSON_URL = ( | ||
'No URL defined to retrieve JSON data. ' | ||
'The URL is mandatory when "versionwarning_retrieve_data_from_api" ' | ||
'is True' | ||
) |
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