From f2aeb30b317a322fa28d9f1692e03c34a51076f3 Mon Sep 17 00:00:00 2001 From: Bob Nystrom Date: Thu, 30 Jan 2014 06:51:52 -0800 Subject: [PATCH] Hack on the docs a bit. --- Makefile | 4 ++++ doc/site/classes.markdown | 7 ++++--- doc/site/fibers.markdown | 3 +++ doc/site/functions.markdown | 3 +++ doc/site/lists.markdown | 3 +++ doc/site/maps.markdown | 3 +++ doc/site/method-calls.markdown | 2 +- doc/site/template.html | 6 +++--- doc/site/values.markdown | 3 --- script/generate_docs.py | 13 ++++++++----- 10 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 doc/site/fibers.markdown create mode 100644 doc/site/functions.markdown create mode 100644 doc/site/lists.markdown create mode 100644 doc/site/maps.markdown diff --git a/Makefile b/Makefile index 118f2f65..965e9a62 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,10 @@ test: wrend # Generate the Wren site. docs: + @./script/generate_docs.py + +# Continuously generate the Wren site. +watchdocs: @./script/generate_docs.py --watch # Take the contents of corelib.wren and copy them into src/wren_core.c. diff --git a/doc/site/classes.markdown b/doc/site/classes.markdown index 8ad77b2d..e96b0ef8 100644 --- a/doc/site/classes.markdown +++ b/doc/site/classes.markdown @@ -28,9 +28,10 @@ To make our unicorn do stuff, we need to give it methods. This defines a `prance` method that takes no arguments. To support parameters, add a parenthesized parameter list after the method's name: :::dart - // Inside class... - prance(where, when) { - IO.print("The unicorn prances in " + where + " at " + when) + class Unicorn { + prance(where, when) { + IO.print("The unicorn prances in " + where + " at " + when) + } } Unlike most other dynamically-typed languages, in Wren you can have multiple methods in a class with the same name, as long as they take a different number of parameters. In other words, you can overload by arity. So this class is fine: diff --git a/doc/site/fibers.markdown b/doc/site/fibers.markdown new file mode 100644 index 00000000..4297d0da --- /dev/null +++ b/doc/site/fibers.markdown @@ -0,0 +1,3 @@ +^title Fibers + +**TODO** \ No newline at end of file diff --git a/doc/site/functions.markdown b/doc/site/functions.markdown new file mode 100644 index 00000000..8e298ac9 --- /dev/null +++ b/doc/site/functions.markdown @@ -0,0 +1,3 @@ +^title Functions + +**TODO** \ No newline at end of file diff --git a/doc/site/lists.markdown b/doc/site/lists.markdown new file mode 100644 index 00000000..257a8a3c --- /dev/null +++ b/doc/site/lists.markdown @@ -0,0 +1,3 @@ +^title Lists + +**TODO** \ No newline at end of file diff --git a/doc/site/maps.markdown b/doc/site/maps.markdown new file mode 100644 index 00000000..4f4160ed --- /dev/null +++ b/doc/site/maps.markdown @@ -0,0 +1,3 @@ +^title Maps + +**TODO** \ No newline at end of file diff --git a/doc/site/method-calls.markdown b/doc/site/method-calls.markdown index 4f8e0f4e..bf361614 100644 --- a/doc/site/method-calls.markdown +++ b/doc/site/method-calls.markdown @@ -83,7 +83,7 @@ it `b`". Most of these are probably familiar already. The `..` and `...` operators are "range" operators. The number type implements those and returns a range object, -which can in turn be iterated over using a [`for`](loops.html) loop. +which can in turn be iterated over using a `for` [loop](looping.html). ## Subscript operators diff --git a/doc/site/template.html b/doc/site/template.html index cf5ccd6e..f6d8fd40 100644 --- a/doc/site/template.html +++ b/doc/site/template.html @@ -35,9 +35,9 @@
  • Values
  • Classes
  • Functions
  • -
  • Fibers
  • -
  • Lists
  • -
  • Maps
  • +
  • Fibers
  • +
  • Lists
  • +
  • Maps
  • Usage