diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-01-18 21:33:37 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-01-18 21:33:37 -0800 |
| commit | a02a943cec35618b7fae32d9fd0f396566dc0635 (patch) | |
| tree | 7b9db1dfb21b785d16df11ec7a42048c3fb68b44 /src | |
| parent | 3ebf7b42bd930de73f376dd1b3f2060e00b0fe6d (diff) | |
| download | rust-a02a943cec35618b7fae32d9fd0f396566dc0635.tar.gz rust-a02a943cec35618b7fae32d9fd0f396566dc0635.zip | |
rustdoc: Write markdown for mod description
Diffstat (limited to 'src')
| -rw-r--r-- | src/rustdoc/gen.rs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/rustdoc/gen.rs b/src/rustdoc/gen.rs index c3f0c993169..2c3cb0ea903 100644 --- a/src/rustdoc/gen.rs +++ b/src/rustdoc/gen.rs @@ -71,21 +71,36 @@ fn write_mod( fn write_mod_contents( ctxt: ctxt, - moddoc: doc::moddoc + doc: doc::moddoc ) { - for fndoc in *moddoc.fns { + write_brief(ctxt, doc.brief); + write_desc(ctxt, doc.desc); + + for fndoc in *doc.fns { subsection(ctxt) {|| write_fn(ctxt, fndoc); } } - for moddoc in *moddoc.mods { + for moddoc in *doc.mods { subsection(ctxt) {|| write_mod(ctxt, moddoc); } } } +#[test] +fn should_write_crate_brief_description() { + let markdown = test::render("#[doc(brief = \"this is the crate\")];"); + assert str::contains(markdown, "this is the crate"); +} + +#[test] +fn should_write_crate_description() { + let markdown = test::render("#[doc = \"this is the crate\"];"); + assert str::contains(markdown, "this is the crate"); +} + fn write_fn( ctxt: ctxt, doc: doc::fndoc |
