schemedoc / cookbook

New Scheme Cookbook
https://cookbook.scheme.org
30 stars 3 forks source link

Add Scheme header to index and recipes #63

Open ghost opened 2 years ago

ghost commented 2 years ago

It would be nice to have the scheme.org menu on the individual cookbook pages. I'm afraid I cannot test this, but would something like the following hand-written changes to www.scm work?

First, define the header:

(define header '(header 
                  (ul (@ (class "menu")) 
                      (li (a (@ (href "https://www.scheme.org")) "Home"))
                      (li (@ (class "active")) "Docs")
                      (li (a (@ (href "https://community.scheme.org")) "Community"))
                      (li (a (@ (href "https://standards.scheme.org")) "Standards"))
                      (li (a (@ (href "https://implementations.scheme.org")) "Implementations")))))

Add to main page by changing line 127 to splice in the header:

`(,header (h1 (@ (id "logo")) "Scheme Cookbook")

And add to each recipe by changing line 163 to splice in the header:

     `(,header ,@(recipe-sxml recipe)
lassik commented 2 years ago

Thanks.

Testing:

# install Chicken 5
chicken-install lowdown r7rs srfi-1 srfi-13 srfi-132 ssax
./www.sh