about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2019-01-07Update static files code for updated Source Serif Pro fontTrevor Spiteri-6/+4
2018-12-29Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavusbors-5/+15
Add no-crate filter option on rustdoc @onur asked me about it so here it is! r? @QuietMisdreavus
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-25Auto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelixbors-7/+5
address some FIXME whose associated issues were marked as closed part of #44366
2018-12-24Add no-crate filter option on rustdocGuillaume Gomez-5/+15
2018-12-23Rollup merge of #57011 - QuietMisdreavus:static-root-path, r=GuillaumeGomezkennytm-6/+22
rustdoc: add new CLI flag to load static files from a different location This PR adds a new CLI flag to rustdoc, `--static-root-path`, which controls how rustdoc links pages to the CSS/JS/font static files bundled with the output. By default, these files are linked with a series of `../` which is calculated per-page to link it to the documentation root - i.e. a relative link to the directory given by `-o`. This is causing problems for docs.rs, because even though docs.rs has saved one copy of these files and is dispatching them dynamically, browsers have no way of knowing that these are the same files and can cache them. This can allow it to link these files as, for example, `/rustdoc.css` instead of `../../rustdoc.css`, creating a single location that the files are loaded from. I made sure to only change links for the *static* files, those that don't change between crates. Files like the search index, aliases, the source files listing, etc, are still linked with relative links. r? @GuillaumeGomez cc @onur
2018-12-23Rollup merge of #56967 - GuillaumeGomez:regen-search-index, r=QuietMisdreavuskennytm-2/+2
Replace current crate's searchIndex when regenerating Fixes #56921. r? @QuietMisdreavus
2018-12-22Auto merge of #56824 - euclio:internal-apis, r=QuietMisdreavusbors-95/+105
rustdoc: display rustc_private APIs as "Internal" This PR updates the display of `rustc_private` APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the `rustc_private` feature to sound more informative and less like a compiler suggestion. The PR additionally contains a significant refactor of the `short_stability` function to remove duplication and fix a few rendering bugs due to extra or missing spaces. Before: ![screen shot 2018-12-14 at 11 45 28 am](https://user-images.githubusercontent.com/1372438/50015926-c9768d80-ff95-11e8-9649-5df29df6909b.png) After: ![screen shot 2018-12-14 at 11 45 11 am](https://user-images.githubusercontent.com/1372438/50015934-cf6c6e80-ff95-11e8-912b-74b893f55425.png)
2018-12-21Auto merge of #55798 - GuillaumeGomez:version-display-associated-const, ↵bors-30/+50
r=QuietMisdreavus Add version display for associated consts Fixes #54030. <img width="1440" alt="screenshot 2018-11-08 at 23 57 29" src="https://user-images.githubusercontent.com/3050060/48232648-99decf00-e3b2-11e8-9f41-6bd12a161c7d.png"> r? @QuietMisdreavus
2018-12-20display rustc_private APIs as "Internal"Andy Russell-7/+31
2018-12-20split extra_scripts to handle root_path shenanigansQuietMisdreavus-6/+13
2018-12-20new --static-root-path flag for controlling static file locationsQuietMisdreavus-0/+9
2018-12-19FIXME(9639) remove fixme and accept non-utf8 paths in librustdocNiv Kaminer-7/+5
2018-12-19Replace current crate's searchIndex when regeneratingGuillaume Gomez-2/+2
2018-12-18Fix DOM errorsGuillaume Gomez-29/+25
2018-12-16Add version display for associated constsGuillaume Gomez-8/+32
2018-12-16Fix invalid JS file generationGuillaume Gomez-3/+3
2018-12-15Auto merge of #56005 - GuillaumeGomez:speedup-doc-render, r=QuietMisdreavusbors-57/+47
Greatly improve rustdoc rendering speed issues Fixes #55900. So a few improvements here: * we're switching to `DOMTokenList` API when available providing a replacement if it isn't (should only happen on safari and IE I think...) * hide doc sections by default to allow the whole HTML generation to happen in the background to avoid triggering DOM redraw all the times (which killed the performances) r? @QuietMisdreavus
2018-12-14simplify deprecation and stability renderingAndy Russell-98/+84
2018-12-14Rollup merge of #56709 - GuillaumeGomez:reduce-search-index, r=QuietMisdreavuskennytm-5/+11
Remove unneeded extra chars to reduce search-index size Before: ``` 2013782 Dec 11 10:16 build/x86_64-unknown-linux-gnu/doc/search-index.js ``` After: ``` 1736597 Dec 11 10:50 build/x86_64-unknown-linux-gnu/doc/search-index.js ``` No changes in the output of the search. r? @QuietMisdreavus
2018-12-13Split on words insteadGuillaume Gomez-5/+11
2018-12-08rustdoc: Fix local reexports of proc macrosOliver Middleton-1/+2
Filter out `ProcMacroStub`s to avoid an ICE during cleaning. Also add proc macros to `cache().paths` so it can generate links.
2018-12-08Auto merge of #56578 - alexreg:cosmetic-1, r=alexregbors-1/+1
Various minor/cosmetic improvements to code r? @Centril 😄
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-07use top level `fs` functions where appropriateAndy Russell-12/+4
This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-12-07Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrumkennytm-1/+1
Replace usages of `..i + 1` ranges with `..=i`. Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
2018-12-06Show 'loading content' when loading contentGuillaume Gomez-54/+42
2018-12-06Show everything when noscript is onGuillaume Gomez-0/+3
2018-12-06Greatly improve rustdoc rendering speed issuesGuillaume Gomez-3/+2
2018-12-06Rollup merge of #56332 - GuillaumeGomez:specifi-crate-search, r=QuietMisdreavusPietro Albini-1/+3
[rustdoc] Specific crate search Reopening of #54706. Fixes #54616. <img width="1440" alt="screenshot 2018-11-29 at 01 29 11" src="https://user-images.githubusercontent.com/3050060/49191372-979adf80-f376-11e8-963e-e4feb927c1da.png"> r? @QuietMisdreavus
2018-12-05Auto merge of #56549 - pietroalbini:rollup, r=pietroalbinibors-4/+4
Rollup of 15 pull requests Successful merges: - #51753 (Document `From` implementations) - #55563 (Improve no result found sentence in doc search) - #55987 (Add Weak.ptr_eq) - #56119 (Utilize `?` instead of `return None`.) - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs) - #56388 (More MIR borrow check cleanup) - #56424 (Mention raw-ident syntax) - #56452 (Remove redundant clones) - #56456 (Handle existential types in dead code analysis) - #56466 (data_structures: remove tuple_slice) - #56476 (Fix invalid line number match) - #56497 (cleanup: remove static lifetimes from consts in libstd) - #56498 (Fix line numbers display) - #56523 (Added a bare-bones eslint config (removing jslint)) - #56538 (Use inner iterator may_have_side_effect for Cloned) Failed merges: r? @ghost
2018-12-05Rollup merge of #56119 - frewsxcv:frewsxcv-option-carrier, r=TimNNPietro Albini-4/+4
Utilize `?` instead of `return None`. None
2018-12-05Auto merge of #55933 - euclio:doc-panic, r=QuietMisdreavusbors-2/+2
emit error when doc generation fails Fixes #41813. The diagnostic looks something like this: ``` error: couldn't generate documentation: No space left on device (os error 28) | = note: failed to create or modify "/path/to/crate/target/doc/src/lazycell" ```
2018-12-05emit error when doc generation failsAndy Russell-2/+2
Fixes #41813.
2018-12-04Replace usages of `..i + 1` ranges with `..=i`.Corey Farwell-1/+1
2018-12-04Utilize `?` instead of `return None`.Corey Farwell-4/+4
2018-12-04Auto merge of #55707 - GuillaumeGomez:file-sidebar, r=QuietMisdreavusbors-5/+89
Add source file sidebar This is just a start currently but that gives a good overview of what it'll look like: <img width="1440" alt="screenshot 2018-11-06 at 01 39 15" src="https://user-images.githubusercontent.com/3050060/48035592-05336180-e165-11e8-82e1-5ead0c345eb9.png"> r? @QuietMisdreavus
2018-12-04Auto merge of #55682 - GuillaumeGomez:primitive-sidebar-link-gen, ↵bors-30/+57
r=QuietMisdreavus Fixes primitive sidebar link generation Fixes #50746. Fixes #55656. r? @QuietMisdreavus
2018-12-03Don't generate suffix for source-file.jsGuillaume Gomez-1/+2
2018-11-29Add arrow to the crate select boxGuillaume Gomez-0/+2
2018-11-28Add crate filteringGuillaume Gomez-1/+1
2018-11-24Source sidebar improvementsGuillaume Gomez-38/+46
2018-11-24Add source file sidebarGuillaume Gomez-5/+80
2018-11-21Fixes primitive sidebar link generationGuillaume Gomez-30/+57
2018-11-13Rollup merge of #55136 - GuillaumeGomez:short-doc, r=QuietMisdreavuskennytm-10/+25
Remove short doc where it starts with a codeblock Fixes #54975.
2018-11-10move all static-file include!s into a single moduleQuietMisdreavus-25/+25
2018-11-10Remove short doc where it starts with a codeblockGuillaume Gomez-10/+25
2018-11-05Auto merge of #55515 - QuietMisdreavus:rustdoc-config, r=GuillaumeGomezbors-47/+42
rustdoc: refactor: centralize all command-line argument parsing This is something i've wanted to do for a while, since we keep having to add new arguments to places like `rust_input` or `core::run_core` whenever we add a new CLI flag or the like. Those functions have inflated up to 11-19, and in some cases hiding away the locations where some CLI flags were being parsed, obscuring their use. Now, we have a central place where all command-line configuration occurs, including argument validation. One note about the design: i grouped together all the arguments that `html::render::run` needed, so that i could pass them on from compilation in one lump instead of trying to thread through individual items or clone the entire blob ahead of time. One other thing this adds is that rustdoc also now recognizes all the `-Z` options that rustc does, since we were manually grabbing a few previously. Now we parse a full `DebuggingOptions` struct and hand it directly to rustc when scraping docs.
2018-11-03Rollup merge of #54162 - GuillaumeGomez:hide-default-impls-items, ↵Guillaume Gomez-25/+41
r=QuietMisdreavus Hide default impls items Follow up of #51885. Fixes #54025. cc @Mark-Simulacrum r? @QuietMisdreavus And screenshots of course: <img width="1440" alt="screen shot 2018-09-12 at 23 30 35" src="https://user-images.githubusercontent.com/3050060/45454424-1ff8d500-b6e4-11e8-9257-030322495d58.png"> <img width="1440" alt="screen shot 2018-09-12 at 23 30 42" src="https://user-images.githubusercontent.com/3050060/45454431-2424f280-b6e4-11e8-8d65-db0d85ac18f0.png">
2018-11-02pass the Options struct instead of individual argsQuietMisdreavus-49/+42