Skip to content

Commit

Permalink
Update RTD Placeholder
Browse files Browse the repository at this point in the history
Dynamically pull the RTD version from the environment
variable delivered by RTD

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
  • Loading branch information
Brett Logan committed Sep 2, 2020
1 parent ef2632e commit 0bd0ab2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/source/chaincode_lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ consistent across organizations:
endorse a transaction.
- **Collection Configuration:** The path to a private data collection definition
file associated with your chaincode. For more information about private data
collections, see the [Private Data architecture reference](https://hyperledger-fabric.readthedocs.io/en/{BRANCH}/private-data-arch.html).
collections, see the [Private Data architecture reference](https://hyperledger-fabric.readthedocs.io/en/{RTD_TAG}/private-data-arch.html).
- **ESCC/VSCC Plugins:** The name of a custom endorsement or validation
plugin to be used by this chaincode.
- **Initialization:** If you use the low level APIs provided by the Fabric Chaincode
Expand Down
12 changes: 9 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import sphinx_rtd_theme
from os import environ

sys.path.insert(0, os.path.abspath('.'))

import sphinx_rtd_theme
rtd_tag = 'release-2.2'
if environ.get('READTHEDOCS_VERSION') is not None:
rtd_tag = os.environ['READTHEDOCS_VERSION']

placeholder_replacements = {
"{BRANCH}" : "release-2.2"
"{BRANCH}" : "release-2.2",
"{BRANCH_DOC}" : "latest", # Used to target the correct ReadTheDocs distribution version
"{RTD_TAG}": rtd_tag
}

# -- General configuration ------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/source/docs_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ folder](https://github.com/hyperledger/fabric/tree/master/docs) in the
Hyperledger Fabric repository. Click on the following links to see how different
source files map to their corresponding published topics.

* [`/docs/source/index.rst`](https://raw.githubusercontent.com/hyperledger/fabric/master/docs/source/index.rst) maps to [Hyperledger Fabric title page](https://hyperledger-fabric.readthedocs.io/en/master/)
* [`/docs/source/index.rst`](https://raw.githubusercontent.com/hyperledger/fabric/master/docs/source/index.rst) maps to [Hyperledger Fabric title page](https://hyperledger-fabric.readthedocs.io/en/{RTD_TAG}/)

* [`/docs/source/developapps/developing-applications.rst`](https://raw.githubusercontent.com/hyperledger/fabric/master/docs/source/developapps/developing_applications.rst)
maps to [Developing
applications](https://hyperledger-fabric.readthedocs.io/en/master/developapps/developing_applications.html)
applications](https://hyperledger-fabric.readthedocs.io/en/{RTD_TAG}/developapps/developing_applications.html)

* [`/docs/source/peers/peers.md`](https://raw.githubusercontent.com/hyperledger/fabric/master/docs/source/peers/peers.md)
maps to
[Peers](https://hyperledger-fabric.readthedocs.io/en/master/peers/peers.html)
[Peers](https://hyperledger-fabric.readthedocs.io/en/{RTD_TAG}/peers/peers.html)

We'll see how to make changes to these files a little later.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ While this style guide will also refer to best practices using ReStructured Text

**When in doubt, use the docs themselves for guidance on how to format things.**

* [For RST formatting](http://hyperledger-fabric.readthedocs.io/en/release-1.4/channel_update_tutorial.html).
* [For RST formatting](http://hyperledger-fabric.readthedocs.io/en/{RTD_TAG}/channel_update_tutorial.html).

* [For Markdown formatting](http://hyperledger-fabric.readthedocs.io/en/release-1.4/peers/peers.html).
* [For Markdown formatting](http://hyperledger-fabric.readthedocs.io/en/{RTD_TAG}/peers/peers.html).

If you just want to look at how things are formatted, you can navigate to the Fabric repo to look at the raw file by clicking on `Edit on Github` link in the upper right hand corner of the page. Then click the `Raw` tab. This will show you the formatting of the doc. **Do not attempt to edit the file on Github.** If you want to make a change, clone the repo and follow the instructions in [Contributing](./CONTRIBUTING.html) for creating pull requests.

Expand Down

0 comments on commit 0bd0ab2

Please sign in to comment.