frequenz-floss / frequenz-channels-python

Channel implementations for Python
https://frequenz-floss.github.io/frequenz-channels-python/
MIT License
7 stars 8 forks source link

Remove boilerplate from examples in the user guide #276

Closed llucax closed 7 months ago

llucax commented 7 months ago

We filter out all the boilerplate (importing, declaring some variables) from the code shown in the user guide, as it is distracting for such a high-level introduction. This means more examples listed in modules have the boilerplate removed from the generated docs. We do this by adding the pymdownx-superfence-filter-lines markdown extension.

Examples in classes or functions, that usually show up in the API docs are kept as before, with all the code. This is so users wanting to dive deeper into the library can still copy&paste code snippets from these examples and expect them to mostly work.

llucax commented 7 months ago

Before:

image

After:

image