new feature: translate core doc references in generated binding docs

Aperta
#9,334 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, cpp, csharp, go, java, node.js, ocaml, python, rust

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Rust
Stelle
5.5k
Fork
869
Merge medio
8h 2m
PR unite (30g)
862

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/opendal

Tutte le issue di apache/opendal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.