1kastner / conflowgen

A generator for synthetic container flows at maritime container terminals with a focus on yard operations
MIT License
11 stars 7 forks source link

Use :py:obj role instead of default html links for keyword arguments #142

Closed 1kastner closed 2 years ago

1kastner commented 2 years ago

At e.g. https://conflowgen.readthedocs.io/en/latest/api.html#conflowgen.TransshipmentAndHinterlandSplit, we can see square boxes around the Python types. There can be manually created by using the Python object role of sphinx, i.e.

:obj:`str`

These square boxes we want to have around all types in the documentation!

However, currently these boxes are not used everywhere. When, e.g., using Python keyword arguments, default html links are used. This can be seen at e.g. https://conflowgen.readthedocs.io/en/latest/api.html#conflowgen.DatabaseChooser.create_new_sqlite_database. This could be solved by introducing the Python object role in those cases. Maybe there is also some option to do this via a smart change in the config?

1kastner commented 2 years ago

Let's see what comes back at https://github.com/sphinx-doc/sphinx/issues/10776

1kastner commented 2 years ago

With https://github.com/1kastner/conflowgen/pull/147 and the adapted custom.css, an intermediate solution has been identified. Only in https://github.com/sphinx-doc/sphinx/issues/10793, it is discussed that this does not work for Optional at the moment.