Fossil

Check-in [358f7d80c2]
Login

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

Overview
Comment:Whitespace style fix
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | body-feature-class
Files: files | file ages | folders
SHA3-256: 358f7d80c28cf352de456c1aa48719f79f3050a5e91bf31a8992bfe28645d793
User & Date: wyoung 2020-12-22 12:30:29.883
Context
2020-12-22
18:31
Add support for the "$current_feature" TH1 variable as a possibly better way to do page-specific of feature-specific styling. ... (check-in: 112c713be1 user: drh tags: trunk)
12:30
Whitespace style fix ... (Closed-Leaf check-in: 358f7d80c2 user: wyoung tags: body-feature-class)
12:13
Removed the parameter from style_finish_page() since the resulting content div class is now redundant with respect to the body class. This potentially breaks CSS made against old class names that a prior commit on this branch changed, but such skins would be made against an unreleased version of Fossil, it's unlikely many are using that first version of the feature anyway, and most of the class names did *not* change unless you were targeting a "div" instead of "body" or just a generic class name. None of the shipping skins are affected. ... (check-in: 0e83ca88ce user: wyoung tags: body-feature-class)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/style.c.
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
**
** For example, "body.forum div.markdown blockquote" targets only
** block quotes made in forum posts, leaving other Markdown quotes
** alone.  Because feature class "forum" groups /forummain, /forumpost,
** and /forume2, it works across all renderings of Markdown to HTML
** within the Fossil forum feature.
*/
static const char* feature_from_page_path(const char *zPath)
{
  const char* zSlash = strchr(zPath, '/');
  if (zSlash) {
    return fossil_strndup(zPath, zSlash - zPath);
  } else {
    return zPath;
  }
}

/*
** Override the value of the TH1 variable current_feature, its default
** set by feature_from_page_path().  We do not call this from
** style_init_th1_vars() because that uses Th_MaybeStore() instead to
** allow webpage implementations to call this before style_header()
** to override that "maybe" default with something better.
*/
void style_set_current_feature(const char* zFeature)
{
  Th_Store("current_feature", zFeature);
}

/*
** Initialize all the default TH1 variables
*/
static void style_init_th1_vars(const char *zTitle){







|
<















|
<







588
589
590
591
592
593
594
595

596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611

612
613
614
615
616
617
618
**
** For example, "body.forum div.markdown blockquote" targets only
** block quotes made in forum posts, leaving other Markdown quotes
** alone.  Because feature class "forum" groups /forummain, /forumpost,
** and /forume2, it works across all renderings of Markdown to HTML
** within the Fossil forum feature.
*/
static const char* feature_from_page_path(const char *zPath){

  const char* zSlash = strchr(zPath, '/');
  if (zSlash) {
    return fossil_strndup(zPath, zSlash - zPath);
  } else {
    return zPath;
  }
}

/*
** Override the value of the TH1 variable current_feature, its default
** set by feature_from_page_path().  We do not call this from
** style_init_th1_vars() because that uses Th_MaybeStore() instead to
** allow webpage implementations to call this before style_header()
** to override that "maybe" default with something better.
*/
void style_set_current_feature(const char* zFeature){

  Th_Store("current_feature", zFeature);
}

/*
** Initialize all the default TH1 variables
*/
static void style_init_th1_vars(const char *zTitle){