Skip to content

Commit 13df49b

Browse files
authored
Merge pull request RasaHQ#5812 from RasaHQ/conf-variable
add arbitrary variable replacement in docs, use for sdk version
2 parents 7bfa71a + c539836 commit 13df49b

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

docs/conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@
6666
# The full version, including alpha/beta/rc tags.
6767
release = __version__
6868

69+
# Variables (formatted as `|variable|`) to be replaced in the text
70+
# Sphinx replaces `|release|` and `|version|` by default,
71+
# but we have to add an `rst_epilog` to replace our own variables
72+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
73+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-rst_epilog
74+
from rasa_sdk import __version__ as rasa_sdk_version
75+
76+
# type : Dict[Text, Text]
77+
variables_to_replace = {"rasa_sdk_version": rasa_sdk_version}
78+
79+
rst_epilog = ""
80+
for name, value in variables_to_replace.items():
81+
rst_epilog += f".. |{name}| replace:: {value}\n"
82+
83+
6984
# The language for content autogenerated by Sphinx. Refer to documentation
7085
# for a list of supported languages.
7186
#

docs/user-guide/docker/building-in-docker.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ You can then run the actions with the following command:
222222

223223
.. parsed-literal::
224224
225-
docker run -d -v $(pwd)/actions:/app/actions --net my-project --name action-server rasa/rasa-sdk:\ |version|.0
225+
docker run -d -v $(pwd)/actions:/app/actions --net my-project --name action-server rasa/rasa-sdk:\ |rasa_sdk_version|
226226
227227
228228
Here's what's happening in that command:
@@ -232,7 +232,7 @@ Here's what's happening in that command:
232232
container so that the action server can run the code in the ``actions`` folder
233233
- ``net my-project``: Run the server on a specific network so that the rasa container can find it
234234
- ``--name action-server``: Gives the server a specific name for the rasa server to reference
235-
- rasa/rasa-sdk:|version|.0 : Uses the Rasa SDK image with the tag |version|.0
235+
- rasa/rasa-sdk:|rasa_sdk_version| : Uses the Rasa SDK image with the tag |rasa_sdk_version|
236236

237237

238238
Because the action server is running in detached mode, if you want to stop the container,

docs/user-guide/how-to-deploy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ To create your image:
128128
.. parsed-literal::
129129
130130
# Extend the official Rasa SDK image
131-
FROM rasa/rasa-sdk:\ |version|.0
131+
FROM rasa/rasa-sdk:|rasa_sdk_version|
132132
133133
# Use subdirectory as working directory
134134
WORKDIR /app

0 commit comments

Comments
 (0)