Skip to content

JsonDocCk: Automaticly infer file name #100588

Closed
@aDotInTheVoid

Description

@aDotInTheVoid

Right now in jsondocck all commands have the form // @<commandname> <file> <command args>

This form was inherited from htmldocck.py. However unlike HTML, the JSON output only produces 1 file. Therefor currently - can be used to imply the file for the previous command. Only the first command must specify the file.

It would be nice to automatically infer the name of the relevant file, so - is immediately available.

I don't think it makes sense to remove commands having paths, as eventual we probably want to write tests for the interaction between two crates JSON output (see #99513). It would also cause alot of churn.

Doing this also risks making the semantics of - more unclear. Is it the previously used file or the default file? These would be equivalent for every statement in the current test suite, but something to keep in mind for the future.

First discussed by @aDotInTheVoid in #100582 (comment)

@rustbot modify labels: +A-rustdoc-json +T-rustdoc

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-jsonArea: Rustdoc JSON backendT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions