about summary refs log tree commit diff
path: root/src/librustdoc/html/markdown.rs
AgeCommit message (Collapse)AuthorLines
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-2/+2
[breaking-change]
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-3/+4
[breaking-change]
2014-05-15Updates with core::fmt changesAlex Crichton-4/+3
1. Wherever the `buf` field of a `Formatter` was used, the `Formatter` is used instead. 2. The usage of `write_fmt` is minimized as much as possible, the `write!` macro is preferred wherever possible. 3. Usage of `fmt::write` is minimized, favoring the `write!` macro instead.
2014-05-13Touch up and rebase previous commitsAlex Crichton-0/+1
* Added `// no-pretty-expanded` to pretty-print a test, but not run it through the `expanded` variant. * Removed #[deriving] and other expanded attributes after they are expanded * Removed hacks around &str and &&str and friends (from both the parser and the pretty printer). * Un-ignored a bunch of tests
2014-05-12librustdoc: Remove all `~str` usage from librustdoc.Patrick Walton-10/+11
2014-05-07std: Modernize the local_data apiAlex Crichton-13/+10
This commit brings the local_data api up to modern rust standards with a few key improvements: * The `pop` and `set` methods have been combined into one method, `replace` * The `get_mut` method has been removed. All interior mutability should be done through `RefCell`. * All functionality is now exposed as a method on the keys themselves. Instead of importing std::local_data, you now use "key.replace()" and "key.get()". * All closures have been removed in favor of RAII functionality. This means that get() and get_mut() no long require closures, but rather return Option<SmartPointer> where the smart pointer takes care of relinquishing the borrow and also implements the necessary Deref traits * The modify() function was removed to cut the local_data interface down to its bare essentials (similarly to how RefCell removed set/get). [breaking-change]
2014-05-03rustdoc: Enable the footnote markdown extensionAlex Crichton-8/+10
This enables hoedown's footnote extension, and fixes all footnotes in the reference manual to use the new syntax.
2014-05-03rustdoc: Migrate from sundown to hoedownAlex Crichton-109/+119
This primary fix brought on by this upgrade is the proper matching of the ``` and ~~~ doc blocks. This also moves hoedown to a git submodule rather than a bundled repository. Additionally, hoedown is stricter about code blocks, so this ended up fixing a lot of invalid code blocks (ending with " ```" instead of "```", or ending with "~~~~" instead of "~~~"). Closes #12776
2014-04-26rustdoc: refactor and unstyle inline section headersAdrien Tétar-1/+1
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1
2014-04-10Remove some internal ~[] from several libraries.Huon Wilson-3/+3
Some straggling instances of `~[]` across a few different libs. Also, remove some public ones from workcache.
2014-04-06auto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,mebors-1/+1
Rebasing of #12526 with a very obscure bug fixed on windows.
2014-04-04Fix fallout from std::libc separationCorey Richardson-1/+1
2014-04-03rustdoc: Fix reporting of ignored testsIvan Petkov-6/+7
librustdoc: instead of skipping ignored tests, pass them to libtest so it can report them as such. If a test is marked as `notrust`, however, it will not show up in the final report.
2014-03-31Switch some tuple structs to pub fieldsAlex Crichton-2/+2
This commit deals with the fallout of the previous change by making tuples structs have public fields where necessary (now that the fields are private by default).
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-1/+1
Closes #2569
2014-03-23iter: remove `to_owned_vec`Daniel Micay-3/+3
This needs to be removed as part of removing `~[T]`. Partial type hints are now allowed, and will remove the need to add a version of this method for `Vec<T>`. For now, this involves a few workarounds for partial type hints not completely working.
2014-03-20rename std::vec -> std::sliceDaniel Micay-7/+7
Closes #12702
2014-03-12rustdoc: whitelist the headers that get a § on hover.Huon Wilson-1/+1
Previously the :hover rules were making the links to the traits/types in something like impl<K: Hash + Eq, V> ... { ... } be displayed with a trailing `§` when hovered over. This commit restricts that behaviour to specific headers, i.e. those that are known to be section headers (like those rendered in markdown doc-comments, and the "Modules", "Functions" etc. headings).
2014-03-09rustdoc: hardcode each header as a link.Huon Wilson-1/+2
This avoids having to include JS in the guide/tutorial/manual pages just to get the headers being links. The on-hover behaviour showing the little section marker § is preserved, because that gives a useful hint that the heading is a link.
2014-03-09rustdoc: add table-of-contents recording & rendering, use it with plainHuon Wilson-10/+40
markdown files. This means that # Foo ## Bar # Baz ### Qux ## Quz Gets a TOC like 1 Foo 1.1 Bar 2 Baz 2.0.1 Qux 2.1 Quz This functionality is only used when rendering a single markdown file, never on an individual module, although it could very feasibly be extended to allow modules to opt-in to a table of contents (std::fmt comes to mind).
2014-03-09rustdoc: run on plain Markdown files.Huon Wilson-3/+15
This theoretically gives rustdoc the ability to render our guides, tutorial and manual (not in practice, since the files themselves need to be adjusted slightly to use Sundown-compatible functionality). Fixes #11392.
2014-03-08Add an option to not run rustdoc blocksSteven Fackler-5/+6
This is useful for code that would be expensive to run or has some kind of external dependency (e.g. a database or server).
2014-03-06rustdoc: Don't escape contents of headersAlex Crichton-2/+1
Turns out sundown has already escaped this content for us, so there's no need for us to escape it again. Closes #12736
2014-03-05rustdoc: Add anchors to section headersAlex Crichton-6/+69
This commit adds a appear-on-over link to all section headers to generated documentation. Each header also receives an id now, even those generated through markdown. The purpose of this is to provide easy to link to sections. This modifies the default header markdown generation because the default id added looks like "toc_NN" which is difficult to reconcile among all sections (by default each section gets a "toc_0" id), and it's also not very descriptive of where you're going. This chooses to adopt the github-style anchors by taking the contents of the title and hyphen-separating them (after lower casing). Closes #12681
2014-03-02rustdoc: syntax highlight macro definitions, colour $... substitutions.Huon Wilson-1/+1
Macro definitions are just their raw source code, and so should be highlighted where possible. Also, $ident non-terminal substitutions are special, and so are worth of a little special treatment.
2014-02-23auto merge of #12416 : alexcrichton/rust/highlight, r=huonwbors-2/+26
This adds simple syntax highlighting based off libsyntax's lexer to be sure to stay up to date with rust's grammar. Some of the highlighting is a bit ad-hoc, but it definitely seems to get the job done! This currently doesn't highlight rustdoc-rendered function signatures and structs that are emitted to each page because the colors already signify what's clickable and I think we'd have to figure out a different scheme before colorizing them. This does, however, colorize all code examples and source code. Closes #11393
2014-02-23std: Move intrinsics to std::intrinsics.Brian Anderson-1/+1
Issue #1457
2014-02-23rustdoc: Add syntax highlightingAlex Crichton-2/+26
This adds simple syntax highlighting based off libsyntax's lexer to be sure to stay up to date with rust's grammar. Some of the highlighting is a bit ad-hoc, but it definitely seems to get the job done! This currently doesn't highlight rustdoc-rendered function signatures and structs that are emitted to each page because the colors already signify what's clickable and I think we'd have to figure out a different scheme before colorizing them. This does, however, colorize all code examples and source code. Closes #11393
2014-02-21Changed NonCamelCaseTypes lint to warn by defaultmr.Shu-0/+2
Added allow(non_camel_case_types) to librustc where necesary Tried to fix problems with non_camel_case_types outside rustc fixed failing tests Docs updated Moved #[allow(non_camel_case_types)] a level higher. markdown.rs reverted Fixed timer that was failing tests Fixed another timer
2014-02-14Update rustdoc testing to test all code blocksAlex Crichton-7/+9
It's too easy to forget the `rust` tag to have a code example tested, and it's far more common to have testable code than untestable code. This alters rustdoc to have only two directives, `ignore` and `should_fail`. The `ignore` directive ignores the code block entirely, and the `should_fail` directive has been fixed to only fail the test if the code execution fails, not also compilation.
2014-02-09std: Add init and uninit to mem. Replace direct intrinsic usageBrian Anderson-2/+3
2014-02-08std::fmt: convert the formatting traits to a proper self.Huon Wilson-2/+2
Poly and String have polymorphic `impl`s and so require different method names.
2014-02-03rustdoc: Remove io_error usageAlex Crichton-6/+7
2014-02-02std: rename fmt::Default to `Show`.Huon Wilson-3/+3
This is a better name with which to have a #[deriving] mode. Decision in: https://github.com/mozilla/rust/wiki/Meeting-weekly-2014-01-28
2014-01-26Move extra::flate to libflateAlex Crichton-1/+3
This is hopefully the beginning of the long-awaited dissolution of libextra. Using the newly created build infrastructure for building libraries, I decided to move the first module out of libextra. While not being a particularly meaty module in and of itself, the flate module is required by rustc and additionally has a native C dependency. I was able to very easily split out the C dependency from rustrt, update librustc, and magically everything gets installed to the right locations and built automatically. This is meant to be a proof-of-concept commit to how easy it is to remove modules from libextra now. I didn't put any effort into modernizing the interface of libflate or updating it other than to remove the one glob import it had.
2014-01-21[std::str] Rename from_utf8_opt() to from_utf8(), drop the old from_utf8() ↵Simon Sapin-3/+3
behavior
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-0/+1
2013-12-30rustdoc: Unify the handling of the hidden example lines.Huon Wilson-6/+15
2013-12-30rustdoc: only filter lines starting with '# ' from the shown code.Huon Wilson-2/+4
Currently any line starting with `#` is filtered from the output, including line like `#[deriving]`; this patch makes it so lines are only filtered when followed by a space similar to the current behaviour of the tutorial/manual tester.
2013-12-23rustdoc: Add the ability to test code in commentsAlex Crichton-6/+84
This adds support for the `--test` flag to rustdoc which will parse a crate, extract all code examples in doc comments, and then run each test in the extra::test driver.
2013-12-19std::str: replace .as_imm_buf with .as_ptr.Huon Wilson-3/+2
2013-12-11Make 'self lifetime illegal.Erik Price-3/+3
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-08Remove dead codesKiet Tran-3/+0
2013-11-29Add generation of static libraries to rustcAlex Crichton-1/+1
This commit implements the support necessary for generating both intermediate and result static rust libraries. This is an implementation of my thoughts in https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html. When compiling a library, we still retain the "lib" option, although now there are "rlib", "staticlib", and "dylib" as options for crate_type (and these are stackable). The idea of "lib" is to generate the "compiler default" instead of having too choose (although all are interchangeable). For now I have left the "complier default" to be a dynamic library for size reasons. Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a dynamic object. I chose this for size reasons, but also because you're probably not going to be embedding the rustc compiler anywhere any time soon. Other than the options outlined above, there are a few defaults/preferences that are now opinionated in the compiler: * If both a .dylib and .rlib are found for a rust library, the compiler will prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option * If generating a "lib", the compiler will generate a dynamic library. This is overridable by explicitly saying what flavor you'd like (rlib, staticlib, dylib). * If no options are passed to the command line, and no crate_type is found in the destination crate, then an executable is generated With this change, you can successfully build a rust program with 0 dynamic dependencies on rust libraries. There is still a dynamic dependency on librustrt, but I plan on removing that in a subsequent commit. This change includes no tests just yet. Our current testing infrastructure/harnesses aren't very amenable to doing flavorful things with linking, so I'm planning on adding a new mode of testing which I believe belongs as a separate commit. Closes #552
2013-11-26librustc: Remove non-procedure uses of `do` from librustc, librustdoc,Patrick Walton-4/+4
and librustpkg.
2013-11-11Move std::rt::io to std::ioAlex Crichton-1/+1
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-2/+0
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-01Statically link sundown to librustdocAlex Crichton-0/+1
Closes #10103
2013-10-03rustdoc: Document what's going on throughoutAlex Crichton-1/+17
This addresses some of @huonw's in #9691 about the startling lack of documentation guiding one throughout the innards of rustdoc::html