Fix bug with pound signs used to mark sections.

Also update tests/scribble/markdown-docs files accordingly.

original commit: faeba879e292414dd6d5d9e38d4a08b26e63cceb
This commit is contained in:
Greg Hendershott 2012-12-19 19:58:20 -05:00 committed by Matthew Flatt
parent 624b8ef7e4
commit 77b1b267b5
3 changed files with 51 additions and 10 deletions

View File

@ -39,8 +39,9 @@
(define/override (render-part d ht) (define/override (render-part d ht)
(let ([number (collected-info-number (part-collected-info d ht))]) (let ([number (collected-info-number (part-collected-info d ht))])
(printf (make-string (add1 (length number)) #\#)) (unless (zero? (length number))
(printf " ") (printf (make-string (length number) #\#))
(printf " "))
(for ([n (in-list (reverse number))] #:when n) (printf "~s." n)) (for ([n (in-list (reverse number))] #:when n) (printf "~s." n))
(when (part-title-content d) (when (part-title-content d)
(when (ormap values number) (printf " ")) (when (ormap values number) (printf " "))

View File

@ -1,12 +1,22 @@
# ```scheme # 1. Section
(require racket/string)
``` 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 1.
* Item 2. * Item 2.
## 1. Section Here is a hyperlink:
[I am a hyperlink to Racket.](http://www.racket-lang.org/) [I am a hyperlink to Racket.](http://www.racket-lang.org/)
@ -16,12 +26,14 @@ _Italic_. \_Just underlines\_.
“Dobule quoted”. Single quoted. “Dobule quoted”. Single quoted.
Example of vebatim:
`Hi, world.` `Hi, world.`
`A “quote”.` `A “quote”.`
`Second line.` `Second line.`
`Last line.` `Last line.`
The end. Another example of verbatim, with ticks/quotes:
`THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS` `THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS`
`“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT` `“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT`
@ -35,6 +47,14 @@ The end.
`(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE` `(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE`
`OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.` `OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.`
Example of a defmodule:
```scheme
(require racket/string)
```
Example of a defproc:
```scheme ```scheme
(make-string k [char]) -> string? (make-string k [char]) -> string?
k : exact-nonnegative-integer? k : exact-nonnegative-integer?

View File

@ -3,14 +3,26 @@
@(require scribble/manual @(require scribble/manual
(for-label racket/base racket/contract racket/string)) (for-label racket/base racket/contract racket/string))
@defmodule[racket/string] @section{Section}
This is a top-level section.
@subsection{Subsection}
This is a subsection.
@subsubsection{Subsubsection}
This is a subsubsection.
Here is an itemize:
@itemize[ @itemize[
@item{Item 1.} @item{Item 1.}
@item{Item 2.} @item{Item 2.}
] ]
@section{Section} Here is a hyperlink:
@hyperlink["http://www.racket-lang.org/" "I am a hyperlink to Racket."] @hyperlink["http://www.racket-lang.org/" "I am a hyperlink to Racket."]
@ -23,6 +35,8 @@ _Just underlines_.
``Dobule quoted''. ``Dobule quoted''.
`Single quoted'. `Single quoted'.
Example of vebatim:
@verbatim{ @verbatim{
Hi, world. Hi, world.
A ``quote''. A ``quote''.
@ -30,7 +44,7 @@ Second line.
Last line. Last line.
} }
The end. Another example of verbatim, with ticks/quotes:
@verbatim{ @verbatim{
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@ -46,6 +60,12 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
} }
Example of a defmodule:
@defmodule[racket/string]
Example of a defproc:
@defproc[(make-string [k exact-nonnegative-integer?][char char? #\nul]) string?]{ @defproc[(make-string [k exact-nonnegative-integer?][char char? #\nul]) string?]{
Returns a new mutable string of length @racket[k] where each position in the Returns a new mutable string of length @racket[k] where each position in the