summary refs log tree commit diff
path: root/src/librustdoc/html/markdown.rs
AgeCommit message (Collapse)AuthorLines
2016-09-26deduplicate inline is_nightly_build implementationsTim Neumann-7/+4
2016-09-26refactor away get_unstable_features_settingTim Neumann-2/+1
2016-09-08Set run button transparent instead of invisibleGuillaume Gomez-3/+5
2016-06-20Add error code flagGuillaume Gomez-12/+15
2016-06-12Add error codes block code flagGuillaume Gomez-6/+22
2016-04-04rustdoc: factor out function for getting inner html of highlighted sourceNick Cameron-3/+3
2016-03-27Don't initialize id-map when rendering md filesmitaa-3/+3
Adding these "known" values to the table of used ids is only required when embedding markdown into a rustdoc html page and may yield unexpected results when rendering a standalone `*.md` file.
2016-02-27Clearly separate code blocks from other blocksmitaa-1/+3
For summary descriptions we need the first paragraph (adjacent lines until a blank line) - but the rendered markdown of a code block did not leave a blank line in the html and was thus included in the summary line.
2016-02-12Auto merge of #30726 - GuillaumeGomez:compile-fail, r=brsonbors-15/+32
r? @brson cc @alexcrichton I still need to add error code explanation test with this, but I can't figure out a way to generate the `.md` files in order to test example source codes. Will fix #27328.
2016-02-11bootstrap: Add directives to not double-link libsAlex Crichton-0/+3
Have all Cargo-built crates pass `--cfg cargobuild` and then add appropriate `#[cfg]` definitions to all crates to avoid linking anything if this is passed. This should help allow libstd to compile with both the makefiles and with Cargo.
2016-02-09Fix librustdoc testGuillaume Gomez-21/+9
2016-02-09Check if we're not in stable to allow compile_fail option in rustdoc --testGuillaume Gomez-3/+24
2016-02-09Update MakefileGuillaume Gomez-1/+1
2016-02-07Add compile-fail test in rustdocGuillaume Gomez-15/+23
2015-12-05Add testsmitaa-0/+27
2015-12-04Address review commentsmitaa-9/+9
2015-12-03Generate unique IDs for each rustdoc HTML pagemitaa-3/+3
2015-12-03Move ID generator to a more suited locationmitaa-37/+12
2015-09-20rustdoc: added tests for header rendering & minor fixesSimon Mazur-2/+24
2015-09-20rustdoc: remove redundant testSimon Mazur-15/+1
2015-09-20rustdoc: some code style improvementsSimon Mazur-27/+14
2015-09-20rustdoc: Changed section headers anchor renderingSimon Mazur-5/+23
2015-08-24Update hoedown to latest version (3.0.4).Eljay-36/+46
2015-08-16Correct signature of hoedown callback for codespansRobin Kruppe-2/+8
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-1/+1
Also fixes a few outdated links.
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-5/+5
2015-06-04Fix order of rustdoc arguments.Steven Allen-2/+2
rust-example-rendered should be a class, not an id. fixes #26013
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-1/+1
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-04-21implement rfc 1054: split_whitespace() fn, deprecate words()kwantam-1/+1
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-2/+2
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-07rustdoc: Handle tests with bare `#` marksAlex Crichton-1/+3
Strip them from output like other `# `-starting lines. Closes #23106
2015-04-07rustdoc: Allowing specifying attrs for doctestsAlex Crichton-2/+4
This adds support in rustdoc to blanket apply crate attributes to all doc tests for a crate at once. The syntax for doing this is: #![doc(test(attr(...)))] Each meta item in `...` will be applied to each doctest as a crate attribute. cc #18199
2015-04-06rustdoc: Use iterators to collapse whitespaceMichael Macias-21/+8
Thanks, @alexcrichton!
2015-04-06rustdoc: Add a custom callback for codespan to collapse whitespaceMichael Macias-3/+59
Because the current style for `code` in rustdoc is to prewrap whitespace, code spans that are hard wrapped in the source documentation are prematurely wrapped when rendered in HTML. CommonMark 0.18 [[1]] specifies "interior spaces and line endings are collapsed into single spaces" for code spans, which would actually prevent this issue, but hoedown does not currently conform to the CommonMark spec. The added span-level callback attempts to adhere to how whitespace is handled as described by CommonMark, fixing the issue of early, unintentional wrapping of code spans in rendered HTML. [1]: http://spec.commonmark.org/0.18/
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-1/+1
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-26syntax: Remove support for #[should_fail]Alex Crichton-9/+9
This attribute has been deprecated in favor of #[should_panic]. This also updates rustdoc to no longer accept the `should_fail` directive and instead renames it to `should_panic`.
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-1/+1
Now that support has been removed, all lingering use cases are renamed.
2015-03-25Add trivial cast lints.Nick Cameron-7/+7
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-23rustdoc: Add #[doc(test(no_inject_crate))] attributeBrian Anderson-1/+1
So that collections doctests don't automatically fail themselves by injecting `extern crate collections` when they are mostly using the std facade.
2015-02-18Round 1 fixes and rebase conflictsAlex Crichton-2/+2
2015-02-18std: Implement CString-related RFCsAlex Crichton-2/+2
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type to the module. [r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md [r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md The new `CStr` type is only constructable via two methods: 1. By `deref`'ing from a `CString` 2. Unsafely via `CStr::from_ptr` The purpose of `CStr` is to be an unsized type which is a thin pointer to a `libc::c_char` (currently it is a fat pointer slice due to implementation limitations). Strings from C can be safely represented with a `CStr` and an appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr` instead to allow producers to pass in C-originating strings instead of just Rust-allocated strings. A new constructor was added to `CString`, `new`, which takes `T: IntoBytes` instead of separate `from_slice` and `from_vec` methods (both have been deprecated in favor of `new`). The `new` method returns a `Result` instead of panicking. The error variant contains the relevant information about where the error happened and bytes (if present). Conversions are provided to the `io::Error` and `old_io::IoError` types via the `FromError` trait which translate to `InvalidInput`. This is a breaking change due to the modification of existing `#[unstable]` APIs and new deprecation, and more detailed information can be found in the two RFCs. Notable breakage includes: * All construction of `CString` now needs to use `new` and handle the outgoing `Result`. * Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call. * The `as_slice*` methods have been removed in favor of just having the `as_bytes*` methods. Closes #22469 Closes #22470 [breaking-change]
2015-02-06Auto merge of #21926 - mzabaluev:raw-lifetime, r=alexcrichtonbors-13/+15
New functions, `slice::from_raw_parts` and `slice::from_raw_parts_mut`, are added to implement the lifetime convention as agreed in rust-lang/rfcs#556. The functions `slice::from_raw_buf` and `slice::from_raw_mut_buf` are left deprecated for the time being. Holding back on changing the signature of `std::ffi::c_str_to_bytes` as consensus in rust-lang/rfcs#592 is building to replace it with a composition of other functions. Contribution to #21923.
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-11/+9
2015-02-05Replace usage of slice::from_raw_buf with slice::from_raw_partsMikhail Zabaluev-13/+15
New functions, slice::from_raw_parts and slice::from_raw_parts_mut, are added to implement the lifetime convention as agreed in RFC PR #556. The functions slice::from_raw_buf and slice::from_raw_mut_buf are left deprecated for the time being.
2015-02-04remove all kind annotations from closuresJorge Aparicio-1/+1
2015-01-30Test fixes and rebase conflictsAlex Crichton-1/+1
Also some tidying up of a bunch of crate attributes
2015-01-29s/Show/Debug/gJorge Aparicio-1/+1
2015-01-23Auto merge of #20221 - liigo:rustdoc-sidebar-tooltips-v3, r=alexcrichtonbors-4/+97
This pull request add tooltips to most links of sidebar. The tooltips display "summary line" of items' document. Some lengthy/annoying raw markdown code are eliminated, such as links and headers. - `[Rust](http://rust-lang.org)` displays as `Rust` (no URLs) - `# header` displays as `header` (no `#`s) Some inline spans, e.g. ``` `code` ``` and ```*emphasis*```, are kept as they are, for better readable. I've make sure `&` `'` `"` `<` and `>` are properly displayed in tooltips, for example, `&'a Option<T>`. Online preview: http://liigo.com/tmp/tooltips/std/index.html @alexcrichton @steveklabnik since you have reviewed my previous ([v1](https://github.com/rust-lang/rust/pull/13014),[v2](https://github.com/rust-lang/rust/pull/16448)) PRs of this serise, which have been closed for technical reasons. Thank you.
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-1/+1
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
2015-01-21Fallout from stabilization.Aaron Turon-1/+1