Fossil

Check-in [52b003f1]
Login

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

Overview
Comment:Improved formatting of the generated CSS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:52b003f1f955f22325ef39af974e966c656ea259fc25a9885b23d223f3042245
User & Date: drh 2017-12-03 17:09:12
Context
2017-12-04
13:52
Fix typos in comments. check-in: 6d0d1f71 user: drh tags: trunk
2017-12-03
17:09
Improved formatting of the generated CSS. check-in: 52b003f1 user: drh tags: trunk
16:19
Fix the th_tcl.c to include new macros defined in file.c. check-in: e27b1856 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/mkcss.c.

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
    if( isspace(z[0]) ){
      if( !inRules ){
        fprintf(stderr, "%s:%d: CSS rule not within a selector\n",
                zInFile, nLine);
        exit(1);
      }
      for(i=0; isspace(z[i]); i++){}
      fprintf(out, "    \"");
      clang_puts(out, z+i);
      fprintf(out, "\\n\"\n");
    }else if( z[0]=='}' ){
      if( !inRules ){
        fprintf(stderr, "%s:%d: surplus CSS rule terminator\n",
                zInFile, nLine);
        exit(1);







|







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
    if( isspace(z[0]) ){
      if( !inRules ){
        fprintf(stderr, "%s:%d: CSS rule not within a selector\n",
                zInFile, nLine);
        exit(1);
      }
      for(i=0; isspace(z[i]); i++){}
      fprintf(out, "    \"  ");
      clang_puts(out, z+i);
      fprintf(out, "\\n\"\n");
    }else if( z[0]=='}' ){
      if( !inRules ){
        fprintf(stderr, "%s:%d: surplus CSS rule terminator\n",
                zInFile, nLine);
        exit(1);

Changes to src/style.c.

829
830
831
832
833
834
835
836
837





838
839
840
841
842
843
844
  /* add special missing definitions */
  for(i=1; cssDefaultList[i].elementClass; i++){
    char *z = blob_str(&css);
    if( !containsSelector(z, cssDefaultList[i].elementClass) ){
      if( !isInit ){
        isInit = 1;
        blob_append(&css,
          "/*** All the follows is supplemental CSS automatically generated"
          " by Fossil ***/\n", -1);





      }
      blob_appendf(&css, "%s {\n%s}\n",
          cssDefaultList[i].elementClass,
          cssDefaultList[i].value);
    }
  }








|
|
>
>
>
>
>







829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
  /* add special missing definitions */
  for(i=1; cssDefaultList[i].elementClass; i++){
    char *z = blob_str(&css);
    if( !containsSelector(z, cssDefaultList[i].elementClass) ){
      if( !isInit ){
        isInit = 1;
        blob_append(&css,
          "\n/***********************************************************\n"
          "** All CSS above is supplied by the repository \"skin\".\n"
          "** That which follows is generated automatically by Fossil\n"
          "** to fill in needed selectors that are missing from the\n"
          "** \"skin\" CSS.\n"
          "***********************************************************/\n",
          -1);
      }
      blob_appendf(&css, "%s {\n%s}\n",
          cssDefaultList[i].elementClass,
          cssDefaultList[i].value);
    }
  }