Fossil SCM
mods to creole parser and add some default style for creole tables.
Commit
26af399a5c96dc30fa494a3b69c2ad643537b642
Parent
b877d2cfcde914b…
2 files changed
+73
-43
+31
-10
+73
-43
| --- src/creoleparser.c | ||
| +++ src/creoleparser.c | ||
| @@ -36,41 +36,45 @@ | ||
| 36 | 36 | //{{{ LOCAL INTERFACE |
| 37 | 37 | #if LOCAL_INTERFACE |
| 38 | 38 | |
| 39 | 39 | #define POOL_CHUNK_SIZE 100 |
| 40 | 40 | |
| 41 | -#define KIND_ROOT 0x0000001 | |
| 42 | -#define KIND_HORIZONTAL_RULE 0x0000002 | |
| 43 | -#define KIND_HEADING 0x0000004 | |
| 44 | -#define KIND_ORDERED_LIST 0x0000008 | |
| 45 | - | |
| 46 | -#define KIND_UNORDERED_LIST 0x0000010 | |
| 47 | -#define KIND_PARAGRAPH 0x0000020 | |
| 48 | -#define KIND_TABLE 0x0000040 | |
| 49 | -#define KIND_NO_WIKI_BLOCK 0x0000080 | |
| 50 | - | |
| 51 | -#define KIND_PARA_BREAK 0x0000100 | |
| 52 | -#define KIND_END_WIKI_MARKER 0x0000200 | |
| 53 | - | |
| 54 | -#define KIND_BOLD 0x0000400 | |
| 55 | -#define KIND_ITALIC 0x0000800 | |
| 56 | -#define KIND_SUPERSCRIPT 0x0001000 | |
| 57 | -#define KIND_SUBSCRIPT 0x0002000 | |
| 58 | -#define KIND_MONOSPACED 0x0004000 | |
| 59 | -#define KIND_BREAK 0x0008000 | |
| 60 | - | |
| 61 | -#define KIND_TABLE_ROW 0x0010000 | |
| 62 | - | |
| 63 | -#define KIND_MARKER | |
| 64 | - | |
| 41 | +//{{{ KIND | |
| 42 | +#define KIND_ROOT 0x0000001 | |
| 43 | +#define KIND_HORIZONTAL_RULE 0x0000002 | |
| 44 | +#define KIND_HEADING 0x0000004 | |
| 45 | +#define KIND_ORDERED_LIST 0x0000008 | |
| 46 | + | |
| 47 | +#define KIND_UNORDERED_LIST 0x0000010 | |
| 48 | +#define KIND_PARAGRAPH 0x0000020 | |
| 49 | +#define KIND_TABLE 0x0000040 | |
| 50 | +#define KIND_NO_WIKI_BLOCK 0x0000080 | |
| 51 | + | |
| 52 | +#define KIND_PARA_BREAK 0x0000100 | |
| 53 | +#define KIND_END_WIKI_MARKER 0x0000200 | |
| 54 | + | |
| 55 | +#define KIND_BOLD 0x0000400 | |
| 56 | +#define KIND_ITALIC 0x0000800 | |
| 57 | +#define KIND_SUPERSCRIPT 0x0001000 | |
| 58 | +#define KIND_SUBSCRIPT 0x0002000 | |
| 59 | +#define KIND_MONOSPACED 0x0004000 | |
| 60 | +#define KIND_BREAK 0x0008000 | |
| 61 | + | |
| 62 | +#define KIND_TABLE_ROW 0x0010000 | |
| 63 | +//}}} | |
| 64 | +//{{{ FLAG | |
| 65 | +// keep first four bits free | |
| 66 | +#define FLAG_CENTER 0x0000100 | |
| 67 | +//}}} | |
| 65 | 68 | struct Node {//{{{ |
| 66 | 69 | |
| 67 | 70 | char *start; |
| 68 | 71 | char *end; |
| 69 | 72 | |
| 70 | 73 | int kind; |
| 71 | 74 | int level; |
| 75 | + int flags; | |
| 72 | 76 | |
| 73 | 77 | Node *parent; |
| 74 | 78 | Node *next; |
| 75 | 79 | Node *children; |
| 76 | 80 | |
| @@ -111,12 +115,10 @@ | ||
| 111 | 115 | |
| 112 | 116 | |
| 113 | 117 | |
| 114 | 118 | |
| 115 | 119 | }; |
| 116 | -//}}} | |
| 117 | - | |
| 118 | 120 | //}}} |
| 119 | 121 | |
| 120 | 122 | #endif |
| 121 | 123 | |
| 122 | 124 | const int KIND_LIST = (KIND_UNORDERED_LIST | KIND_ORDERED_LIST); |
| @@ -360,11 +362,11 @@ | ||
| 360 | 362 | char *s = p->icursor + 3; |
| 361 | 363 | |
| 362 | 364 | int count = p->iend - p->icursor - 6; |
| 363 | 365 | while (count--){ |
| 364 | 366 | if (s[0]=='}' && s[1]=='}' && s[2]=='}' && s[3]!='}'){ |
| 365 | - blob_appendf(p->iblob, "<tt style='background:yellow'>%s</tt>", htmlize(p->icursor + 3, s - p->icursor-3)); | |
| 367 | + blob_appendf(p->iblob, "<tt style='background:oldlace'>%s</tt>", htmlize(p->icursor + 3, s - p->icursor-3)); | |
| 366 | 368 | p->icursor = s + 3; |
| 367 | 369 | return 1; |
| 368 | 370 | } |
| 369 | 371 | s++; |
| 370 | 372 | } |
| @@ -372,31 +374,52 @@ | ||
| 372 | 374 | } |
| 373 | 375 | |
| 374 | 376 | //}}} |
| 375 | 377 | static int cr_iImage(Parser *p){//{{{ |
| 376 | 378 | |
| 377 | - if ((p->iend - p->icursor)<4) return 0; | |
| 379 | + if (p->inLink) return 0; | |
| 380 | + if ((p->iend - p->icursor)<3) return 0; | |
| 378 | 381 | |
| 379 | - if (p->icursor[1]!='{') | |
| 380 | - return 0; | |
| 382 | + if (p->icursor[1]!='{') return 0; | |
| 381 | 383 | |
| 382 | 384 | char *s = p->icursor + 2; |
| 385 | + char *bar = NULL; | |
| 383 | 386 | |
| 384 | 387 | int count = p->iend - p->icursor - 4; |
| 385 | 388 | while (count--){ |
| 386 | 389 | if (s[0]=='}' && s[1]=='}'){ |
| 387 | - blob_appendf(p->iblob, "<span style='color:blue;'>%s</span>", htmlize(p->icursor+2, s - p->icursor-2)); | |
| 390 | + if (!bar) bar = p->icursor + 2; | |
| 391 | + blob_appendf(p->iblob, "<span style='color:green;border:1px solid green;'>%s</span>", htmlize(bar, s - bar )); | |
| 388 | 392 | p->icursor = s + 2; |
| 389 | 393 | return 1; |
| 390 | 394 | } |
| 395 | + if (!bar && s[0]=='|') bar=s+1; | |
| 391 | 396 | s++; |
| 392 | 397 | } |
| 393 | 398 | return 0; |
| 394 | 399 | } |
| 395 | 400 | //}}} |
| 396 | 401 | static int cr_iMacro(Parser *p){//{{{ |
| 402 | + | |
| 403 | + if (p->inLink) return 0; | |
| 404 | + if ((p->iend - p->icursor)<3) return 0; | |
| 405 | + | |
| 406 | + if (p->icursor[1]!='<') return 0; | |
| 407 | + | |
| 408 | + char *s = p->icursor + 2; | |
| 409 | + | |
| 410 | + int count = p->iend - p->icursor - 4; | |
| 411 | + while (count--){ | |
| 412 | + if (s[0]=='>' && s[1]=='>'){ | |
| 413 | + blob_appendf(p->iblob, "<span style='color:red;border:1px solid red;'>%s</span>", htmlize(p->icursor, s - p->icursor + 2)); | |
| 414 | + p->icursor = s + 2; | |
| 415 | + return 1; | |
| 416 | + } | |
| 417 | + s++; | |
| 418 | + } | |
| 397 | 419 | return 0; |
| 420 | + | |
| 398 | 421 | } |
| 399 | 422 | //}}} |
| 400 | 423 | |
| 401 | 424 | static void cr_renderLink(Parser *p, char *s, char *bar, char *e){//{{{ |
| 402 | 425 | |
| @@ -581,10 +604,12 @@ | ||
| 581 | 604 | return eof; |
| 582 | 605 | |
| 583 | 606 | } |
| 584 | 607 | //}}} |
| 585 | 608 | //}}} |
| 609 | + | |
| 610 | +//{{{ BLOCK PARSER | |
| 586 | 611 | |
| 587 | 612 | static void cr_renderListItem(Parser *p, Node *n){//{{{ |
| 588 | 613 | |
| 589 | 614 | |
| 590 | 615 | blob_append(p->iblob, "<li>", 4); |
| @@ -606,12 +631,12 @@ | ||
| 606 | 631 | if (ord) blob_append(p->iblob, "</ol>", 5); |
| 607 | 632 | else blob_append(p->iblob, "</ul>", 5); |
| 608 | 633 | } |
| 609 | 634 | blob_append(p->iblob, "</li>", 5); |
| 610 | 635 | } |
| 611 | - | |
| 612 | -static void cr_renderList(Parser *p){ | |
| 636 | +//}}} | |
| 637 | +static void cr_renderList(Parser *p){//{{{ | |
| 613 | 638 | |
| 614 | 639 | Node *n = p->list; |
| 615 | 640 | |
| 616 | 641 | while (n->parent !=n) n = n->parent; |
| 617 | 642 | |
| @@ -658,11 +683,10 @@ | ||
| 658 | 683 | if (!s) break; |
| 659 | 684 | } |
| 660 | 685 | blob_append(p->iblob, "</tr>", 5); |
| 661 | 686 | } |
| 662 | 687 | //}}} |
| 663 | - | |
| 664 | 688 | static void cr_renderTable(Parser *p, Node *n){//{{{ |
| 665 | 689 | |
| 666 | 690 | Node *row = n->children; |
| 667 | 691 | |
| 668 | 692 | blob_append(p->iblob, "<table class='creoletable'>", -1); |
| @@ -677,27 +701,26 @@ | ||
| 677 | 701 | p->inTable = 0; |
| 678 | 702 | |
| 679 | 703 | } |
| 680 | 704 | //}}} |
| 681 | 705 | |
| 682 | - | |
| 683 | 706 | static void cr_render(Parser *p, Node *node){//{{{ |
| 684 | 707 | |
| 685 | 708 | if (node->kind & KIND_PARAGRAPH){ |
| 686 | 709 | blob_append(p->iblob, "\n<p>", -1); |
| 687 | 710 | cr_parseInline(p, node->start, node->end ); |
| 688 | 711 | blob_append(p->iblob, "</p>\n", -1 ); |
| 689 | 712 | } |
| 690 | 713 | |
| 691 | 714 | if (node->kind & KIND_HEADING){ |
| 692 | - | |
| 693 | 715 | blob_appendf(p->iblob, |
| 694 | - "\n<h%d>%s</h%d>\n", | |
| 716 | + "\n<h%d %s>", | |
| 695 | 717 | node->level, |
| 696 | - htmlize(node->start, node->end - node->start), | |
| 697 | - node->level | |
| 718 | + (node->flags & FLAG_CENTER) ? " style='text-align:center;'" : "" | |
| 698 | 719 | ); |
| 720 | + cr_parseInline(p, node->start, node->end); | |
| 721 | + blob_appendf(p->iblob, "</h%d>\n", node->level ); | |
| 699 | 722 | return; |
| 700 | 723 | } |
| 701 | 724 | |
| 702 | 725 | if (node->kind & KIND_HORIZONTAL_RULE){ |
| 703 | 726 | blob_append(p->iblob, "<hr />", -1); |
| @@ -722,11 +745,10 @@ | ||
| 722 | 745 | ); |
| 723 | 746 | } |
| 724 | 747 | } |
| 725 | 748 | //}}} |
| 726 | 749 | |
| 727 | - | |
| 728 | 750 | static char *cr_findEndOfBlock(Parser *p, char *s, char c){//{{{ |
| 729 | 751 | |
| 730 | 752 | char *end; |
| 731 | 753 | while (s[0]){ |
| 732 | 754 | |
| @@ -743,11 +765,10 @@ | ||
| 743 | 765 | } |
| 744 | 766 | } |
| 745 | 767 | return 0; |
| 746 | 768 | } |
| 747 | 769 | //}}} |
| 748 | - | |
| 749 | 770 | static int cr_addListItem(Parser *p, Node *n){//{{{ |
| 750 | 771 | |
| 751 | 772 | n->parent = n; |
| 752 | 773 | n->next = n->children = NULL; |
| 753 | 774 | |
| @@ -782,11 +803,10 @@ | ||
| 782 | 803 | p->list = n; |
| 783 | 804 | return 1; |
| 784 | 805 | |
| 785 | 806 | } |
| 786 | 807 | //}}} |
| 787 | - | |
| 788 | 808 | |
| 789 | 809 | static int isEndWikiMarker(Parser *p){//{{{ |
| 790 | 810 | |
| 791 | 811 | char *s = p->cursor; |
| 792 | 812 | if (memcmp(s, "<<fossil>>", 10)) return 0; |
| @@ -832,14 +852,21 @@ | ||
| 832 | 852 | //}}} |
| 833 | 853 | static int isHeading(Parser *p){//{{{ |
| 834 | 854 | |
| 835 | 855 | char *s = cr_skipBlanks(p, p->cursor); |
| 836 | 856 | |
| 857 | + int flags = 0; | |
| 837 | 858 | int level = cr_countChars(p, s, '='); |
| 838 | 859 | if (!level) return 0; |
| 839 | 860 | |
| 840 | - s = cr_skipBlanks(p, s + level); | |
| 861 | + s += level; | |
| 862 | + | |
| 863 | + if (s[0] == '<' && s[1] == '>') { | |
| 864 | + flags |= FLAG_CENTER; | |
| 865 | + s += 2; | |
| 866 | + } | |
| 867 | + s = cr_skipBlanks(p, s); | |
| 841 | 868 | |
| 842 | 869 | p->this->start = s; |
| 843 | 870 | |
| 844 | 871 | s = cr_nextLine(p, s); |
| 845 | 872 | char *z = s; |
| @@ -850,10 +877,11 @@ | ||
| 850 | 877 | if (p->this->start < s){ |
| 851 | 878 | p->cursor = z; |
| 852 | 879 | p->this->kind = KIND_HEADING; |
| 853 | 880 | p->this->end = s; |
| 854 | 881 | p->this->level = level; |
| 882 | + p->this->flags |= flags; | |
| 855 | 883 | return 1; |
| 856 | 884 | } |
| 857 | 885 | return 0; |
| 858 | 886 | } |
| 859 | 887 | //}}} |
| @@ -1007,10 +1035,12 @@ | ||
| 1007 | 1035 | p->previous = p->this; |
| 1008 | 1036 | p->this = pool_new(p); |
| 1009 | 1037 | |
| 1010 | 1038 | } |
| 1011 | 1039 | } |
| 1040 | +//}}} | |
| 1041 | + | |
| 1012 | 1042 | //}}} |
| 1013 | 1043 | |
| 1014 | 1044 | char *wiki_render_creole(Renderer *r, char *z){//{{{ |
| 1015 | 1045 | |
| 1016 | 1046 | Parser parser; |
| 1017 | 1047 |
| --- src/creoleparser.c | |
| +++ src/creoleparser.c | |
| @@ -36,41 +36,45 @@ | |
| 36 | //{{{ LOCAL INTERFACE |
| 37 | #if LOCAL_INTERFACE |
| 38 | |
| 39 | #define POOL_CHUNK_SIZE 100 |
| 40 | |
| 41 | #define KIND_ROOT 0x0000001 |
| 42 | #define KIND_HORIZONTAL_RULE 0x0000002 |
| 43 | #define KIND_HEADING 0x0000004 |
| 44 | #define KIND_ORDERED_LIST 0x0000008 |
| 45 | |
| 46 | #define KIND_UNORDERED_LIST 0x0000010 |
| 47 | #define KIND_PARAGRAPH 0x0000020 |
| 48 | #define KIND_TABLE 0x0000040 |
| 49 | #define KIND_NO_WIKI_BLOCK 0x0000080 |
| 50 | |
| 51 | #define KIND_PARA_BREAK 0x0000100 |
| 52 | #define KIND_END_WIKI_MARKER 0x0000200 |
| 53 | |
| 54 | #define KIND_BOLD 0x0000400 |
| 55 | #define KIND_ITALIC 0x0000800 |
| 56 | #define KIND_SUPERSCRIPT 0x0001000 |
| 57 | #define KIND_SUBSCRIPT 0x0002000 |
| 58 | #define KIND_MONOSPACED 0x0004000 |
| 59 | #define KIND_BREAK 0x0008000 |
| 60 | |
| 61 | #define KIND_TABLE_ROW 0x0010000 |
| 62 | |
| 63 | #define KIND_MARKER |
| 64 | |
| 65 | struct Node {//{{{ |
| 66 | |
| 67 | char *start; |
| 68 | char *end; |
| 69 | |
| 70 | int kind; |
| 71 | int level; |
| 72 | |
| 73 | Node *parent; |
| 74 | Node *next; |
| 75 | Node *children; |
| 76 | |
| @@ -111,12 +115,10 @@ | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | }; |
| 116 | //}}} |
| 117 | |
| 118 | //}}} |
| 119 | |
| 120 | #endif |
| 121 | |
| 122 | const int KIND_LIST = (KIND_UNORDERED_LIST | KIND_ORDERED_LIST); |
| @@ -360,11 +362,11 @@ | |
| 360 | char *s = p->icursor + 3; |
| 361 | |
| 362 | int count = p->iend - p->icursor - 6; |
| 363 | while (count--){ |
| 364 | if (s[0]=='}' && s[1]=='}' && s[2]=='}' && s[3]!='}'){ |
| 365 | blob_appendf(p->iblob, "<tt style='background:yellow'>%s</tt>", htmlize(p->icursor + 3, s - p->icursor-3)); |
| 366 | p->icursor = s + 3; |
| 367 | return 1; |
| 368 | } |
| 369 | s++; |
| 370 | } |
| @@ -372,31 +374,52 @@ | |
| 372 | } |
| 373 | |
| 374 | //}}} |
| 375 | static int cr_iImage(Parser *p){//{{{ |
| 376 | |
| 377 | if ((p->iend - p->icursor)<4) return 0; |
| 378 | |
| 379 | if (p->icursor[1]!='{') |
| 380 | return 0; |
| 381 | |
| 382 | char *s = p->icursor + 2; |
| 383 | |
| 384 | int count = p->iend - p->icursor - 4; |
| 385 | while (count--){ |
| 386 | if (s[0]=='}' && s[1]=='}'){ |
| 387 | blob_appendf(p->iblob, "<span style='color:blue;'>%s</span>", htmlize(p->icursor+2, s - p->icursor-2)); |
| 388 | p->icursor = s + 2; |
| 389 | return 1; |
| 390 | } |
| 391 | s++; |
| 392 | } |
| 393 | return 0; |
| 394 | } |
| 395 | //}}} |
| 396 | static int cr_iMacro(Parser *p){//{{{ |
| 397 | return 0; |
| 398 | } |
| 399 | //}}} |
| 400 | |
| 401 | static void cr_renderLink(Parser *p, char *s, char *bar, char *e){//{{{ |
| 402 | |
| @@ -581,10 +604,12 @@ | |
| 581 | return eof; |
| 582 | |
| 583 | } |
| 584 | //}}} |
| 585 | //}}} |
| 586 | |
| 587 | static void cr_renderListItem(Parser *p, Node *n){//{{{ |
| 588 | |
| 589 | |
| 590 | blob_append(p->iblob, "<li>", 4); |
| @@ -606,12 +631,12 @@ | |
| 606 | if (ord) blob_append(p->iblob, "</ol>", 5); |
| 607 | else blob_append(p->iblob, "</ul>", 5); |
| 608 | } |
| 609 | blob_append(p->iblob, "</li>", 5); |
| 610 | } |
| 611 | |
| 612 | static void cr_renderList(Parser *p){ |
| 613 | |
| 614 | Node *n = p->list; |
| 615 | |
| 616 | while (n->parent !=n) n = n->parent; |
| 617 | |
| @@ -658,11 +683,10 @@ | |
| 658 | if (!s) break; |
| 659 | } |
| 660 | blob_append(p->iblob, "</tr>", 5); |
| 661 | } |
| 662 | //}}} |
| 663 | |
| 664 | static void cr_renderTable(Parser *p, Node *n){//{{{ |
| 665 | |
| 666 | Node *row = n->children; |
| 667 | |
| 668 | blob_append(p->iblob, "<table class='creoletable'>", -1); |
| @@ -677,27 +701,26 @@ | |
| 677 | p->inTable = 0; |
| 678 | |
| 679 | } |
| 680 | //}}} |
| 681 | |
| 682 | |
| 683 | static void cr_render(Parser *p, Node *node){//{{{ |
| 684 | |
| 685 | if (node->kind & KIND_PARAGRAPH){ |
| 686 | blob_append(p->iblob, "\n<p>", -1); |
| 687 | cr_parseInline(p, node->start, node->end ); |
| 688 | blob_append(p->iblob, "</p>\n", -1 ); |
| 689 | } |
| 690 | |
| 691 | if (node->kind & KIND_HEADING){ |
| 692 | |
| 693 | blob_appendf(p->iblob, |
| 694 | "\n<h%d>%s</h%d>\n", |
| 695 | node->level, |
| 696 | htmlize(node->start, node->end - node->start), |
| 697 | node->level |
| 698 | ); |
| 699 | return; |
| 700 | } |
| 701 | |
| 702 | if (node->kind & KIND_HORIZONTAL_RULE){ |
| 703 | blob_append(p->iblob, "<hr />", -1); |
| @@ -722,11 +745,10 @@ | |
| 722 | ); |
| 723 | } |
| 724 | } |
| 725 | //}}} |
| 726 | |
| 727 | |
| 728 | static char *cr_findEndOfBlock(Parser *p, char *s, char c){//{{{ |
| 729 | |
| 730 | char *end; |
| 731 | while (s[0]){ |
| 732 | |
| @@ -743,11 +765,10 @@ | |
| 743 | } |
| 744 | } |
| 745 | return 0; |
| 746 | } |
| 747 | //}}} |
| 748 | |
| 749 | static int cr_addListItem(Parser *p, Node *n){//{{{ |
| 750 | |
| 751 | n->parent = n; |
| 752 | n->next = n->children = NULL; |
| 753 | |
| @@ -782,11 +803,10 @@ | |
| 782 | p->list = n; |
| 783 | return 1; |
| 784 | |
| 785 | } |
| 786 | //}}} |
| 787 | |
| 788 | |
| 789 | static int isEndWikiMarker(Parser *p){//{{{ |
| 790 | |
| 791 | char *s = p->cursor; |
| 792 | if (memcmp(s, "<<fossil>>", 10)) return 0; |
| @@ -832,14 +852,21 @@ | |
| 832 | //}}} |
| 833 | static int isHeading(Parser *p){//{{{ |
| 834 | |
| 835 | char *s = cr_skipBlanks(p, p->cursor); |
| 836 | |
| 837 | int level = cr_countChars(p, s, '='); |
| 838 | if (!level) return 0; |
| 839 | |
| 840 | s = cr_skipBlanks(p, s + level); |
| 841 | |
| 842 | p->this->start = s; |
| 843 | |
| 844 | s = cr_nextLine(p, s); |
| 845 | char *z = s; |
| @@ -850,10 +877,11 @@ | |
| 850 | if (p->this->start < s){ |
| 851 | p->cursor = z; |
| 852 | p->this->kind = KIND_HEADING; |
| 853 | p->this->end = s; |
| 854 | p->this->level = level; |
| 855 | return 1; |
| 856 | } |
| 857 | return 0; |
| 858 | } |
| 859 | //}}} |
| @@ -1007,10 +1035,12 @@ | |
| 1007 | p->previous = p->this; |
| 1008 | p->this = pool_new(p); |
| 1009 | |
| 1010 | } |
| 1011 | } |
| 1012 | //}}} |
| 1013 | |
| 1014 | char *wiki_render_creole(Renderer *r, char *z){//{{{ |
| 1015 | |
| 1016 | Parser parser; |
| 1017 |
| --- src/creoleparser.c | |
| +++ src/creoleparser.c | |
| @@ -36,41 +36,45 @@ | |
| 36 | //{{{ LOCAL INTERFACE |
| 37 | #if LOCAL_INTERFACE |
| 38 | |
| 39 | #define POOL_CHUNK_SIZE 100 |
| 40 | |
| 41 | //{{{ KIND |
| 42 | #define KIND_ROOT 0x0000001 |
| 43 | #define KIND_HORIZONTAL_RULE 0x0000002 |
| 44 | #define KIND_HEADING 0x0000004 |
| 45 | #define KIND_ORDERED_LIST 0x0000008 |
| 46 | |
| 47 | #define KIND_UNORDERED_LIST 0x0000010 |
| 48 | #define KIND_PARAGRAPH 0x0000020 |
| 49 | #define KIND_TABLE 0x0000040 |
| 50 | #define KIND_NO_WIKI_BLOCK 0x0000080 |
| 51 | |
| 52 | #define KIND_PARA_BREAK 0x0000100 |
| 53 | #define KIND_END_WIKI_MARKER 0x0000200 |
| 54 | |
| 55 | #define KIND_BOLD 0x0000400 |
| 56 | #define KIND_ITALIC 0x0000800 |
| 57 | #define KIND_SUPERSCRIPT 0x0001000 |
| 58 | #define KIND_SUBSCRIPT 0x0002000 |
| 59 | #define KIND_MONOSPACED 0x0004000 |
| 60 | #define KIND_BREAK 0x0008000 |
| 61 | |
| 62 | #define KIND_TABLE_ROW 0x0010000 |
| 63 | //}}} |
| 64 | //{{{ FLAG |
| 65 | // keep first four bits free |
| 66 | #define FLAG_CENTER 0x0000100 |
| 67 | //}}} |
| 68 | struct Node {//{{{ |
| 69 | |
| 70 | char *start; |
| 71 | char *end; |
| 72 | |
| 73 | int kind; |
| 74 | int level; |
| 75 | int flags; |
| 76 | |
| 77 | Node *parent; |
| 78 | Node *next; |
| 79 | Node *children; |
| 80 | |
| @@ -111,12 +115,10 @@ | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | }; |
| 120 | //}}} |
| 121 | |
| 122 | #endif |
| 123 | |
| 124 | const int KIND_LIST = (KIND_UNORDERED_LIST | KIND_ORDERED_LIST); |
| @@ -360,11 +362,11 @@ | |
| 362 | char *s = p->icursor + 3; |
| 363 | |
| 364 | int count = p->iend - p->icursor - 6; |
| 365 | while (count--){ |
| 366 | if (s[0]=='}' && s[1]=='}' && s[2]=='}' && s[3]!='}'){ |
| 367 | blob_appendf(p->iblob, "<tt style='background:oldlace'>%s</tt>", htmlize(p->icursor + 3, s - p->icursor-3)); |
| 368 | p->icursor = s + 3; |
| 369 | return 1; |
| 370 | } |
| 371 | s++; |
| 372 | } |
| @@ -372,31 +374,52 @@ | |
| 374 | } |
| 375 | |
| 376 | //}}} |
| 377 | static int cr_iImage(Parser *p){//{{{ |
| 378 | |
| 379 | if (p->inLink) return 0; |
| 380 | if ((p->iend - p->icursor)<3) return 0; |
| 381 | |
| 382 | if (p->icursor[1]!='{') return 0; |
| 383 | |
| 384 | char *s = p->icursor + 2; |
| 385 | char *bar = NULL; |
| 386 | |
| 387 | int count = p->iend - p->icursor - 4; |
| 388 | while (count--){ |
| 389 | if (s[0]=='}' && s[1]=='}'){ |
| 390 | if (!bar) bar = p->icursor + 2; |
| 391 | blob_appendf(p->iblob, "<span style='color:green;border:1px solid green;'>%s</span>", htmlize(bar, s - bar )); |
| 392 | p->icursor = s + 2; |
| 393 | return 1; |
| 394 | } |
| 395 | if (!bar && s[0]=='|') bar=s+1; |
| 396 | s++; |
| 397 | } |
| 398 | return 0; |
| 399 | } |
| 400 | //}}} |
| 401 | static int cr_iMacro(Parser *p){//{{{ |
| 402 | |
| 403 | if (p->inLink) return 0; |
| 404 | if ((p->iend - p->icursor)<3) return 0; |
| 405 | |
| 406 | if (p->icursor[1]!='<') return 0; |
| 407 | |
| 408 | char *s = p->icursor + 2; |
| 409 | |
| 410 | int count = p->iend - p->icursor - 4; |
| 411 | while (count--){ |
| 412 | if (s[0]=='>' && s[1]=='>'){ |
| 413 | blob_appendf(p->iblob, "<span style='color:red;border:1px solid red;'>%s</span>", htmlize(p->icursor, s - p->icursor + 2)); |
| 414 | p->icursor = s + 2; |
| 415 | return 1; |
| 416 | } |
| 417 | s++; |
| 418 | } |
| 419 | return 0; |
| 420 | |
| 421 | } |
| 422 | //}}} |
| 423 | |
| 424 | static void cr_renderLink(Parser *p, char *s, char *bar, char *e){//{{{ |
| 425 | |
| @@ -581,10 +604,12 @@ | |
| 604 | return eof; |
| 605 | |
| 606 | } |
| 607 | //}}} |
| 608 | //}}} |
| 609 | |
| 610 | //{{{ BLOCK PARSER |
| 611 | |
| 612 | static void cr_renderListItem(Parser *p, Node *n){//{{{ |
| 613 | |
| 614 | |
| 615 | blob_append(p->iblob, "<li>", 4); |
| @@ -606,12 +631,12 @@ | |
| 631 | if (ord) blob_append(p->iblob, "</ol>", 5); |
| 632 | else blob_append(p->iblob, "</ul>", 5); |
| 633 | } |
| 634 | blob_append(p->iblob, "</li>", 5); |
| 635 | } |
| 636 | //}}} |
| 637 | static void cr_renderList(Parser *p){//{{{ |
| 638 | |
| 639 | Node *n = p->list; |
| 640 | |
| 641 | while (n->parent !=n) n = n->parent; |
| 642 | |
| @@ -658,11 +683,10 @@ | |
| 683 | if (!s) break; |
| 684 | } |
| 685 | blob_append(p->iblob, "</tr>", 5); |
| 686 | } |
| 687 | //}}} |
| 688 | static void cr_renderTable(Parser *p, Node *n){//{{{ |
| 689 | |
| 690 | Node *row = n->children; |
| 691 | |
| 692 | blob_append(p->iblob, "<table class='creoletable'>", -1); |
| @@ -677,27 +701,26 @@ | |
| 701 | p->inTable = 0; |
| 702 | |
| 703 | } |
| 704 | //}}} |
| 705 | |
| 706 | static void cr_render(Parser *p, Node *node){//{{{ |
| 707 | |
| 708 | if (node->kind & KIND_PARAGRAPH){ |
| 709 | blob_append(p->iblob, "\n<p>", -1); |
| 710 | cr_parseInline(p, node->start, node->end ); |
| 711 | blob_append(p->iblob, "</p>\n", -1 ); |
| 712 | } |
| 713 | |
| 714 | if (node->kind & KIND_HEADING){ |
| 715 | blob_appendf(p->iblob, |
| 716 | "\n<h%d %s>", |
| 717 | node->level, |
| 718 | (node->flags & FLAG_CENTER) ? " style='text-align:center;'" : "" |
| 719 | ); |
| 720 | cr_parseInline(p, node->start, node->end); |
| 721 | blob_appendf(p->iblob, "</h%d>\n", node->level ); |
| 722 | return; |
| 723 | } |
| 724 | |
| 725 | if (node->kind & KIND_HORIZONTAL_RULE){ |
| 726 | blob_append(p->iblob, "<hr />", -1); |
| @@ -722,11 +745,10 @@ | |
| 745 | ); |
| 746 | } |
| 747 | } |
| 748 | //}}} |
| 749 | |
| 750 | static char *cr_findEndOfBlock(Parser *p, char *s, char c){//{{{ |
| 751 | |
| 752 | char *end; |
| 753 | while (s[0]){ |
| 754 | |
| @@ -743,11 +765,10 @@ | |
| 765 | } |
| 766 | } |
| 767 | return 0; |
| 768 | } |
| 769 | //}}} |
| 770 | static int cr_addListItem(Parser *p, Node *n){//{{{ |
| 771 | |
| 772 | n->parent = n; |
| 773 | n->next = n->children = NULL; |
| 774 | |
| @@ -782,11 +803,10 @@ | |
| 803 | p->list = n; |
| 804 | return 1; |
| 805 | |
| 806 | } |
| 807 | //}}} |
| 808 | |
| 809 | static int isEndWikiMarker(Parser *p){//{{{ |
| 810 | |
| 811 | char *s = p->cursor; |
| 812 | if (memcmp(s, "<<fossil>>", 10)) return 0; |
| @@ -832,14 +852,21 @@ | |
| 852 | //}}} |
| 853 | static int isHeading(Parser *p){//{{{ |
| 854 | |
| 855 | char *s = cr_skipBlanks(p, p->cursor); |
| 856 | |
| 857 | int flags = 0; |
| 858 | int level = cr_countChars(p, s, '='); |
| 859 | if (!level) return 0; |
| 860 | |
| 861 | s += level; |
| 862 | |
| 863 | if (s[0] == '<' && s[1] == '>') { |
| 864 | flags |= FLAG_CENTER; |
| 865 | s += 2; |
| 866 | } |
| 867 | s = cr_skipBlanks(p, s); |
| 868 | |
| 869 | p->this->start = s; |
| 870 | |
| 871 | s = cr_nextLine(p, s); |
| 872 | char *z = s; |
| @@ -850,10 +877,11 @@ | |
| 877 | if (p->this->start < s){ |
| 878 | p->cursor = z; |
| 879 | p->this->kind = KIND_HEADING; |
| 880 | p->this->end = s; |
| 881 | p->this->level = level; |
| 882 | p->this->flags |= flags; |
| 883 | return 1; |
| 884 | } |
| 885 | return 0; |
| 886 | } |
| 887 | //}}} |
| @@ -1007,10 +1035,12 @@ | |
| 1035 | p->previous = p->this; |
| 1036 | p->this = pool_new(p); |
| 1037 | |
| 1038 | } |
| 1039 | } |
| 1040 | //}}} |
| 1041 | |
| 1042 | //}}} |
| 1043 | |
| 1044 | char *wiki_render_creole(Renderer *r, char *z){//{{{ |
| 1045 | |
| 1046 | Parser parser; |
| 1047 |
+31
-10
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -80,19 +80,19 @@ | ||
| 80 | 80 | ** Draw the header. |
| 81 | 81 | */ |
| 82 | 82 | void style_header(const char *zTitleFormat, ...){ |
| 83 | 83 | va_list ap; |
| 84 | 84 | char *zTitle; |
| 85 | - const char *zHeader = db_get("header", (char*)zDefaultHeader); | |
| 85 | + const char *zHeader = db_get("header", (char*)zDefaultHeader); | |
| 86 | 86 | login_check_credentials(); |
| 87 | 87 | |
| 88 | 88 | va_start(ap, zTitleFormat); |
| 89 | 89 | zTitle = vmprintf(zTitleFormat, ap); |
| 90 | 90 | va_end(ap); |
| 91 | - | |
| 91 | + | |
| 92 | 92 | cgi_destination(CGI_HEADER); |
| 93 | - | |
| 93 | + | |
| 94 | 94 | if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1); |
| 95 | 95 | |
| 96 | 96 | /* Generate the header up through the main menu */ |
| 97 | 97 | Th_Store("project_name", db_get("project-name","Unnamed Fossil Project")); |
| 98 | 98 | Th_Store("title", zTitle); |
| @@ -118,11 +118,11 @@ | ||
| 118 | 118 | */ |
| 119 | 119 | void style_footer(void){ |
| 120 | 120 | const char *zFooter; |
| 121 | 121 | |
| 122 | 122 | if( !headerHasBeenGenerated ) return; |
| 123 | - | |
| 123 | + | |
| 124 | 124 | /* Go back and put the submenu at the top of the page. We delay the |
| 125 | 125 | ** creation of the submenu until the end so that we can add elements |
| 126 | 126 | ** to the submenu while generating page text. |
| 127 | 127 | */ |
| 128 | 128 | cgi_destination(CGI_HEADER); |
| @@ -148,11 +148,11 @@ | ||
| 148 | 148 | @ </div> |
| 149 | 149 | zFooter = db_get("footer", (char*)zDefaultFooter); |
| 150 | 150 | if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1); |
| 151 | 151 | Th_Render(zFooter); |
| 152 | 152 | if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1); |
| 153 | - | |
| 153 | + | |
| 154 | 154 | /* Render trace log if TH1 tracing is enabled. */ |
| 155 | 155 | if( g.thTrace ){ |
| 156 | 156 | cgi_append_content("<font color=\"red\"><hr>\n", -1); |
| 157 | 157 | cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog)); |
| 158 | 158 | cgi_append_content("</font>\n", -1); |
| @@ -179,11 +179,11 @@ | ||
| 179 | 179 | |
| 180 | 180 | /* @-comment: // */ |
| 181 | 181 | /* |
| 182 | 182 | ** The default page header. |
| 183 | 183 | */ |
| 184 | -const char zDefaultHeader[] = | |
| 184 | +const char zDefaultHeader[] = | |
| 185 | 185 | @ <html> |
| 186 | 186 | @ <head> |
| 187 | 187 | @ <title>$<project_name>: $<title></title> |
| 188 | 188 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" |
| 189 | 189 | @ href="$baseurl/timeline.rss"> |
| @@ -236,21 +236,21 @@ | ||
| 236 | 236 | ; |
| 237 | 237 | |
| 238 | 238 | /* |
| 239 | 239 | ** The default page footer |
| 240 | 240 | */ |
| 241 | -const char zDefaultFooter[] = | |
| 241 | +const char zDefaultFooter[] = | |
| 242 | 242 | @ <div class="footer"> |
| 243 | 243 | @ Fossil version $manifest_version $manifest_date |
| 244 | 244 | @ </div> |
| 245 | 245 | @ </body></html> |
| 246 | 246 | ; |
| 247 | 247 | |
| 248 | 248 | /* |
| 249 | 249 | ** The default Cascading Style Sheet. |
| 250 | 250 | */ |
| 251 | -const char zDefaultCSS[] = | |
| 251 | +const char zDefaultCSS[] = | |
| 252 | 252 | @ /* General settings for the entire page */ |
| 253 | 253 | @ body { |
| 254 | 254 | @ margin: 0ex 1ex; |
| 255 | 255 | @ padding: 0px; |
| 256 | 256 | @ background-color: white; |
| @@ -364,11 +364,11 @@ | ||
| 364 | 364 | @ /* Make the links in the footer less ugly... */ |
| 365 | 365 | @ div.footer a { color: white; } |
| 366 | 366 | @ div.footer a:link { color: white; } |
| 367 | 367 | @ div.footer a:visited { color: white; } |
| 368 | 368 | @ div.footer a:hover { background-color: white; color: #558195; } |
| 369 | -@ | |
| 369 | +@ | |
| 370 | 370 | @ /* <verbatim> blocks */ |
| 371 | 371 | @ pre.verbatim { |
| 372 | 372 | @ background-color: #f5f5f5; |
| 373 | 373 | @ padding: 0.5em; |
| 374 | 374 | @} |
| @@ -391,11 +391,11 @@ | ||
| 391 | 391 | @ } |
| 392 | 392 | @ |
| 393 | 393 | @ div.miniform { |
| 394 | 394 | @ font-size: smaller; |
| 395 | 395 | @ margin: 8px; |
| 396 | -@ } | |
| 396 | +@ } | |
| 397 | 397 | @ |
| 398 | 398 | @ table.fossil_db_generic_query_view { |
| 399 | 399 | @ border-spacing: 0px; |
| 400 | 400 | @ border: 1px solid black; |
| 401 | 401 | @ } |
| @@ -413,10 +413,31 @@ | ||
| 413 | 413 | @ table.fossil_db_generic_query_view tr.header { |
| 414 | 414 | @ background: #558195; |
| 415 | 415 | @ font-size: 1.5em; |
| 416 | 416 | @ color: #ffffff; |
| 417 | 417 | @ } |
| 418 | +@ .creoletable { | |
| 419 | +@ border: 1px solid #666666; | |
| 420 | +@ border-spacing: 0; | |
| 421 | +@ margin: 1.5em 2em 1.8em 2em; | |
| 422 | +@ } | |
| 423 | +@ .creoletable * tr th { | |
| 424 | +@ font-size: 100%; | |
| 425 | +@ padding: .5em .7em .5em .7em; | |
| 426 | +@ border-left: 1px solid #666666; | |
| 427 | +@ background-color: #558195; | |
| 428 | +@ vertical-align: bottom; | |
| 429 | +@ color: white; | |
| 430 | +@ empty-cells: show; | |
| 431 | +@ } | |
| 432 | +@ .creoletable * tr td { | |
| 433 | +@ padding: .4em .7em .45em .7em; | |
| 434 | +@ border-left: 1px solid #D9D9D9; | |
| 435 | +@ border-top: 1px solid #D9D9D9; | |
| 436 | +@ vertical-align: center; | |
| 437 | +@ empty-cells: show; | |
| 438 | +@ } | |
| 418 | 439 | ; |
| 419 | 440 | |
| 420 | 441 | /* |
| 421 | 442 | ** WEBPAGE: style.css |
| 422 | 443 | */ |
| 423 | 444 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -80,19 +80,19 @@ | |
| 80 | ** Draw the header. |
| 81 | */ |
| 82 | void style_header(const char *zTitleFormat, ...){ |
| 83 | va_list ap; |
| 84 | char *zTitle; |
| 85 | const char *zHeader = db_get("header", (char*)zDefaultHeader); |
| 86 | login_check_credentials(); |
| 87 | |
| 88 | va_start(ap, zTitleFormat); |
| 89 | zTitle = vmprintf(zTitleFormat, ap); |
| 90 | va_end(ap); |
| 91 | |
| 92 | cgi_destination(CGI_HEADER); |
| 93 | |
| 94 | if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1); |
| 95 | |
| 96 | /* Generate the header up through the main menu */ |
| 97 | Th_Store("project_name", db_get("project-name","Unnamed Fossil Project")); |
| 98 | Th_Store("title", zTitle); |
| @@ -118,11 +118,11 @@ | |
| 118 | */ |
| 119 | void style_footer(void){ |
| 120 | const char *zFooter; |
| 121 | |
| 122 | if( !headerHasBeenGenerated ) return; |
| 123 | |
| 124 | /* Go back and put the submenu at the top of the page. We delay the |
| 125 | ** creation of the submenu until the end so that we can add elements |
| 126 | ** to the submenu while generating page text. |
| 127 | */ |
| 128 | cgi_destination(CGI_HEADER); |
| @@ -148,11 +148,11 @@ | |
| 148 | @ </div> |
| 149 | zFooter = db_get("footer", (char*)zDefaultFooter); |
| 150 | if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1); |
| 151 | Th_Render(zFooter); |
| 152 | if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1); |
| 153 | |
| 154 | /* Render trace log if TH1 tracing is enabled. */ |
| 155 | if( g.thTrace ){ |
| 156 | cgi_append_content("<font color=\"red\"><hr>\n", -1); |
| 157 | cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog)); |
| 158 | cgi_append_content("</font>\n", -1); |
| @@ -179,11 +179,11 @@ | |
| 179 | |
| 180 | /* @-comment: // */ |
| 181 | /* |
| 182 | ** The default page header. |
| 183 | */ |
| 184 | const char zDefaultHeader[] = |
| 185 | @ <html> |
| 186 | @ <head> |
| 187 | @ <title>$<project_name>: $<title></title> |
| 188 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" |
| 189 | @ href="$baseurl/timeline.rss"> |
| @@ -236,21 +236,21 @@ | |
| 236 | ; |
| 237 | |
| 238 | /* |
| 239 | ** The default page footer |
| 240 | */ |
| 241 | const char zDefaultFooter[] = |
| 242 | @ <div class="footer"> |
| 243 | @ Fossil version $manifest_version $manifest_date |
| 244 | @ </div> |
| 245 | @ </body></html> |
| 246 | ; |
| 247 | |
| 248 | /* |
| 249 | ** The default Cascading Style Sheet. |
| 250 | */ |
| 251 | const char zDefaultCSS[] = |
| 252 | @ /* General settings for the entire page */ |
| 253 | @ body { |
| 254 | @ margin: 0ex 1ex; |
| 255 | @ padding: 0px; |
| 256 | @ background-color: white; |
| @@ -364,11 +364,11 @@ | |
| 364 | @ /* Make the links in the footer less ugly... */ |
| 365 | @ div.footer a { color: white; } |
| 366 | @ div.footer a:link { color: white; } |
| 367 | @ div.footer a:visited { color: white; } |
| 368 | @ div.footer a:hover { background-color: white; color: #558195; } |
| 369 | @ |
| 370 | @ /* <verbatim> blocks */ |
| 371 | @ pre.verbatim { |
| 372 | @ background-color: #f5f5f5; |
| 373 | @ padding: 0.5em; |
| 374 | @} |
| @@ -391,11 +391,11 @@ | |
| 391 | @ } |
| 392 | @ |
| 393 | @ div.miniform { |
| 394 | @ font-size: smaller; |
| 395 | @ margin: 8px; |
| 396 | @ } |
| 397 | @ |
| 398 | @ table.fossil_db_generic_query_view { |
| 399 | @ border-spacing: 0px; |
| 400 | @ border: 1px solid black; |
| 401 | @ } |
| @@ -413,10 +413,31 @@ | |
| 413 | @ table.fossil_db_generic_query_view tr.header { |
| 414 | @ background: #558195; |
| 415 | @ font-size: 1.5em; |
| 416 | @ color: #ffffff; |
| 417 | @ } |
| 418 | ; |
| 419 | |
| 420 | /* |
| 421 | ** WEBPAGE: style.css |
| 422 | */ |
| 423 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -80,19 +80,19 @@ | |
| 80 | ** Draw the header. |
| 81 | */ |
| 82 | void style_header(const char *zTitleFormat, ...){ |
| 83 | va_list ap; |
| 84 | char *zTitle; |
| 85 | const char *zHeader = db_get("header", (char*)zDefaultHeader); |
| 86 | login_check_credentials(); |
| 87 | |
| 88 | va_start(ap, zTitleFormat); |
| 89 | zTitle = vmprintf(zTitleFormat, ap); |
| 90 | va_end(ap); |
| 91 | |
| 92 | cgi_destination(CGI_HEADER); |
| 93 | |
| 94 | if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1); |
| 95 | |
| 96 | /* Generate the header up through the main menu */ |
| 97 | Th_Store("project_name", db_get("project-name","Unnamed Fossil Project")); |
| 98 | Th_Store("title", zTitle); |
| @@ -118,11 +118,11 @@ | |
| 118 | */ |
| 119 | void style_footer(void){ |
| 120 | const char *zFooter; |
| 121 | |
| 122 | if( !headerHasBeenGenerated ) return; |
| 123 | |
| 124 | /* Go back and put the submenu at the top of the page. We delay the |
| 125 | ** creation of the submenu until the end so that we can add elements |
| 126 | ** to the submenu while generating page text. |
| 127 | */ |
| 128 | cgi_destination(CGI_HEADER); |
| @@ -148,11 +148,11 @@ | |
| 148 | @ </div> |
| 149 | zFooter = db_get("footer", (char*)zDefaultFooter); |
| 150 | if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1); |
| 151 | Th_Render(zFooter); |
| 152 | if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1); |
| 153 | |
| 154 | /* Render trace log if TH1 tracing is enabled. */ |
| 155 | if( g.thTrace ){ |
| 156 | cgi_append_content("<font color=\"red\"><hr>\n", -1); |
| 157 | cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog)); |
| 158 | cgi_append_content("</font>\n", -1); |
| @@ -179,11 +179,11 @@ | |
| 179 | |
| 180 | /* @-comment: // */ |
| 181 | /* |
| 182 | ** The default page header. |
| 183 | */ |
| 184 | const char zDefaultHeader[] = |
| 185 | @ <html> |
| 186 | @ <head> |
| 187 | @ <title>$<project_name>: $<title></title> |
| 188 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" |
| 189 | @ href="$baseurl/timeline.rss"> |
| @@ -236,21 +236,21 @@ | |
| 236 | ; |
| 237 | |
| 238 | /* |
| 239 | ** The default page footer |
| 240 | */ |
| 241 | const char zDefaultFooter[] = |
| 242 | @ <div class="footer"> |
| 243 | @ Fossil version $manifest_version $manifest_date |
| 244 | @ </div> |
| 245 | @ </body></html> |
| 246 | ; |
| 247 | |
| 248 | /* |
| 249 | ** The default Cascading Style Sheet. |
| 250 | */ |
| 251 | const char zDefaultCSS[] = |
| 252 | @ /* General settings for the entire page */ |
| 253 | @ body { |
| 254 | @ margin: 0ex 1ex; |
| 255 | @ padding: 0px; |
| 256 | @ background-color: white; |
| @@ -364,11 +364,11 @@ | |
| 364 | @ /* Make the links in the footer less ugly... */ |
| 365 | @ div.footer a { color: white; } |
| 366 | @ div.footer a:link { color: white; } |
| 367 | @ div.footer a:visited { color: white; } |
| 368 | @ div.footer a:hover { background-color: white; color: #558195; } |
| 369 | @ |
| 370 | @ /* <verbatim> blocks */ |
| 371 | @ pre.verbatim { |
| 372 | @ background-color: #f5f5f5; |
| 373 | @ padding: 0.5em; |
| 374 | @} |
| @@ -391,11 +391,11 @@ | |
| 391 | @ } |
| 392 | @ |
| 393 | @ div.miniform { |
| 394 | @ font-size: smaller; |
| 395 | @ margin: 8px; |
| 396 | @ } |
| 397 | @ |
| 398 | @ table.fossil_db_generic_query_view { |
| 399 | @ border-spacing: 0px; |
| 400 | @ border: 1px solid black; |
| 401 | @ } |
| @@ -413,10 +413,31 @@ | |
| 413 | @ table.fossil_db_generic_query_view tr.header { |
| 414 | @ background: #558195; |
| 415 | @ font-size: 1.5em; |
| 416 | @ color: #ffffff; |
| 417 | @ } |
| 418 | @ .creoletable { |
| 419 | @ border: 1px solid #666666; |
| 420 | @ border-spacing: 0; |
| 421 | @ margin: 1.5em 2em 1.8em 2em; |
| 422 | @ } |
| 423 | @ .creoletable * tr th { |
| 424 | @ font-size: 100%; |
| 425 | @ padding: .5em .7em .5em .7em; |
| 426 | @ border-left: 1px solid #666666; |
| 427 | @ background-color: #558195; |
| 428 | @ vertical-align: bottom; |
| 429 | @ color: white; |
| 430 | @ empty-cells: show; |
| 431 | @ } |
| 432 | @ .creoletable * tr td { |
| 433 | @ padding: .4em .7em .45em .7em; |
| 434 | @ border-left: 1px solid #D9D9D9; |
| 435 | @ border-top: 1px solid #D9D9D9; |
| 436 | @ vertical-align: center; |
| 437 | @ empty-cells: show; |
| 438 | @ } |
| 439 | ; |
| 440 | |
| 441 | /* |
| 442 | ** WEBPAGE: style.css |
| 443 | */ |
| 444 |