Fossil SCM
Add -dark flag to the pikchr command to tell pikchr to render in dark mode. This is the first part of a request from [forum:8f18c016fe|forum post 8f18c016fe].
Commit
91a73ec348d7609fa8dcde9080e6f64d0bfc473a6a4bf8278bcfd7fd97eea387
Parent
7b4bbc8203e001b…
1 file changed
+9
+9
| --- src/pikchrshow.c | ||
| +++ src/pikchrshow.c | ||
| @@ -22,10 +22,14 @@ | ||
| 22 | 22 | #include <ctype.h> |
| 23 | 23 | #include "pikchrshow.h" |
| 24 | 24 | |
| 25 | 25 | #if INTERFACE |
| 26 | 26 | /* These are described in pikchr_process()'s docs. */ |
| 27 | +/* The first two must match the values from pikchr.c */ | |
| 28 | +#define PIKCHR_PROCESS_PLAINTEXT_ERRORS 0x0001 | |
| 29 | +#define PIKCHR_PROCESS_DARK_MODE 0x0002 | |
| 30 | +/* end of flags supported directly by pikchr() */ | |
| 27 | 31 | #define PIKCHR_PROCESS_PASSTHROUGH 0x0003 /* Pass through these flags */ |
| 28 | 32 | #define PIKCHR_PROCESS_TH1 0x0004 |
| 29 | 33 | #define PIKCHR_PROCESS_TH1_NOSVG 0x0008 |
| 30 | 34 | #define PIKCHR_PROCESS_NONCE 0x0010 |
| 31 | 35 | #define PIKCHR_PROCESS_ERR_PRE 0x0020 |
| @@ -560,10 +564,12 @@ | ||
| 560 | 564 | ** -th-nosvg When using -th, output the post-TH1'd script |
| 561 | 565 | ** instead of the pikchr-rendered output |
| 562 | 566 | ** |
| 563 | 567 | ** -th-trace Trace TH1 execution (for debugging purposes) |
| 564 | 568 | ** |
| 569 | +** -dark Change pikchr colors to assume a dark-mode theme. | |
| 570 | +** | |
| 565 | 571 | ** |
| 566 | 572 | ** The -div-indent/center/left/right flags may not be combined. |
| 567 | 573 | ** |
| 568 | 574 | ** TH1-related Notes and Caveats: |
| 569 | 575 | ** |
| @@ -613,10 +619,13 @@ | ||
| 613 | 619 | pikFlags |= PIKCHR_PROCESS_DIV_TOGGLE; |
| 614 | 620 | } |
| 615 | 621 | if(find_option("div-source",0,0)!=0){ |
| 616 | 622 | pikFlags |= PIKCHR_PROCESS_DIV_SOURCE | PIKCHR_PROCESS_SRC; |
| 617 | 623 | } |
| 624 | + if(find_option("dark",0,0)!=0){ | |
| 625 | + pikFlags |= PIKCHR_PROCESS_DARK_MODE; | |
| 626 | + } | |
| 618 | 627 | |
| 619 | 628 | verify_all_options(); |
| 620 | 629 | if(g.argc>4){ |
| 621 | 630 | usage("?INFILE? ?OUTFILE?"); |
| 622 | 631 | } |
| 623 | 632 |
| --- src/pikchrshow.c | |
| +++ src/pikchrshow.c | |
| @@ -22,10 +22,14 @@ | |
| 22 | #include <ctype.h> |
| 23 | #include "pikchrshow.h" |
| 24 | |
| 25 | #if INTERFACE |
| 26 | /* These are described in pikchr_process()'s docs. */ |
| 27 | #define PIKCHR_PROCESS_PASSTHROUGH 0x0003 /* Pass through these flags */ |
| 28 | #define PIKCHR_PROCESS_TH1 0x0004 |
| 29 | #define PIKCHR_PROCESS_TH1_NOSVG 0x0008 |
| 30 | #define PIKCHR_PROCESS_NONCE 0x0010 |
| 31 | #define PIKCHR_PROCESS_ERR_PRE 0x0020 |
| @@ -560,10 +564,12 @@ | |
| 560 | ** -th-nosvg When using -th, output the post-TH1'd script |
| 561 | ** instead of the pikchr-rendered output |
| 562 | ** |
| 563 | ** -th-trace Trace TH1 execution (for debugging purposes) |
| 564 | ** |
| 565 | ** |
| 566 | ** The -div-indent/center/left/right flags may not be combined. |
| 567 | ** |
| 568 | ** TH1-related Notes and Caveats: |
| 569 | ** |
| @@ -613,10 +619,13 @@ | |
| 613 | pikFlags |= PIKCHR_PROCESS_DIV_TOGGLE; |
| 614 | } |
| 615 | if(find_option("div-source",0,0)!=0){ |
| 616 | pikFlags |= PIKCHR_PROCESS_DIV_SOURCE | PIKCHR_PROCESS_SRC; |
| 617 | } |
| 618 | |
| 619 | verify_all_options(); |
| 620 | if(g.argc>4){ |
| 621 | usage("?INFILE? ?OUTFILE?"); |
| 622 | } |
| 623 |
| --- src/pikchrshow.c | |
| +++ src/pikchrshow.c | |
| @@ -22,10 +22,14 @@ | |
| 22 | #include <ctype.h> |
| 23 | #include "pikchrshow.h" |
| 24 | |
| 25 | #if INTERFACE |
| 26 | /* These are described in pikchr_process()'s docs. */ |
| 27 | /* The first two must match the values from pikchr.c */ |
| 28 | #define PIKCHR_PROCESS_PLAINTEXT_ERRORS 0x0001 |
| 29 | #define PIKCHR_PROCESS_DARK_MODE 0x0002 |
| 30 | /* end of flags supported directly by pikchr() */ |
| 31 | #define PIKCHR_PROCESS_PASSTHROUGH 0x0003 /* Pass through these flags */ |
| 32 | #define PIKCHR_PROCESS_TH1 0x0004 |
| 33 | #define PIKCHR_PROCESS_TH1_NOSVG 0x0008 |
| 34 | #define PIKCHR_PROCESS_NONCE 0x0010 |
| 35 | #define PIKCHR_PROCESS_ERR_PRE 0x0020 |
| @@ -560,10 +564,12 @@ | |
| 564 | ** -th-nosvg When using -th, output the post-TH1'd script |
| 565 | ** instead of the pikchr-rendered output |
| 566 | ** |
| 567 | ** -th-trace Trace TH1 execution (for debugging purposes) |
| 568 | ** |
| 569 | ** -dark Change pikchr colors to assume a dark-mode theme. |
| 570 | ** |
| 571 | ** |
| 572 | ** The -div-indent/center/left/right flags may not be combined. |
| 573 | ** |
| 574 | ** TH1-related Notes and Caveats: |
| 575 | ** |
| @@ -613,10 +619,13 @@ | |
| 619 | pikFlags |= PIKCHR_PROCESS_DIV_TOGGLE; |
| 620 | } |
| 621 | if(find_option("div-source",0,0)!=0){ |
| 622 | pikFlags |= PIKCHR_PROCESS_DIV_SOURCE | PIKCHR_PROCESS_SRC; |
| 623 | } |
| 624 | if(find_option("dark",0,0)!=0){ |
| 625 | pikFlags |= PIKCHR_PROCESS_DARK_MODE; |
| 626 | } |
| 627 | |
| 628 | verify_all_options(); |
| 629 | if(g.argc>4){ |
| 630 | usage("?INFILE? ?OUTFILE?"); |
| 631 | } |
| 632 |