Fossil SCM
If the "pikchr-foreground" property is set in the "details.txt" file of a skin, then the value of that property becomes the default foreground color for Pikchr diagrams.
Commit
0853ab7447a4a6375f546d1a7ad4b62e8ca1c943c848e0cb03b22a75ad492b48
Parent
dd9cfe021beae30…
2 files changed
+5
+5
-4
+5
| --- src/markdown_html.c | ||
| +++ src/markdown_html.c | ||
| @@ -347,10 +347,11 @@ | ||
| 347 | 347 | int pikFlags = PIKCHR_PROCESS_NONCE |
| 348 | 348 | | PIKCHR_PROCESS_DIV |
| 349 | 349 | | PIKCHR_PROCESS_SRC |
| 350 | 350 | | PIKCHR_PROCESS_ERR_PRE; |
| 351 | 351 | Blob bSrc = empty_blob; |
| 352 | + const char *zFgColor; | |
| 352 | 353 | |
| 353 | 354 | while( nArg>0 ){ |
| 354 | 355 | int i; |
| 355 | 356 | for(i=0; i<nArg && !fossil_isspace(zArg[i]); i++){} |
| 356 | 357 | if( i==6 && strncmp(zArg, "center", 6)==0 ){ |
| @@ -373,10 +374,14 @@ | ||
| 373 | 374 | nArg -= i; |
| 374 | 375 | } |
| 375 | 376 | if( skin_detail_boolean("white-foreground") ){ |
| 376 | 377 | pikFlags |= 0x02; /* PIKCHR_DARK_MODE */ |
| 377 | 378 | } |
| 379 | + zFgColor = skin_detail("pikchr-foreground"); | |
| 380 | + if( zFgColor && zFgColor[0] ){ | |
| 381 | + blob_appendf(&bSrc, "color = %s\n", zFgColor); | |
| 382 | + } | |
| 378 | 383 | blob_append(&bSrc, zSrc, nSrc) |
| 379 | 384 | /*have to dup input to ensure a NUL-terminated source string */; |
| 380 | 385 | pikchr_process(blob_str(&bSrc), pikFlags, 0, ob); |
| 381 | 386 | blob_reset(&bSrc); |
| 382 | 387 | } |
| 383 | 388 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -347,10 +347,11 @@ | |
| 347 | int pikFlags = PIKCHR_PROCESS_NONCE |
| 348 | | PIKCHR_PROCESS_DIV |
| 349 | | PIKCHR_PROCESS_SRC |
| 350 | | PIKCHR_PROCESS_ERR_PRE; |
| 351 | Blob bSrc = empty_blob; |
| 352 | |
| 353 | while( nArg>0 ){ |
| 354 | int i; |
| 355 | for(i=0; i<nArg && !fossil_isspace(zArg[i]); i++){} |
| 356 | if( i==6 && strncmp(zArg, "center", 6)==0 ){ |
| @@ -373,10 +374,14 @@ | |
| 373 | nArg -= i; |
| 374 | } |
| 375 | if( skin_detail_boolean("white-foreground") ){ |
| 376 | pikFlags |= 0x02; /* PIKCHR_DARK_MODE */ |
| 377 | } |
| 378 | blob_append(&bSrc, zSrc, nSrc) |
| 379 | /*have to dup input to ensure a NUL-terminated source string */; |
| 380 | pikchr_process(blob_str(&bSrc), pikFlags, 0, ob); |
| 381 | blob_reset(&bSrc); |
| 382 | } |
| 383 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -347,10 +347,11 @@ | |
| 347 | int pikFlags = PIKCHR_PROCESS_NONCE |
| 348 | | PIKCHR_PROCESS_DIV |
| 349 | | PIKCHR_PROCESS_SRC |
| 350 | | PIKCHR_PROCESS_ERR_PRE; |
| 351 | Blob bSrc = empty_blob; |
| 352 | const char *zFgColor; |
| 353 | |
| 354 | while( nArg>0 ){ |
| 355 | int i; |
| 356 | for(i=0; i<nArg && !fossil_isspace(zArg[i]); i++){} |
| 357 | if( i==6 && strncmp(zArg, "center", 6)==0 ){ |
| @@ -373,10 +374,14 @@ | |
| 374 | nArg -= i; |
| 375 | } |
| 376 | if( skin_detail_boolean("white-foreground") ){ |
| 377 | pikFlags |= 0x02; /* PIKCHR_DARK_MODE */ |
| 378 | } |
| 379 | zFgColor = skin_detail("pikchr-foreground"); |
| 380 | if( zFgColor && zFgColor[0] ){ |
| 381 | blob_appendf(&bSrc, "color = %s\n", zFgColor); |
| 382 | } |
| 383 | blob_append(&bSrc, zSrc, nSrc) |
| 384 | /*have to dup input to ensure a NUL-terminated source string */; |
| 385 | pikchr_process(blob_str(&bSrc), pikFlags, 0, ob); |
| 386 | blob_reset(&bSrc); |
| 387 | } |
| 388 |
+5
-4
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -85,14 +85,15 @@ | ||
| 85 | 85 | */ |
| 86 | 86 | static struct SkinDetail { |
| 87 | 87 | const char *zName; /* Name of the detail */ |
| 88 | 88 | const char *zValue; /* Value of the detail */ |
| 89 | 89 | } aSkinDetail[] = { |
| 90 | - { "timeline-arrowheads", "1" }, | |
| 91 | - { "timeline-circle-nodes", "0" }, | |
| 92 | - { "timeline-color-graph-lines", "0" }, | |
| 93 | - { "white-foreground", "0" }, | |
| 90 | + { "pikchr-foreground", "" }, | |
| 91 | + { "timeline-arrowheads", "1" }, | |
| 92 | + { "timeline-circle-nodes", "0" }, | |
| 93 | + { "timeline-color-graph-lines", "0" }, | |
| 94 | + { "white-foreground", "0" }, | |
| 94 | 95 | }; |
| 95 | 96 | |
| 96 | 97 | /* |
| 97 | 98 | ** Invoke this routine to set the alternative skin. Return NULL if the |
| 98 | 99 | ** alternative was successfully installed. Return a string listing all |
| 99 | 100 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -85,14 +85,15 @@ | |
| 85 | */ |
| 86 | static struct SkinDetail { |
| 87 | const char *zName; /* Name of the detail */ |
| 88 | const char *zValue; /* Value of the detail */ |
| 89 | } aSkinDetail[] = { |
| 90 | { "timeline-arrowheads", "1" }, |
| 91 | { "timeline-circle-nodes", "0" }, |
| 92 | { "timeline-color-graph-lines", "0" }, |
| 93 | { "white-foreground", "0" }, |
| 94 | }; |
| 95 | |
| 96 | /* |
| 97 | ** Invoke this routine to set the alternative skin. Return NULL if the |
| 98 | ** alternative was successfully installed. Return a string listing all |
| 99 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -85,14 +85,15 @@ | |
| 85 | */ |
| 86 | static struct SkinDetail { |
| 87 | const char *zName; /* Name of the detail */ |
| 88 | const char *zValue; /* Value of the detail */ |
| 89 | } aSkinDetail[] = { |
| 90 | { "pikchr-foreground", "" }, |
| 91 | { "timeline-arrowheads", "1" }, |
| 92 | { "timeline-circle-nodes", "0" }, |
| 93 | { "timeline-color-graph-lines", "0" }, |
| 94 | { "white-foreground", "0" }, |
| 95 | }; |
| 96 | |
| 97 | /* |
| 98 | ** Invoke this routine to set the alternative skin. Return NULL if the |
| 99 | ** alternative was successfully installed. Return a string listing all |
| 100 |