summary refs log tree commit diff
path: root/src/librustdoc/html/markdown.rs
AgeCommit message (Collapse)AuthorLines
2017-02-08Rollup merge of #39597 - GuillaumeGomez:correct_rustdoc_test_file, ↵Corey Farwell-3/+5
r=alexcrichton Display correct filename with --test option Fixes #39592. With the current files: ```rust pub mod foo; /// This is a Foo; /// /// ``` /// println!("baaaaaar"); /// ``` pub struct Foo; /// This is a Bar; /// /// ``` /// println!("fooooo"); /// ``` pub struct Bar; ``` ```rust // note the whitespaces /// ``` /// println!("foo"); /// ``` pub fn foo() {} ``` It displays: ``` ./build/x86_64-apple-darwin/stage1/bin/rustdoc --test test.rs running 3 tests test test.rs - line 13 ... ok test test.rs - line 5 ... ok test foo.rs - line 2 ... ok test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured ``` ``` ` `` println!("lol"); ` `` asdjnfasd asd ``` It displays: ``` ./build/x86_64-apple-darwin/stage1/bin/rustdoc --test foo.md running 1 test test <input> - line 3 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ``` r? @alexcrichton
2017-02-06Display correct filename with --test optionGuillaume Gomez-3/+5
2017-02-06std: Remove cfg(cargobuild) annotationsAlex Crichton-5/+0
These are all now no longer needed that we've only got rustbuild in tree.
2017-02-03Switch logic to Span instead of HashMapGuillaume Gomez-3/+5
2017-02-03Move to my own hoedown repositoryGuillaume Gomez-17/+28
2017-02-03Add information in case of markdown block code test failureggomez-1/+6
2017-01-29Remove no longer necessary ctor checks in rustc_privacyVadim Petrochenkov-2/+0
2017-01-27Don't generate doc if doc comments only filled with 'white' charactersGuillaume Gomez-1/+2
2016-12-25Add unittestEsteban Küber-1/+12
2016-12-14Add `MarkdownHmtl` escape structEsteban Küber-4/+20
`MarkdownHtml` structs escape HTML tags from its text.
2016-10-31Changed most vec! invocations to use square bracesiirelu-1/+1
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-15rustdoc: Improve playground run buttonsOliver Middleton-6/+37
The main change is to stop using javascript to generate the URLs and use rustdoc instead. This also adds run buttons to the error index examples.
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; ```