fmease / rrustdoc Goto Github PK
View Code? Open in Web Editor NEWA rustdoc wrapper for rustdoc devs
License: MIT License
A rustdoc wrapper for rustdoc devs
License: MIT License
E.g., // compile-flags: --crate-name=name
, // edition: 2015
, // revisions: one two
, // aux-crate:dep=dep.rs
.
Figure out if we can use https://github.com/Manishearth/compiletest-rs here to obtain those directives. If that isn't feasible, lex source files with ra_ap_rustc_lexer
, extract line comments and manually parse a subset of compiletest
directives in a semi ad hoc fashion.
After that, add a flag / mode / means to run rrustdoc
on test/ui/{rustdoc,rustdoc-ui,rustdoc-json}/
files directly (i.e., without any modifications to those files). Figure out how to deal with revisions (obviously we should automatically run rrustdoc
for each revision but the specifics like UX aren't clear).
Lex the Rust source files with ra-ap-rustc_lexer
and implement a quick & dirty parser that looks for #![crate_name = "…"]
for increased robustness and correctness.
At the moment we just do a string-based search.
Actually using such crate names should however still be gated behind -a
/--crate-name-attr
.
This way you can pass -eS
to mean -e2021
(at the time of writing) and -eU
to mean -e2024
(at the time of writing).
If multiple input source files are passed, we should do something very similar to cargo doc
, i.e., “running rustc
N-1 times and rustdoc
N times” given N input files.
Figure out what -x
/--cross-crate
means if multiple files are passed. Probably reject.
We should have more “dev-y” configuration options available like passing --cfg doc
to dependency crates (which is what Cargo doesn't do at the moment, CC rust-lang/rust#114952) or not running rustc
at all (I don't know if that's useful, maybe for debugging cross-crate stuff; basically N input files => N rustdoc
executions (modulo compiletest
revisions, lol)).
Since we can't provide custom CLI flags ad nauseam (per rustc and rustdoc flag), we should have a fallback method just like Cargo via environment variables.
--cfg KEY
, --cfg KEY=VALUE
; -f FEATURE
(expands to --cfg 'feature="FEATURE"'
(or something like that, I can't remember)).
I probably won't use it that much but it would enable you to generate docs in even fewer steps:
⟨editor⟩ | rrustdoc - -o
For extensibility, we should support invocations of the form:
rrustdoc file.rs -- -a -b -c
Where the arguments following the --
get passed verbatim to rustc
and rustdoc
. This is not a replacement for the env vars RUSTFLAGS
and RUSTDOCFLAGS
(#5) since the latter gives you more control.
It's less flexible than the env vars but it's more ergonomic for sure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.