diff --git a/doc/common/extensions/classlink.py b/doc/common/extensions/classlink.py index 1404bd5..e336598 100644 --- a/doc/common/extensions/classlink.py +++ b/doc/common/extensions/classlink.py @@ -5,13 +5,15 @@ from docutils.parsers.rst import Directive class PybricksClasslinkDirective(Directive): required_arguments = 1 + optional_arguments = 1 def run(self): - # Get link name from sphinx-directive + # Get link and name from sphinx-directive name = self.arguments[0] + link = name if len(self.arguments) == 1 else self.arguments[1] html = ( - ''.format(name.lower()) + + ''.format(link.lower()) + '
' + '
' + 'class ' + diff --git a/doc/main/hubs/index.rst b/doc/main/hubs/index.rst index c4d410f..cc78b23 100644 --- a/doc/main/hubs/index.rst +++ b/doc/main/hubs/index.rst @@ -38,7 +38,7 @@ :height: 10 em :target: primehub.html -.. pybricks-classlink:: InventorHub +.. pybricks-classlink:: InventorHub PrimeHub .. figure:: ../../main/images/inventorhub.png :height: 10 em