Fossil Forum

Live example of a heavily-customized fossil skin
Login

Live example of a heavily-customized fossil skin

Live example of a heavily-customized fossil skin

(1.1) By Stephan Beal (stephan) on 2022-11-09 17:31:24 edited from 1.0 [source]

To host the documentation for the upcoming sqlite3 JavaScript APIs, we diverged from sqlite's historical use of static HTML and chose to use Fossil-hosted markdown. The resulting site makes use of a heavily-customized Fossil skin which may be of interest to some folks to demonstrate how some relatively radical changes can be made to a repository's appearance via skinning, to the point of almost being able to hide the fact that the site is a fossil repository:

https://sqlite.org/wasm

In order to give us (near-)complete control over the layout and styling, the site pins the user to the customized skin, so they cannot select their own from fossil's built-in skins.

Some of the customized bits of the skin include:

  • Automatic section numbering by default using CSS's "counters" feature. Specific documents may opt out of this feature and documents with fewer than two headers are automatically opted out.
  • Provides both bright- and dark-mode viewing using a JS-powered toggle which does nothing more than set or unset a CSS class on the HTML document's html DOM element. CSS rules use that class to enable/disable dark-mode colors of the site without changing any of the other layout. (Reminder to self: we need to add a dark-mode color-inversion CSS rule to pikchr-rendered images the first time a pikchr gets added to the docs.)
  • Novel use of th1's capexpr function to change the default /doc/VERSION path depending on whether the user is logged in or not. The goal is that guests see the trunk version by default and developers see the tip (or checkout, when viewing the repository locally).

How all of that is done is documented in its own document: go to the above page, then look for the doc maintenance docs in the index.

That site is just a plain fossil repo and can be cloned, for those who want to explore the skin (see doc-maintenance.md, assets/fossil-doc.css, assets/skin/*.txt, and GNUmakefile).

(2) By Andy Bradford (andybradford) on 2022-11-09 18:20:22 in reply to 1.1 [link] [source]

> The  goal  is  that  guests  see the  trunk  version  by  default  and
> developers  see the  tip  (or checkout,  when  viewing the  repository
> locally).

When I navigate to https://sqlite.org/wasm, it redirects me to

https://sqlite.org/wasm/doc/ckout/index.md

Is that expected?  From your description I would  have expected "trunk",
not "ckout", and indeed, if I click  on any of the top-level links, like
Home, it refers to "trunk".

Andy

(3) By Stephan Beal (stephan) on 2022-11-09 19:00:36 in reply to 2 [link] [source]

Is that expected? From your description I would have expected "trunk", not "ckout", and indeed, if I click on any of the top-level links, like Home, it refers to "trunk".

Yeah, that one i haven't solved yet: the home page has to have a hard-coded link, and that's /doc/ckout because i'm currently the only one making use of it and 99% of that use is in a local checkout. i'll change that. The entries in the menu default to /doc/trunk for non-logged-in users.