diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/markdown-render.rkt b/pkgs/scribble-pkgs/scribble-lib/scribble/markdown-render.rkt index c271588f..2772d45d 100644 --- a/pkgs/scribble-pkgs/scribble-lib/scribble/markdown-render.rkt +++ b/pkgs/scribble-pkgs/scribble-lib/scribble/markdown-render.rkt @@ -44,9 +44,7 @@ (define/override (render-part d ht) (let ([number (collected-info-number (part-collected-info d ht))]) (unless (part-style? d 'hidden) - (unless (zero? (number-depth number)) - (printf (make-string (number-depth number) #\#)) - (printf " ")) + (printf (string-append (make-string (add1 (number-depth number)) #\#) " ")) (let ([s (format-number number '())]) (unless (null? s) (printf "~a.~a" diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/markdown-docs/example.md b/pkgs/scribble-pkgs/scribble-test/tests/scribble/markdown-docs/example.md index dfe51ff0..4bd54886 100644 --- a/pkgs/scribble-pkgs/scribble-test/tests/scribble/markdown-docs/example.md +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/markdown-docs/example.md @@ -1,12 +1,14 @@ -# 1. Section +# Title + +## 1. Section This is a top-level section. -## 1.1. Subsection +### 1.1. Subsection This is a subsection. -### 1.1.1. Subsubsection +#### 1.1.1. Subsubsection This is a subsubsection. diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/markdown-docs/example.scrbl b/pkgs/scribble-pkgs/scribble-test/tests/scribble/markdown-docs/example.scrbl index 17416f4d..493ad6a9 100644 --- a/pkgs/scribble-pkgs/scribble-test/tests/scribble/markdown-docs/example.scrbl +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/markdown-docs/example.scrbl @@ -5,6 +5,8 @@ @(define my-eval (make-base-eval)) @(my-eval '(require racket/base)) +@title{Title} + @section{Section} This is a top-level section. @@ -66,7 +68,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Example of a defmodule: -@defmodule[racket/string] +@defmodule[racket/string #:packages ()] Example of a defproc: