Skip to content

feat(docs): add complete C++ API reference#148

Draft
HaoZeke wants to merge 1 commit intometatensor:mainfrom
HaoZeke:cppAPIref
Draft

feat(docs): add complete C++ API reference#148
HaoZeke wants to merge 1 commit intometatensor:mainfrom
HaoZeke:cppAPIref

Conversation

@HaoZeke
Copy link
Member

@HaoZeke HaoZeke commented Feb 2, 2026

Try them out here: https://github.com/metatensor/metatomic/actions/runs/21580495763/artifacts/5339250994

Before:
image

Which may bring up more questions than answers in terms of the actual implementation.

Now also has:
image
image

To be fair it's a bit meh here since these are basically empty, but still nice to see IMO.

FWIW this is basically "imagine if showcode in the Python worked for the C++ bits"

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

Reviewer checklist

  • CHANGELOG updated with public API or any other important changes?

@HaoZeke HaoZeke force-pushed the cppAPIref branch 5 times, most recently from e477639 to 9fede14 Compare February 2, 2026 06:53
@HaoZeke HaoZeke marked this pull request as ready for review February 2, 2026 09:05
@HaoZeke HaoZeke requested a review from PicoCentauri February 2, 2026 09:35
@@ -0,0 +1,54 @@
#!/usr/bin/env nu
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, we are not adding a new tool to the doc stack. Can this be made to work inside sphinx/tox?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could probably rewrite it in bash, yes, it's just a shell script :D

@Luthaf
Copy link
Member

Luthaf commented Feb 2, 2026

Looking at the docs generated in CI, I don't find this better than the existing setup =/.

  • there are no links from types used as parameters to the types definition/documentation (NeighborListOptions and TensorBlock below)
Screenshot
  • I find the change to "block-style" code (instead of inline) every other line very distracting
  • there is no organisation of the documentation, stuff appear in the order it is defined in the header files, which is not necessarily the best order to explain/introduce things

I though this tool was about adding a link to the existing sphinx things to "click here to open the code for this function/class", which would work for me.

@HaoZeke
Copy link
Member Author

HaoZeke commented Feb 2, 2026

...

(agreed)

I though this tool was about adding a link to the existing sphinx things to "click here to open the code for this function/class", which would work for me.

Yup, that's the plan, lemme draft this and get back to it next weekend :D

@HaoZeke HaoZeke marked this pull request as draft February 2, 2026 10:28
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