diff --git a/pkgs/racket-doc/scribblings/raco/setup.scrbl b/pkgs/racket-doc/scribblings/raco/setup.scrbl index 7a4340a9b0..c1f2f14a89 100644 --- a/pkgs/racket-doc/scribblings/raco/setup.scrbl +++ b/pkgs/racket-doc/scribblings/raco/setup.scrbl @@ -452,9 +452,13 @@ Optional @filepath{info.rkt} fields trigger additional actions by ] The @racket[_category] list specifies how to show the document in - the root table of contents. The list must start with a symbol, - usually one of the following categories, which are ordered as - below in the root documentation page: + the root table of contents. The list must start with a category, + which determines where the manual appears in the root + documentation page. A category is either a string or a symbol. If + it is a string, then the string is the category label on the root + page. If it is a symbol, then it a default category label is + used. The available symbols and the order of categories on the + root documentation page is as below: @itemize[ @@ -483,6 +487,8 @@ Optional @filepath{info.rkt} fields trigger additional actions by @item{@racket['interop] : Documentation for interoperability tools and libraries.} + @item{All string categories as ordered by @racket[string<=?].} + @item{@racket['library] : Documentation for libraries; this category is the default and used for unrecognized category symbols.} diff --git a/pkgs/racket-index/scribblings/main/private/manuals.rkt b/pkgs/racket-index/scribblings/main/private/manuals.rkt index 3e74a9d51f..981e8647d0 100644 --- a/pkgs/racket-index/scribblings/main/private/manuals.rkt +++ b/pkgs/racket-index/scribblings/main/private/manuals.rkt @@ -28,7 +28,7 @@ (truncate (/ (caar l) 10))))]) (if sep? (cons (mk-sep lbl) l) l))])))) -(define (get-docs all? tag) +(define (get-docs all? tag #:custom-secs [custom-secs (make-hash)]) (let* ([recs (find-relevant-directory-records (list tag) (if all? 'all-available 'no-user))] [infos (map get-info/full (map directory-record-path recs))] [docs (append-map @@ -55,7 +55,10 @@ ;; Category (let ([the-cat (if (pair? new-cat) (car new-cat) 'unknown)]) - (or (and (or (eq? the-cat 'omit) + (or (and (string? the-cat) + (let ([the-cat-sym (gensym)]) + (hash-ref! custom-secs the-cat the-cat-sym))) + (and (or (eq? the-cat 'omit) (eq? the-cat 'omit-start)) the-cat) (ormap (lambda (sec) @@ -90,7 +93,18 @@ (cdr l))) (define (make-start-page all?) - (let* ([docs (get-docs all? 'scribblings)] + (let* ([custom-secs (make-hash)] + [docs (get-docs all? 'scribblings + #:custom-secs custom-secs)] + [sections+custom + (append-map (λ (sec) + (if (eq? 'library (sec-cat sec)) + (append (for/list ([label (sort (hash-keys custom-secs) + string<=?)]) + (make-sec (hash-ref custom-secs label) label)) + (list sec)) + (list sec))) + sections)] [plain-line (lambda content (list (make-flow (list (make-paragraph content)))))] @@ -151,5 +165,5 @@ renderer part resolve-info))]) (string-ci (car ad) (car bd)))))))]))) - sections)))) + sections+custom)))) (make-delayed-block contents))) diff --git a/pkgs/racket-index/setup/scribble.rkt b/pkgs/racket-index/setup/scribble.rkt index e27f085c50..7026b98f1f 100644 --- a/pkgs/racket-index/setup/scribble.rkt +++ b/pkgs/racket-index/setup/scribble.rkt @@ -162,7 +162,8 @@ (or (not name) (collection-name-element? name)) (and (list? cat) (<= 1 (length cat) 2) - (symbol? (car cat)) + (or (symbol? (car cat)) + (string? (car cat))) (or (null? (cdr cat)) (real? (cadr cat)))) (and (exact-positive-integer? out-count))