-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[rustdoc] Respect .editorconfig files for source view #49155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If rustdoc encounters files with tab characters in them, it should just pass them along to the final source page. It's the web browser which is displaying the tabs with 8-space width. Should rustdoc replace tab characters with a number of spaces based on an |
Replacing tabs with spaces is not a good solution, in my opinion. It would be better to forward the |
It looks like it's possible to set the tab width in CSS, though it's currently "experimental" and isn't supported in IE/Edge. A small PR to set this to 4 (to match the style guide) could be a quick first step, but i'm less certain on full @rust-lang/rustdoc (and possibly @rust-lang/dev-tools more generally) What do y'all think? |
I personally think this is far too much complexity for too little advantage. |
Hardcoding tabwidth = 4 is good enough for me. 😎 With IE/Edge/Microsoft not respecting standards oftentimes, I wouldn’t care about these at all. 😉 |
I opened #50947 to hardcode 4 for tab width. |
…umeGomez rustdoc: set tab width in rust source blocks cc rust-lang#49155 (fixes it?) This sets the tab width ([in supported browsers](https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size)) in Rust source blocks to 4 spaces wide (instead of the default 8), to correspond with the style guidelines.
With #50947 merged, where does that leave this issue? Is |
Fine, thanks! |
…Gomez Fix rustdoc.css CSS tab-size property This fixes the CSS tab size property names which are called `tab-size` / `-moz-tab-size` and not `tab-width` Old issue rust-lang#49155 and related PR rust-lang#50947 tab-size: https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size
cargo doc
files currently show 8-spaces-wide tabs in source view. A general and portable approach for specifying editor settings of whole projects are.editorconfig
files. Please respect that, for making sure that alignment doesn’t get destroyed and is the same as in the editor.The text was updated successfully, but these errors were encountered: