Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation api examples #563

Merged
merged 2 commits into from
Sep 14, 2023
Merged

Conversation

engelmi
Copy link
Member

@engelmi engelmi commented Sep 13, 2023

This PR improves the documentation with the API examples as well as about the code generation based on the introspection data.
It contains the following changes:

  • introducing a new theme to support the tabs for showing the examples in different programming languages
  • adding a custom js script was added to synchronize the tabs (e.g. when Python tab is clicked for the setup, all other tabs follow suit).
  • adding Go examples and aligning the output with the python ones
  • keeping the Rust and C/C++ examples, but not showing them in the documentation for now as only a subset of the 9 use cases are written in those languages - those can be easily added later on (future work)

The changes can be viewed by running mkdocs locally described in https://github.com/containers/bluechi/blob/main/doc/README.md

Some images to showcase the theme change:

image

image

@dougsland
Copy link
Contributor

fancy!

@engelmi engelmi force-pushed the improve-documentation-api-examples branch 2 times, most recently from 07b1e54 to f41d676 Compare September 14, 2023 07:19
@engelmi engelmi marked this pull request as ready for review September 14, 2023 07:49
@engelmi engelmi force-pushed the improve-documentation-api-examples branch 4 times, most recently from 24b0cfb to 49643d9 Compare September 14, 2023 09:13
By using tabs, the code snippet for the api examples can
be grouped by use case and split by language.
Unfortunately, the pymdownx.tabbed seems to not work
properly with the readthedocs theme. Because of that the
theme was exchanged with material. The dependency for it
was added.
In order to sync tabs with the same title, e.g. multiple
tabs for python code, a dedicated js script was added.

Signed-off-by: Michael Engel <[email protected]>
Group the api examples by use case and provide them for each
language we want to show an example for. Also, instead of
only showing snippets, describe a basic setup to run the
example code. Adding all examples for Go and a few for C and
Rust as well.

Signed-off-by: Michael Engel <[email protected]>
@engelmi engelmi force-pushed the improve-documentation-api-examples branch from 49643d9 to a8e9fe5 Compare September 14, 2023 10:50
Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@engelmi engelmi merged commit 9891b57 into main Sep 14, 2023
@engelmi engelmi deleted the improve-documentation-api-examples branch September 14, 2023 11:50
This was referenced Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants