Racket Scribble; How to add a search query?

I used scribble to create my package document.

And raco will combine my documents with its own documents, and add a search box on the page page.

You can see that when you use "raco docs". A.

Now I want to use scribble as a document tool to create my independent documents.

But when I use scribble -htmls demo.scribble, it cannot have a search bar on the page page.

How to add a search box so that my document can be searched?

+4
source share
1 answer

, , , . , , issue (, , , ) , . (, , -, , .)

, scribble , scribble ( raco scribble). , scrabble render, html-render-mixin, . , script , .

, html-render-mixin, ( Racket 6.5, Racket 6.6): search-box?, - #f. mixin, html , #t. :

#lang racket

(require (prefix-in html: scribble/html-render))

(define (search:render-mixin %)
  (class (html:render-mixin %)
    (init [search-box? #t])
    (super-new [search-box? search-box?])))

render-mixin:

(require "webpage.scrbl")

(render (list doc)
        (list "webpage.html")
        #:render-mixin search:render-mixin)

webpage.scrbl - , webpage.html - . , .

doc webpage.scrbl. ( , scribble doc, .)

, , webpage.scrbl scribble/manual: #lang scribble/manual, .

webpage.html . enter, search/index.html , http. , Racket , , , : pkgs/racket-index/scribblings/main/search.scrbl . , , , github.

+1

All Articles