Wiki page
[GitHub] by
mario
2015-02-04 01:56:54.
D 2015-02-04T01:56:54.011
L GitHub
N text/x-markdown
P e49ad50dba6c16dfdc8fd6ebf44cebba731bab86
U mario
W 2989
<h3>GitHub style template</h3>
For conveniencing new users, there's now a theme that similates [GitHub](https://github.com/‎) to some extend.
<img src=doc/trunk/screenshots/github.png align=right>
It provides following features:
* Now uses the Fossil built-in [search function](wiki/search+function).
* The avowed file box on the index and wiki pages.
* Link subdirectories to `/wiki/$dirname` per default, so they're displayed in unison.
* File links directly go to `/artifact` views.<br><br>
* An auto-collapsing right side function bar; using Unicode glyphs instead of icons.
* The clickable language-bar is similar to what GitHub shows, uses [fx_stats](wiki/fx_stats) as source.
* Social media links within the <kbd>★ Star</kbd> button. The counts are fetched over a remote image API.
* Most gimmicks implemented as [TH1](wiki/th1x) functions.
<h4> Browser support </h4>
The styling works well on following browser engines:
* Gecko (Firefox): ☑
* WebKit (Chrome): ☑
* Presto (Opera): ☑
* Trident (MSIE): who cares?
<h4> File box implementation </h4>
`ui::recent_files` outputs table rows according to the passed directory base. It groups directories and files, and cuts out their basenames.
Directories now always link to `/wiki?name=$dirname` pages. Thus it gets displayed alongside an existing Wiki page on a directory name. - That's backwards to how GitHub works. There the filebox is always there, and a README.md [or whatever] displayed alongside. (The old behaviour was to link to fossils tree/ view for non-existent Wiki pages. But now that the search has been separated from the wiki/ view; that's no longer necessary.)
<h4> Social media links API </h4>
Upon clicking the <kbd>★ Star</kbd> button, previously hidden links to common sharing sites pop out. They reside in [th1x](wiki/th1x) `ui::social_media_links`.
The numeric display is just a remote image for simplicity.
http://api.include-once.org/links/social.img.php?url=http://localhost/
Albeit an AJAX call would work too.
http://api.include-once.org/links/social.ajax.php?url=http://localhost/
Which returns a {name:value,..} list for the mentioned link sharing sites.
Obvious **ToDo**: Now that the search table building is redundant, implementing the social media API score retrieval in the fossil-stats cron job makes more sense. The remote image request is too sluggish.
<h4> CSS </h4>
The stylesheet varies upon a simple `class=` attribute in the `<body>` tag. It's set to `page-index` or `page-wiki`, `page-tree`, `page-timeline` etc. according to the current output.
Thus the `.optional` class for instance can vary the width the of the main pane. It defaults to `82%`, but expands to `91%` (and the sidebar just `6%`) on non-index pages. The sidebar link names disappear through `.optional` and the `.page-TYPE` combination as well.
Z e21a3261ca88dad080110aab3cc9f9d1