Skip to content

Conversation

@elliotgunton
Copy link
Member

@elliotgunton elliotgunton commented Dec 2, 2025

Motivation

Argo Workflows focuses on using YAML to write Workflows. It is not immediately obvious from the Walkthrough that Python is usable through Hera. Using the tabbed approach for the code examples means users can view the entire walkthrough in their preferred language, which should be even more useful if/when Argo Workflows supports SDKs in other languages (notably Go could be used). The tab is "linked" throughout the docs, so once a reader clicks "Python", all tabbed examples will switch to Python.

Modifications

  • Updated the mkdocs.yml configuration to allow features like the tabbed examples
  • Added Python examples to the walkthrough, in particular improving the Scripts and Results page wording and introducing Hera for Python.
  • I mostly converted the YAML from the walkthrough using the Hera CLI to convert it to Python code, then tidied up the boilerplate to be a bit more idiomatic (though most of the examples use container which isn't the main strength of Hera).
  • The first few examples also use the "annotate" feature of the material mkdocs theme, to tell the user to install the hera package and link to the Hera walkthrough for a Python-centric walkthrough.

The finished result looks like:
YAML:
image

Python:
image

Annotation:
image

* Add Python code to hello-world walkthrough page to ensure everything works
* Features added:
  * `pymdownx.blocks.tab` for tabbed examples
  * Deprecated `codehilite` replaced with `pymdownx.highlight`, which with
  `content.code.copy`, allows copying from code blocks
  * `content.code.annotate` for expandable code annotations
  * `content.tabs.link` to ensure that if users choose "Python", then
  all tabbed examples will change
  * `pymdownx.superfences` added by itself, as adding `custom_fences`
  means the defaults are not enabled

Signed-off-by: Elliot Gunton <[email protected]>
* For the first few pages

Signed-off-by: Elliot Gunton <[email protected]>
@elliotgunton elliotgunton changed the title docs: Add Python SDK to walkthrough docs: Add Python side by side examples to walkthrough Dec 2, 2025
@elliotgunton elliotgunton marked this pull request as ready for review December 2, 2025 17:09
Copy link
Contributor

@gianarb gianarb left a comment

Choose a reason for hiding this comment

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

In general, I really like documentations that are not tight to a specific language if they support more than one 👍

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.

2 participants