Skip to content

Extract all definitions from a spec into an anchors.bsdata file #2006

@kainino0x

Description

@kainino0x

WebGPU needs cross-links between multiple documents in the same repository (the WebGPU spec, the shading language spec WGSL, and I'd also like to be able to write our explainer in bikeshed to use cross-links to those two specs).

These specs aren't published so they're not in the global database yet - but it would also be nice if we could e.g. ref a term from WebGPU in the same commit where it's defined in WGSL.

One way to solve this would be with a build step that generates anchors.bsdata from a spec. Then for a full build we could do something like:

  • build wgsl/index.bs, ignoring link errors, and generating wgsl/index.anchors.bsdata
  • cp wgsl/index.anchors.bsdata spec/anchors.bsdata
  • build spec/index.bs, generating spec/index.anchors.bsdata
  • cp spec/index.anchors.bsdata wgsl/anchors.bsdata
  • rebuild wgsl/index.bs without ignoring link errors
  • cat spec/index.anchors.bsdata wgsl/index.anchors.bsdata > explainer/anchors.bsdata
  • build explainer/index.bs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions