feat: API documentation generation for Python, Go, and Kotlin#979
feat: API documentation generation for Python, Go, and Kotlin#979
Conversation
Thoralf-M
left a comment
There was a problem hiding this comment.
How will this be used? Since right now the docs are nowhere added
generate_docs.sh
Outdated
| echo "Step 2: Kotlin Docs" | ||
| cd bindings/kotlin | ||
| # Disable config cache due to Dokka/Gradle 9.2 incompatibility | ||
| ./gradlew dokkaGfm --no-configuration-cache |
There was a problem hiding this comment.
I see that for python and go the docs are written to .md files. I guess, dokkaGfm produces kotlin_api.md?
There was a problem hiding this comment.
By default, dokkaGfm produces a structured directory (to handle Kotlin's package/nested class hierarchy) with an index.md as the entry point. If you run this script, and go into the Kotlin/dokka/gfm/iota-sdk/iota_sdk, you will find different folders containing the needed .md files.
The script just help to extracts the docs directly from the source code. I do not know if we should call the script from upload-docs.yml to generate the .md files, which will then be sent to an AWS S3 bucket, from where it can then be pulled into our docs website. @Dr-Electron tried explaining the pipeline, but I will need more to understand the next steps, and what I should do next. |
generate_docs.sh
Outdated
|
|
||
| # Target the FFI layer specifically for full API coverage | ||
| echo "Extracting Python API reference..." | ||
| python3 -c "import iota_sdk.iota_sdk_ffi; help(iota_sdk.iota_sdk_ffi)" > python_api.md |
There was a problem hiding this comment.
Not sure if it makes a difference but in the past we used pydoc-markdown.
Any reason to go for this solution now?
There was a problem hiding this comment.
Oh no @Dr-Electron, no specific reason. I just used it based on my research; I didn't know PyDoc was the preferred one.
|
Yeah I would add this to an action. Maybe for now with a workflow dispatch and an input on which language we want to push? One we know that this works we can push on releases like we did in the past 👍 |
We are currently working on a PR in the docs 👍 |
|
We got swift and csharp bindings in the meantime |
|
Added a upload action: You don't need the secrets if you don't want to upload docs, so you can ignore it or remove it. |
|
The biggest issue is documentation generation tho as for Kotlin and Go we just generate way to big single files 😓 |
This PR adds a generate_docs.sh script to automate API documentation generation across the binding ecosystems.
Key Improvements: