new feature: translate core doc references in generated binding docs

Abierto
#9,334 3 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
c, cpp, csharp, go, java, node.js, ocaml, python, rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Rust
Estrellas
5.5k
Forks
869
Merge medio
8 h 2 min
PR fusionados (30 d)
862

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/opendal

Todos los issues de apache/opendal

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.