about summary refs log tree commit diff
path: root/src/rustdoc
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-01-24 20:29:59 -0800
committerBrian Anderson <banderson@mozilla.com>2012-01-24 23:24:54 -0800
commite7d7f4e4b7ff73905a51c936fda9ec553a628dd9 (patch)
tree29b77742c8280c0640e54ae40fe0a90ad070907c /src/rustdoc
parent45a668c439441c68622409b0358dc58c07f29688 (diff)
rustdoc: Add a demo module with some test docs
Diffstat (limited to 'src/rustdoc')
-rw-r--r--src/rustdoc/demo.rs69
-rw-r--r--src/rustdoc/rustdoc.rc1
2 files changed, 70 insertions, 0 deletions
diff --git a/src/rustdoc/demo.rs b/src/rustdoc/demo.rs
new file mode 100644
index 00000000000..2528095abf0
--- /dev/null
+++ b/src/rustdoc/demo.rs
@@ -0,0 +1,69 @@
+// no-reformat
+
+#[doc = "
+
+    A demonstration module
+
+    Contains documentation in various forms that rustdoc understands,
+    for testing purposes. It doesn't surve any functional
+    purpose. This here, for instance, is just some filler text.
+
+    FIXME (1654): It would be nice if we could run some automated
+    tests on this file
+
+"];
+
+#[doc = "The base price of a muffin on a non-holiday"]
+const price_of_a_muffin: float = 70f;
+
+type waitress = {
+    hair_color: str
+};
+
+enum omnomnomy {
+    cookie,
+    pizza_pie([uint])
+}
+
+fn take_my_order_please(
+    _waitress: waitress,
+    _order: [omnomnomy]
+) -> uint {
+
+    #[doc(
+        desc = "OMG would you take my order already?",
+        args(_waitress = "The waitress that you want to bother",
+             _order = "The order vector. It should be filled with food."),
+        return = "The price of the order, including tax",
+        failure = "This function is full of fail"
+    )];
+
+    fail;
+}
+
+mod fortress_of_solitude {
+    #[doc(
+        brief = "Superman's vacation home",
+        desc = "
+
+        The fortress of solitude is located in the Arctic and it is
+        cold. What you may not know about the fortress of solitude
+        though is that it contains two separate bowling alleys. One of
+        them features bumper-bowling and is kind of lame.
+
+        Really, it's pretty cool.
+
+    ")];
+
+}
+
+mod blade_runner {
+    #[doc(
+        brief = "Blade Runner is probably the best movie ever",
+        desc = "I like that in the world of Blade Runner it is always
+                raining, and that it's always night time. And Aliens
+                was also a really good movie.
+
+                Alien 3 was crap though."
+    )];
+}
diff --git a/src/rustdoc/rustdoc.rc b/src/rustdoc/rustdoc.rc
index f49b8c64aec..965b26ecd49 100644
--- a/src/rustdoc/rustdoc.rc
+++ b/src/rustdoc/rustdoc.rc
@@ -26,3 +26,4 @@ mod prune_unexported_pass;
 mod desc_to_brief_pass;
 mod trim_pass;
 mod astsrv;
+mod demo;