Collection of themes/skins for the Fossil SCM. Public write access, just make an account.

⌈⌋ branch:  Fossil Skins Extra


Check-in [3ee5fa242d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Custom skin .txt/.cfg file build script. Combines .css/.header/.th1-setup files from subdirs into SQL config script.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3ee5fa242d26186ef8c9f91286c5e6db1a6759c0
User & Date: mario 2015-02-09 22:52:45
Context
2015-02-10
22:27
Allow output as plain config card, or as SQL statement list, or as skin:name config card for registration in the Admin menu. check-in: ff51166975 user: mario tags: trunk
2015-02-09
22:52
Custom skin .txt/.cfg file build script. Combines .css/.header/.th1-setup files from subdirs into SQL config script. check-in: 3ee5fa242d user: mario tags: trunk
22:50
Rebuild without linebreaks. check-in: 66368b4a30 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added parts/export-all.





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
#
# Export reponame.header|css|footer|th1-setup
#

for DB in ~/fossil.d/*.fossil
do 
  REPO=`basename $DB .fossil`
  for WHAT in css header footer th1-setup
  do
    echo "select value from config where name='$WHAT';" | fossil sqlite -R $DB > $REPO.$WHAT
  done
done

Added parts/export-map.





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
#
# Export reponame.header|css|footer|th1-setup
#

DB=~/fossil.d/freshcode.fossil
REPO=`basename $DB .fossil`
TARGET=github/github

  for WHAT in css header footer th1-setup
  do
    echo "select value from config where name='$WHAT';" | fossil sqlite -R $DB > $TARGET.$WHAT
  done

Added parts/export-th1.



>
1
cat ../features/*.th1  > all.th1-setup

Added parts/mkskin.

























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/php -qC
<?php
#
# Combine html/css files into skin configuration SQL .txt file
#
# Invoke with:
#
#   skin-merge skin/tmplname/*.*


# cmd args as input files to merge
$files = array_slice($_SERVER["argv"], 1);
$skin_name = skin_name($files[0]);
$time = time();

$q = new PDO("sqlite::memory:");
$txt = "# Fossil skin configuration \"$skin_name\"\n"
     . gmstrftime("# %Y-%m-%dT%H-%M-%SZ \n", time())
     . "#\n";

#-- loop over files
foreach ($files as $fn) {

    # figure out class
    $config = config_name($fn);
    if (!$config) {
       continue;
    }
    
    # read 
    $value = file_get_contents($fn);
    $value = preg_replace("/\R/", "\n", $value);
    $value = $q->quote($value);
    $length = strlen($value);
    
    # and append to sql/config output
    $txt .= "config /config $length\n"
          . "$time '$config' value $value\n";
}

#-- output combined SQL config file
print $txt;



#-- use directory or basename as skin name
function skin_name($fn) {
    if (preg_match("~(?:^|/)((?!header|footer|css)[\w-]+)(?:\.(?:\w{2,4}|header|footer|th1-setup))*$~", $fn, $uu)) {
        return $uu[1];
    }
    return basename(dirname($fn));
}

#-- extract header/footer/css from filename
function config_name($fn) {
    if (preg_match("~(header|footer|css|th1-setup).*?$~", $fn, $uu)) {
        return $uu[1];
    }
    return NULL;
}