Skip to content

Commit 1f262d9

Browse files
committed
tidy up docs for blocks, ensure that block icons are displayed
1 parent 56da647 commit 1f262d9

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

docs/source/blocks.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ bdsim blocks
44
.. image:: https://raw.githubusercontent.com/petercorke/bdsim/master/figs/[email protected]
55
:width: 400
66

7-
A set of block definitions that provide robotic capability to `bdsim <https://github.com/petercorke/bdsim>`_.
8-
9-
.. warning:: This capability is still experimental
7+
A set of block definitions that add robotic capability to the `bdsim <https://github.com/petercorke/bdsim>`_
8+
block diagram simulation environment.
109

1110
.. toctree::
1211
:maxdepth: 2

docs/source/exts/blockname.py

+22-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,27 @@ def block_name(name, rawtext, text, lineno, inliner, options={}, content=[]):
1111
# inliner: The docutils.parsers.rst.states.Inliner object that called role_fn. It contains the several attributes useful for error reporting and document tree access.
1212
# options: A dictionary of directive options for customization (from the "role" directive), to be interpreted by the role function. Used for additional attributes for the generated elements and other functionality.
1313
# content: A list of strings, the directive content for customization (from the "role" directive). To be interpreted by the role function.
14-
html_node = nodes.raw(text='<p style="border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;">' + text + '</p>', format='html')
14+
15+
html = """
16+
<table width="100%">
17+
<col style="width:80%">
18+
<col style="width:20%">
19+
<tr>
20+
<td>
21+
<p style="border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;">
22+
{0}
23+
</p>
24+
</td>
25+
<td>
26+
<img src="{1}" width=80 height=80>
27+
</td>
28+
</tr>
29+
</table>
30+
"""
31+
32+
# this is the path to the icons within the github repo
33+
path = "https://github.com/petercorke/robotics-toolbox-python/raw/master/roboticstoolbox/blocks/Icons/" + text.lower() + ".png"
34+
html_node = nodes.raw(text=html.format(text, path), format='html')
1535
return [html_node], []
1636

1737

@@ -21,4 +41,4 @@ def setup(app):
2141
'version': '0.1',
2242
'parallel_read_safe': True,
2343
'parallel_write_safe': True,
24-
}
44+
}

0 commit comments

Comments
 (0)