Skip to content

Add crate documentation - #12

Draft
fsimonis wants to merge 1 commit into
mainfrom
add-documentation
Draft

fsimonis wants to merge 1 commit into
mainfrom
add-documentation

Conversation

@fsimonis

@fsimonis fsimonis commented Feb 3, 2026

Copy link
Copy Markdown
Member

To reproduce run DOCS_RS=1 cargo doc and open target/doc/precice/index.html

@fsimonis
fsimonis requested a review from MakisH February 3, 2026 18:26
Comment thread src/lib.rs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I could not build this on my system. Since the default Rust on my system (1.75) was too old, I installed the latest available (1.89), but I still get an issue:

rust-bindings [add-documentation]$ DOCS_RS=1 cargo-1.89 doc
    Updating crates.io index
     Locking 34 packages to latest compatible versions
   Compiling proc-macro2 v1.0.106
   Compiling quote v1.0.44
   Compiling shlex v1.3.0
   Compiling find-msvc-tools v0.1.9
   Compiling unicode-ident v1.0.23
   Compiling hashbrown v0.16.1
   Compiling equivalent v1.0.2
   Compiling cxxbridge-flags v1.0.194
   Compiling scratch v1.0.9
 Documenting unicode-ident v1.0.23
   Compiling cc v1.2.55
error: the `-Z unstable-options` flag must also be passed to enable the flag `check-cfg`

error: could not document `unicode-ident`
warning: build failed, waiting for other jobs to finish...

Would it be a good idea to add the building step to the CI?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

CI yes. Especially as it doesn't require a precice installation

Comment thread src/lib.rs
Comment on lines +5 to +6
//! The methods of the [Participant] map directly to their C++ counterparts.
//! Therefore the documentation of this crate is kept relatively minimal.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not necessarily a documentation issue but:

Similar issue as with the Fortran module: how do we ensure that all the methods in this repository still exist or have the right signatures?

precice/fortran-module#15

Triggered by a similar question: "how do we ensure consistency in the documentation"? Since this is not Doxygen, we cannot do copydoc.

Comment thread src/lib.rs
//! # Example applications
//!
//! - The crate contains a [solverdummy](https://github.com/precice/rust-bindings/tree/main/examples) as example.
//! - The tutorials contain a rust version of both participants for the [1D elastic-tube tutorial](https://precice.org/tutorials-elastic-tube-1d.html).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this list could get outdated quickly, I would rather point either to the Tutorials overview, or to such a URL:

https://github.com/search?q=repo%3Aprecice%2Ftutorials%20Cargo.toml&type=code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's a good idea!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's a good idea!

Comment thread src/lib.rs
/// | Spatial Dimensions | Scalar Data | Vectorial Data |
/// | --- | --- | --- |
/// | **2D** | s dx, s dy | x dx, y dx, x dy, y dy |
/// | **3D** | s dy, s dy, s dz | x dx, y dx, z dx, x dy, y dy, z dy, x dz, y dz, z dz |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/// | **3D** | s dy, s dy, s dz | x dx, y dx, z dx, x dy, y dy, z dy, x dz, y dz, z dz |
/// | **3D** | s dx, s dy, s dz | x dx, y dx, z dx, x dy, y dy, z dy, x dz, y dz, z dz |

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@MakisH

MakisH commented Feb 10, 2026

Copy link
Copy Markdown
Member

To reproduce run DOCS_RS=1 cargo doc and open target/doc/precice/index.html

Maybe also add this information in the README.md?

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