Skip to content

Commit 669c430

Browse files
committed
Add xml and yaml exmaple to docstring
Signed-off-by: Christian Ruf <[email protected]>
1 parent 0c88971 commit 669c430

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

launch/launch/substitutions/string_join_substitution.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,31 @@ class StringJoinSubstitution(Substitution):
3636
3737
.. code-block:: python
3838
39-
StringJoinSubstitution(
40-
[['https', '://'], LaunchConfiguration('subdomain')], 'ros', 'org'],
39+
subdomain = LaunchConfiguration(variable_name='subdomain', default='docs')
40+
url = StringJoinSubstitution(
41+
[['https', '://'], subdomain], 'ros', 'org'],
4142
delimiter='.'
4243
)
4344
44-
If the ``subdomain`` launch configuration was set to ``docs``
45-
and the ``delimiter`` to ``.``, this would result in a string equal to
45+
.. code-block:: xml
46+
47+
<launch>
48+
<arg name="subdomain" default="docs"/>
49+
<let name="url" value="$(string-join . https://$(var subdomain) ros org)"/>
50+
</launch>
51+
52+
.. code-block:: yaml
53+
54+
launch:
55+
- arg:
56+
name: subdomain
57+
default: "docs"
58+
- let:
59+
name: url
60+
value: "$(string-join . https://$(var subdomain) ros org)"
61+
62+
If the ``subdomain`` launch configuration was set to ``docs`` and the ``delimiter`` to ``.``,
63+
then any of the above launch descriptions would result in a string equal to
4664
4765
.. code-block:: python
4866

0 commit comments

Comments
 (0)