scribble-enhanced/collects/tests/scribble/markdown-docs/example.md
Greg Hendershott 3f1ebb9565 Fix problem handling examples and interaction.
Unlike plain `racketblock`, `examples` and `interaction` are
"nested". As a result we emitted bad Markdown like:

    ```racket
    Examples:
    ```racket
    some-code
    ```
    ```

Markdown code blocks can't nest, so this needs to be:

    ```racket
    Examples:
    some-code
    ```

Also: Updated the unit test with examples of `examples` and
`interaction`.

original commit: a5f6686270239484a5e7b2e6864c9bd5627d937d
2013-03-29 07:23:49 -06:00

94 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 1. Section
This is a top-level section.
## 1.1. Subsection
This is a subsection.
### 1.1.1. Subsubsection
This is a subsubsection.
Here is an itemize:
* Item 1.
* Item 2.
Here is a hyperlink:
[I am a hyperlink to Racket.](http://www.racket-lang.org/)
_Italic_. \_Just underlines\_.
**Bold**. \*Just asterisks.\*
“Dobule quoted”. Single quoted.
This should NOT be code in Markdown.
Example of vebatim:
`Hi, world.`
`A “quote”.`
`Second line.`
`Last line.`
Another example of verbatim, with ticks/quotes:
`THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS`
`“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT`
`LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR`
`A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT`
`HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,`
`SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT`
`LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,`
`DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY`
`THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT`
`(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE`
`OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.`
Example of a defmodule:
```racket
(require racket/string)
```
Example of a defproc:
```racket
(make-string k [char]) -> string?
k : exact-nonnegative-integer?
char : char? = #\nul
```
Returns a new mutable string of length `k` where each position in the
string is initialized with the character `char`
Blah blah `(``or/c`` ``string?`` ``bytes?``)`.
Example of Scribble `examples`:
```racket
Examples:
> (define x 0)
> (displayln x)
0
```
Example of Scribble `interaction`:
```racket
> (define x 0)
> x
0
```
> Note: This is a note. Lets make it long enough that the markdown output
> will have to line-wrap, to make sure the > mark starts each line
> properly.