aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-05-19 08:21:34 +0000
committerJoursoir <chat@joursoir.net>2021-05-19 08:21:34 +0000
commit949b3d31b6bab235b12ab269e309cf3d1fa7b61c (patch)
tree3748f5f58c74d3f6abc4a9056480fedcc8f91f65
parentf93b7523121ef42f5133001ec7ce2347e3bbfecf (diff)
downloadctimeline-949b3d31b6bab235b12ab269e309cf3d1fa7b61c.tar.gz
ctimeline-949b3d31b6bab235b12ab269e309cf3d1fa7b61c.tar.bz2
ctimeline-949b3d31b6bab235b12ab269e309cf3d1fa7b61c.zip
ctimeline: handle all context infos; split branch and config context
-rw-r--r--ctimeline.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/ctimeline.c b/ctimeline.c
index d27fca5..f2a114a 100644
--- a/ctimeline.c
+++ b/ctimeline.c
@@ -80,7 +80,7 @@ struct ctimeline_branch *add_branch(const char *name)
return br;
}
-void handle_config_context(const char *name, const char *value)
+void handle_branch_context(const char *name, const char *value)
{
if(strcmp(name, "branch.name") == 0) {
ctx.cur_branch = add_branch(value);
@@ -100,6 +100,28 @@ void handle_config_context(const char *name, const char *value)
}
}
+void handle_config_context(const char *name, const char *value)
+{
+ if(strcmp(name, "title") == 0) {
+ ctx.head_title = string_alloc(
+ ctx.head_title, value);
+ }
+ else if(strcmp(name, "css") == 0) {
+ ctx.css = string_alloc(
+ ctx.css, value);
+ }
+ else if(strcmp(name, "header.title") == 0) {
+ ctx.header_title = string_alloc(
+ ctx.header_title, value);
+ }
+ else if(strcmp(name, "header.desc") == 0) {
+ ctx.header_desc = string_alloc(
+ ctx.header_desc, value);
+ }
+ else
+ handle_branch_context(name, value);
+}
+
void skip_line(FILE *f)
{
int c;