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鈥檛 get destroyed and is the same as in the editor.
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 .editorconfig file? That seems like quite a bit of overhead.
Replacing tabs with spaces is not a good solution, in my opinion. It would be better to forward the .editorconfig tab setting to the browser. Can this be realized?
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 .editorconfig support. It seems like overkill for a documentation tool to go and look at your text editor's configuration just because it displays source code. I wouldn't reject such a PR outright, but my personal opinion is that i won't prioritize it either.
@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鈥檛 care about these at all. 馃槈
I opened https://github.com/rust-lang/rust/pull/50947 to hardcode 4 for tab width.
With https://github.com/rust-lang/rust/pull/50947 merged, where does that leave this issue? Is .editorconfig support still that pressing for you, or can we go ahead and close this?
Fine, thanks!
Most helpful comment
I personally think this is far too much complexity for too little advantage.