about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-1/+1
This is done by moving some data definitions to syntax::expand.
2019-10-21Add option to disable keyboard shortcuts in docsGuillaume Gomez-0/+1
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-2/+2
2019-10-13ast: remove implicit pprust dependency via Display.Mazdak Farrokhzad-1/+2
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
2019-09-29rustdoc: Fix default logo filenameOliver Middleton-1/+1
2019-09-23Remove unused argumentsMark Rousskov-14/+10
2019-09-23Utilize shared error codes rather than re-querying envMark Rousskov-1/+1
2019-09-23Remove pointless orMark Rousskov-2/+2
2019-09-23Remove needless Rc<RefCell<...>>Mark Rousskov-2/+2
2019-09-23Provide helper for synthesizing paths with resource suffixMark Rousskov-29/+40
2019-09-13Stylistic fix -- remove double implMark Rousskov-2/+0
2019-09-13Move cache into Context, avoid TLSMark Rousskov-29/+26
This doesn't move everything over as cache() is pretty annoying to remove fully, but it gets the ball rolling.
2019-09-13Move `Cache` generation to separate moduleMark Rousskov-654/+14
2019-09-13Move playground to shared contextMark Rousskov-35/+38
2019-09-13Move error codes to shared contextMark Rousskov-4/+4
2019-09-13Move edition field out of ContextMark Rousskov-8/+9
2019-09-13Replace SlashChecker with ensure_trailing_slashMark Rousskov-12/+10
2019-09-13Simplify render_spotlight_traitsMark Rousskov-6/+2
2019-09-13Remove *Space wrappers in favor of direct impls or functionsMark Rousskov-41/+41
2019-09-13Unwrap Visibility fieldsMark Rousskov-3/+2
There's not really any reason to not have the visibility default to inherited, and this saves us the trouble of checking everywhere for whether we have a visibility or not.
2019-09-13Move to print functions on types instead of impl fmt::DisplayMark Rousskov-59/+68
This will eventually allow us to easily pass in more parameters to the functions without TLS or other such hacks
2019-09-07Move to buffers throughout print_itemMark Rousskov-425/+372
2019-09-07Item to functionMark Rousskov-84/+79
2019-09-07AllTypes to functionMark Rousskov-32/+30
2019-09-07Settings to functionMark Rousskov-36/+19
2019-09-07layout::render takes Print instead of fmt::DisplayMark Rousskov-5/+5
2019-09-07De-indent all fmt::Display impls for later replacement to functionsMark Rousskov-233/+233
2019-09-07Delete Sidebar struct in favor of FnOnce implMark Rousskov-8/+2
2019-09-07Implement Print for FnOnce(&mut Buffer)Mark Rousskov-5/+5
This means that callers can pass in a closure like `|buf| some_function(..., &mut buf)` and pass in arbitrary arguments to that function without complicating the trait definition. We also keep the impl for str and String, since it's useful to be able to just pass in "" or format!("{}"...) results in some cases. This changes Print's definition to take self, instead of &self, because otherwise FnOnce cannot be called directly. We could instead take FnMut or even Fn, but that seems like it'd merely complicate matters -- most of the time, the FnOnce does not constrain us at all anyway. If it does, a custom Print impl for &'_ SomeStruct is not all that painful.
2019-09-07Move sidebar to Buffer-printingMark Rousskov-60/+44
2019-09-07Replace writeln!/write! with push_strMark Rousskov-81/+69
2019-09-07Move constant parameters to render to Layout structMark Rousskov-22/+7
2019-09-07Remove needless clone of layoutMark Rousskov-2/+1
2019-09-07Create buffers in top-level renderingMark Rousskov-28/+21
This avoids needlessly creating and threading the buffers through when we only use them once.
2019-09-07Migrate top-level rendering to BufferMark Rousskov-42/+41
2019-09-05Fix invalid span generation when it should be divGuillaume Gomez-4/+4
2019-08-29Rollup merge of #62734 - GuillaumeGomez:hide-default-methods, r=Mark-SimulacrumMazdak Farrokhzad-11/+14
Hide trait default methods Fixes #62499. However, the question remains: do we want to extend it to this point or not? r? @QuietMisdreavus
2019-08-26Shorten line during rendering instead of in markdownMark Rousskov-25/+35
2019-08-26Inline recurse into only callsiteMark Rousskov-57/+40
2019-08-26Transition a few fmt::Display impls to functionsMark Rousskov-3/+3
This introduces a WithFormatter abstraction that permits one-time fmt::Display on an arbitrary closure, created via `display_fn`. This allows us to prevent allocation while still using functions instead of structs, which are a bit unwieldy to thread arguments through as they can't easily call each other (and are generally a bit opaque). The eventual goal here is likely to move us off of the formatting infrastructure entirely in favor of something more structured, but this is a good step to move us in that direction as it makes, for example, passing a context describing current state to the formatting impl much easier.
2019-08-26Store only the current depthMark Rousskov-5/+5
Previously we stored the entire current path which is a bit expensive and only ever accessed its length. This stores the length directly.
2019-08-26Remove dead tracking of external param namesMark Rousskov-26/+0
2019-08-26Move source HTML generation to own moduleMark Rousskov-173/+6
2019-08-22Rollup merge of #63782 - GuillaumeGomez:theme-switch-fix, r=kinnisonMazdak Farrokhzad-8/+8
Fix confusion in theme picker functions To reproduce the bug currently: click on the theme picker button twice (to show it then hide it). Then click anywhere else: the dropdown menu appears again. The problem was coming from a confusion of what the `hideThemeButtonState` and `showThemeButtonState` were supposed to do. I switched their codes and updated the `switchThemeButtonState` function. It now works as expected. r? @kinnison
2019-08-21Fix confusion in theme picker functionsGuillaume Gomez-8/+8
2019-08-21Replaced skipStorage with saveTheme variableGuillaume Gomez-1/+1
2019-08-11Drop RefCell from IdMap in markdown renderingMark Rousskov-5/+4
2019-08-11Remove fmt::Display impls on Markdown structsMark Rousskov-5/+5
These impls prevent ergonomic use of the config (e.g., forcing us to use RefCell) despite all usecases for these structs only using their Display impls once.
2019-08-11Remove thread-local for playground configMark Rousskov-9/+20
2019-08-11Store typed PassesMark Rousskov-10/+4