new feature: translate core doc references in generated binding docs

Open
#9,334 3 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
c, cpp, csharp, go, java, node.js, ocaml, python, rust

Research direction

Start with the shared parsers in dev/src/generate/options.rs, capability.rs, and metadata.rs, then inspect the per-binding generators under dev/src/generate/. Reuse the existing Java and .NET translation logic as the initial mapping and rendering cases. Done means generated Capability, Metadata, and options docs use binding-specific names and valid doc syntax without raw Rust paths or intra-doc links.

Written by the indexing model from the issue text.

Description

bindings/c bindings/cpp bindings/dotnet bindings/go bindings/java bindings/nodejs bindings/ocaml bindings/python enhancement

Drafted with AI assistance (Claude Code, Claude Opus 5.5); the author is accountable for it.

Feature Description

The generators in dev/src/generate/ copy core's doc comments into each binding's Capability, Metadata, and options docs, keeping Rust identifiers, paths, and intra-doc links the binding lacks. I propose a small shared doc post-processor that translates those references into each binding's names.

Problem and Solution

Examples:

  • writeCanCopyFrom says "Writer::copy_from remains available…" in Node.js, Java, .NET, and C.
  • write_with_checksum keeps the raw intra-doc link [crate::WriteChecksum::Any] in every binding; OCaml escapes it as \[crate::WriteChecksum::Any\].
  • Options docs (#9320) say "requires Capability::list_with_start_after" where Node.js exposes listWithStartAfter, and point to crate::layers::SimulateLayer and the auto-simulate Cargo feature.

Today: the shared parsers return raw doc text, and the Capability and Metadata generators pass it through or only escape it. Java and .NET option docs already translate links, each with its own copy (option_javadoc_token, DocContext::path), but not for Capability or Metadata. The website generator drops every sentence containing ::.

Proposed direction: a post-processor next to the shared parsers that:

  1. Parses inline rustdoc markup once: intra-doc links, Markdown links, and code spans.
  2. Resolves known core identifiers (capability fields, metadata accessors, option structs and fields, operation names) through a per-binding naming function, which each binding renders in its own doc syntax ({@link}, <see cref>, code span).
  3. Leaves unknown Rust paths as plain code spans, or drops them where a binding has no equivalent (layers, Cargo features).

The Java and .NET translators would become per-binding naming and rendering on top of the shared parser. Out of scope: rewriting prose; Rust-only sentences stay per-binding overrides, as the Node.js metadata notes do.

Additional Context

Related: #9320, #9122, #9129.

Are you willing to contribute to the development of this feature?
  • Yes, I am willing to contribute to the development of this feature.
Dominant language
Rust
Stars
5.5k
Forks
869
Avg merge
8h 2m
Merged PRs (30d)
862

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/opendal

All issues in apache/opendal

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.