Fossil SCM
Enable markdown by default. Render as markdown any document that ends with either "md" or "markdown".
Commit
02f312e698ee699cf66e8fc229d9aa1f866d2f78
Parent
fc413110eb990d2…
11 files changed
+1
-3
-3
+2
-4
-4
-18
-4
-4
-2
+25
-10
-8
M
auto.def
+1
-3
| --- auto.def | ||
| +++ auto.def | ||
| @@ -11,11 +11,10 @@ | ||
| 11 | 11 | internal-sqlite=1 => {Don't use the internal sqlite, use the system one} |
| 12 | 12 | static=0 => {Link a static executable} |
| 13 | 13 | lineedit=1 => {Disable line editing} |
| 14 | 14 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 15 | 15 | json=0 => {Build with fossil JSON API enabled} |
| 16 | - markdown=0 => {Build with markdown engine enabled} | |
| 17 | 16 | } |
| 18 | 17 | |
| 19 | 18 | # sqlite wants these types if possible |
| 20 | 19 | cc-with {-includes {stdint.h inttypes.h}} { |
| 21 | 20 | cc-check-types uint32_t uint16_t int16_t uint8_t |
| @@ -76,12 +75,11 @@ | ||
| 76 | 75 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON |
| 77 | 76 | define FOSSIL_ENABLE_JSON |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | if {[opt-bool markdown]} { |
| 81 | - define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_MARKDOWN | |
| 82 | - define FOSSIL_ENABLE_MARKDOWN | |
| 80 | + # no-op. Markdown is now enabled by default. | |
| 83 | 81 | } |
| 84 | 82 | |
| 85 | 83 | if {[opt-bool static]} { |
| 86 | 84 | # XXX: This will not work on all systems. |
| 87 | 85 | define-append EXTRA_LDFLAGS -static |
| 88 | 86 |
| --- auto.def | |
| +++ auto.def | |
| @@ -11,11 +11,10 @@ | |
| 11 | internal-sqlite=1 => {Don't use the internal sqlite, use the system one} |
| 12 | static=0 => {Link a static executable} |
| 13 | lineedit=1 => {Disable line editing} |
| 14 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 15 | json=0 => {Build with fossil JSON API enabled} |
| 16 | markdown=0 => {Build with markdown engine enabled} |
| 17 | } |
| 18 | |
| 19 | # sqlite wants these types if possible |
| 20 | cc-with {-includes {stdint.h inttypes.h}} { |
| 21 | cc-check-types uint32_t uint16_t int16_t uint8_t |
| @@ -76,12 +75,11 @@ | |
| 76 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON |
| 77 | define FOSSIL_ENABLE_JSON |
| 78 | } |
| 79 | |
| 80 | if {[opt-bool markdown]} { |
| 81 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_MARKDOWN |
| 82 | define FOSSIL_ENABLE_MARKDOWN |
| 83 | } |
| 84 | |
| 85 | if {[opt-bool static]} { |
| 86 | # XXX: This will not work on all systems. |
| 87 | define-append EXTRA_LDFLAGS -static |
| 88 |
| --- auto.def | |
| +++ auto.def | |
| @@ -11,11 +11,10 @@ | |
| 11 | internal-sqlite=1 => {Don't use the internal sqlite, use the system one} |
| 12 | static=0 => {Link a static executable} |
| 13 | lineedit=1 => {Disable line editing} |
| 14 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 15 | json=0 => {Build with fossil JSON API enabled} |
| 16 | } |
| 17 | |
| 18 | # sqlite wants these types if possible |
| 19 | cc-with {-includes {stdint.h inttypes.h}} { |
| 20 | cc-check-types uint32_t uint16_t int16_t uint8_t |
| @@ -76,12 +75,11 @@ | |
| 75 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON |
| 76 | define FOSSIL_ENABLE_JSON |
| 77 | } |
| 78 | |
| 79 | if {[opt-bool markdown]} { |
| 80 | # no-op. Markdown is now enabled by default. |
| 81 | } |
| 82 | |
| 83 | if {[opt-bool static]} { |
| 84 | # XXX: This will not work on all systems. |
| 85 | define-append EXTRA_LDFLAGS -static |
| 86 |
M
src/db.c
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2104,13 +2104,10 @@ | ||
| 2104 | 2104 | { "https-login", 0, 0, 0, "off" }, |
| 2105 | 2105 | { "ignore-glob", 0, 40, 1, "" }, |
| 2106 | 2106 | { "localauth", 0, 0, 0, "off" }, |
| 2107 | 2107 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2108 | 2108 | { "manifest", 0, 0, 1, "off" }, |
| 2109 | -#ifdef FOSSIL_ENABLE_MARKDOWN | |
| 2110 | - { "markdown", 0, 0, 0, "off" }, | |
| 2111 | -#endif | |
| 2112 | 2109 | { "max-upload", 0, 25, 0, "250000" }, |
| 2113 | 2110 | { "mtime-changes", 0, 0, 0, "on" }, |
| 2114 | 2111 | { "pgp-command", 0, 40, 0, "gpg --clearsign -o " }, |
| 2115 | 2112 | { "proxy", 0, 32, 0, "off" }, |
| 2116 | 2113 | { "relative-paths",0, 0, 0, "on" }, |
| 2117 | 2114 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2104,13 +2104,10 @@ | |
| 2104 | { "https-login", 0, 0, 0, "off" }, |
| 2105 | { "ignore-glob", 0, 40, 1, "" }, |
| 2106 | { "localauth", 0, 0, 0, "off" }, |
| 2107 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2108 | { "manifest", 0, 0, 1, "off" }, |
| 2109 | #ifdef FOSSIL_ENABLE_MARKDOWN |
| 2110 | { "markdown", 0, 0, 0, "off" }, |
| 2111 | #endif |
| 2112 | { "max-upload", 0, 25, 0, "250000" }, |
| 2113 | { "mtime-changes", 0, 0, 0, "on" }, |
| 2114 | { "pgp-command", 0, 40, 0, "gpg --clearsign -o " }, |
| 2115 | { "proxy", 0, 32, 0, "off" }, |
| 2116 | { "relative-paths",0, 0, 0, "on" }, |
| 2117 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2104,13 +2104,10 @@ | |
| 2104 | { "https-login", 0, 0, 0, "off" }, |
| 2105 | { "ignore-glob", 0, 40, 1, "" }, |
| 2106 | { "localauth", 0, 0, 0, "off" }, |
| 2107 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2108 | { "manifest", 0, 0, 1, "off" }, |
| 2109 | { "max-upload", 0, 25, 0, "250000" }, |
| 2110 | { "mtime-changes", 0, 0, 0, "on" }, |
| 2111 | { "pgp-command", 0, 40, 0, "gpg --clearsign -o " }, |
| 2112 | { "proxy", 0, 32, 0, "off" }, |
| 2113 | { "relative-paths",0, 0, 0, "on" }, |
| 2114 |
+2
-4
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -169,10 +169,11 @@ | ||
| 169 | 169 | { "lzh", 3, "application/octet-stream" }, |
| 170 | 170 | { "m", 1, "text/plain" }, |
| 171 | 171 | { "m3u", 3, "audio/x-mpegurl" }, |
| 172 | 172 | { "man", 3, "application/x-troff-man" }, |
| 173 | 173 | { "markdown", 8, "text/x-markdown" }, |
| 174 | + { "md", 2, "text/x-markdown" }, | |
| 174 | 175 | { "me", 2, "application/x-troff-me" }, |
| 175 | 176 | { "mesh", 4, "model/mesh" }, |
| 176 | 177 | { "mid", 3, "audio/midi" }, |
| 177 | 178 | { "midi", 4, "audio/midi" }, |
| 178 | 179 | { "mif", 3, "application/x-mif" }, |
| @@ -504,13 +505,11 @@ | ||
| 504 | 505 | }else{ |
| 505 | 506 | style_header("Documentation"); |
| 506 | 507 | wiki_convert(&filebody, 0, WIKI_BUTTONS); |
| 507 | 508 | } |
| 508 | 509 | style_footer(); |
| 509 | -#ifdef FOSSIL_ENABLE_MARKDOWN | |
| 510 | - }else if( fossil_strcmp(zMime, "text/x-markdown")==0 | |
| 511 | - && db_get_boolean("markdown", 0) ){ | |
| 510 | + }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){ | |
| 512 | 511 | Blob title = BLOB_INITIALIZER; |
| 513 | 512 | Blob tail = BLOB_INITIALIZER; |
| 514 | 513 | markdown_to_html(&filebody, &title, &tail); |
| 515 | 514 | if( blob_size(&title)>0 ){ |
| 516 | 515 | style_header(blob_str(&title)); |
| @@ -517,11 +516,10 @@ | ||
| 517 | 516 | }else{ |
| 518 | 517 | style_header("Documentation"); |
| 519 | 518 | } |
| 520 | 519 | blob_append(cgi_output_blob(), blob_buffer(&tail), blob_size(&tail)); |
| 521 | 520 | style_footer(); |
| 522 | -#endif | |
| 523 | 521 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| 524 | 522 | style_header("Documentation"); |
| 525 | 523 | @ <blockquote><pre> |
| 526 | 524 | @ %h(blob_str(&filebody)) |
| 527 | 525 | @ </pre></blockquote> |
| 528 | 526 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -169,10 +169,11 @@ | |
| 169 | { "lzh", 3, "application/octet-stream" }, |
| 170 | { "m", 1, "text/plain" }, |
| 171 | { "m3u", 3, "audio/x-mpegurl" }, |
| 172 | { "man", 3, "application/x-troff-man" }, |
| 173 | { "markdown", 8, "text/x-markdown" }, |
| 174 | { "me", 2, "application/x-troff-me" }, |
| 175 | { "mesh", 4, "model/mesh" }, |
| 176 | { "mid", 3, "audio/midi" }, |
| 177 | { "midi", 4, "audio/midi" }, |
| 178 | { "mif", 3, "application/x-mif" }, |
| @@ -504,13 +505,11 @@ | |
| 504 | }else{ |
| 505 | style_header("Documentation"); |
| 506 | wiki_convert(&filebody, 0, WIKI_BUTTONS); |
| 507 | } |
| 508 | style_footer(); |
| 509 | #ifdef FOSSIL_ENABLE_MARKDOWN |
| 510 | }else if( fossil_strcmp(zMime, "text/x-markdown")==0 |
| 511 | && db_get_boolean("markdown", 0) ){ |
| 512 | Blob title = BLOB_INITIALIZER; |
| 513 | Blob tail = BLOB_INITIALIZER; |
| 514 | markdown_to_html(&filebody, &title, &tail); |
| 515 | if( blob_size(&title)>0 ){ |
| 516 | style_header(blob_str(&title)); |
| @@ -517,11 +516,10 @@ | |
| 517 | }else{ |
| 518 | style_header("Documentation"); |
| 519 | } |
| 520 | blob_append(cgi_output_blob(), blob_buffer(&tail), blob_size(&tail)); |
| 521 | style_footer(); |
| 522 | #endif |
| 523 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| 524 | style_header("Documentation"); |
| 525 | @ <blockquote><pre> |
| 526 | @ %h(blob_str(&filebody)) |
| 527 | @ </pre></blockquote> |
| 528 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -169,10 +169,11 @@ | |
| 169 | { "lzh", 3, "application/octet-stream" }, |
| 170 | { "m", 1, "text/plain" }, |
| 171 | { "m3u", 3, "audio/x-mpegurl" }, |
| 172 | { "man", 3, "application/x-troff-man" }, |
| 173 | { "markdown", 8, "text/x-markdown" }, |
| 174 | { "md", 2, "text/x-markdown" }, |
| 175 | { "me", 2, "application/x-troff-me" }, |
| 176 | { "mesh", 4, "model/mesh" }, |
| 177 | { "mid", 3, "audio/midi" }, |
| 178 | { "midi", 4, "audio/midi" }, |
| 179 | { "mif", 3, "application/x-mif" }, |
| @@ -504,13 +505,11 @@ | |
| 505 | }else{ |
| 506 | style_header("Documentation"); |
| 507 | wiki_convert(&filebody, 0, WIKI_BUTTONS); |
| 508 | } |
| 509 | style_footer(); |
| 510 | }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){ |
| 511 | Blob title = BLOB_INITIALIZER; |
| 512 | Blob tail = BLOB_INITIALIZER; |
| 513 | markdown_to_html(&filebody, &title, &tail); |
| 514 | if( blob_size(&title)>0 ){ |
| 515 | style_header(blob_str(&title)); |
| @@ -517,11 +516,10 @@ | |
| 516 | }else{ |
| 517 | style_header("Documentation"); |
| 518 | } |
| 519 | blob_append(cgi_output_blob(), blob_buffer(&tail), blob_size(&tail)); |
| 520 | style_footer(); |
| 521 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| 522 | style_header("Documentation"); |
| 523 | @ <blockquote><pre> |
| 524 | @ %h(blob_str(&filebody)) |
| 525 | @ </pre></blockquote> |
| 526 |
-4
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -780,14 +780,10 @@ | ||
| 780 | 780 | #endif |
| 781 | 781 | #if defined(FOSSIL_ENABLE_JSON) |
| 782 | 782 | ++count; |
| 783 | 783 | fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION); |
| 784 | 784 | #endif |
| 785 | -#if defined(FOSSIL_ENABLE_MARKDOWN) | |
| 786 | - ++count; | |
| 787 | - fossil_print("\tMARKDOWN\n"); | |
| 788 | -#endif | |
| 789 | 785 | if( !count ){ |
| 790 | 786 | fossil_print("\tNo optional features were enabled.\n"); |
| 791 | 787 | } |
| 792 | 788 | } |
| 793 | 789 | } |
| 794 | 790 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -780,14 +780,10 @@ | |
| 780 | #endif |
| 781 | #if defined(FOSSIL_ENABLE_JSON) |
| 782 | ++count; |
| 783 | fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION); |
| 784 | #endif |
| 785 | #if defined(FOSSIL_ENABLE_MARKDOWN) |
| 786 | ++count; |
| 787 | fossil_print("\tMARKDOWN\n"); |
| 788 | #endif |
| 789 | if( !count ){ |
| 790 | fossil_print("\tNo optional features were enabled.\n"); |
| 791 | } |
| 792 | } |
| 793 | } |
| 794 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -780,14 +780,10 @@ | |
| 780 | #endif |
| 781 | #if defined(FOSSIL_ENABLE_JSON) |
| 782 | ++count; |
| 783 | fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION); |
| 784 | #endif |
| 785 | if( !count ){ |
| 786 | fossil_print("\tNo optional features were enabled.\n"); |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 |
-18
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -380,14 +380,10 @@ | ||
| 380 | 380 | |
| 381 | 381 | #### Enable JSON (http://www.json.org) support using "cson" |
| 382 | 382 | # |
| 383 | 383 | # FOSSIL_ENABLE_JSON = 1 |
| 384 | 384 | |
| 385 | -#### Enable markdown support | |
| 386 | -# | |
| 387 | -# FOSSIL_ENABLE_MARKDOWN = 1 | |
| 388 | - | |
| 389 | 385 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 390 | 386 | # |
| 391 | 387 | # FOSSIL_ENABLE_SSL = 1 |
| 392 | 388 | |
| 393 | 389 | #### Enable scripting support via Tcl/Tk |
| @@ -525,16 +521,10 @@ | ||
| 525 | 521 | ifdef FOSSIL_ENABLE_JSON |
| 526 | 522 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 527 | 523 | RCC += -DFOSSIL_ENABLE_JSON=1 |
| 528 | 524 | endif |
| 529 | 525 | |
| 530 | -# With markdown support | |
| 531 | -ifdef FOSSIL_ENABLE_MARKDOWN | |
| 532 | -TCC += -DFOSSIL_ENABLE_MARKDOWN=1 | |
| 533 | -RCC += -DFOSSIL_ENABLE_MARKDOWN=1 | |
| 534 | -endif | |
| 535 | - | |
| 536 | 526 | #### We add the -static option here so that we can build a static |
| 537 | 527 | # executable that will run in a chroot jail. |
| 538 | 528 | # |
| 539 | 529 | LIB = -static |
| 540 | 530 | |
| @@ -966,13 +956,10 @@ | ||
| 966 | 956 | ZLIB = zlib.lib |
| 967 | 957 | |
| 968 | 958 | # Uncomment to enable JSON API |
| 969 | 959 | # FOSSIL_ENABLE_JSON = 1 |
| 970 | 960 | |
| 971 | -# Uncomment to enable markdown support | |
| 972 | -# FOSSIL_ENABLE_MARKDOWN = 1 | |
| 973 | - | |
| 974 | 961 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 975 | 962 | |
| 976 | 963 | CFLAGS = -nologo -MT -O2 |
| 977 | 964 | BCC = $(CC) $(CFLAGS) |
| 978 | 965 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| @@ -982,15 +969,10 @@ | ||
| 982 | 969 | |
| 983 | 970 | !ifdef FOSSIL_ENABLE_JSON |
| 984 | 971 | TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 985 | 972 | RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 986 | 973 | !endif |
| 987 | - | |
| 988 | -!ifdef FOSSIL_ENABLE_MARKDOWN | |
| 989 | -TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN | |
| 990 | -RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN | |
| 991 | -!endif | |
| 992 | 974 | } |
| 993 | 975 | regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS |
| 994 | 976 | set j " \\\n " |
| 995 | 977 | writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" |
| 996 | 978 | writeln -nonewline "SRC = " |
| 997 | 979 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -380,14 +380,10 @@ | |
| 380 | |
| 381 | #### Enable JSON (http://www.json.org) support using "cson" |
| 382 | # |
| 383 | # FOSSIL_ENABLE_JSON = 1 |
| 384 | |
| 385 | #### Enable markdown support |
| 386 | # |
| 387 | # FOSSIL_ENABLE_MARKDOWN = 1 |
| 388 | |
| 389 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 390 | # |
| 391 | # FOSSIL_ENABLE_SSL = 1 |
| 392 | |
| 393 | #### Enable scripting support via Tcl/Tk |
| @@ -525,16 +521,10 @@ | |
| 525 | ifdef FOSSIL_ENABLE_JSON |
| 526 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 527 | RCC += -DFOSSIL_ENABLE_JSON=1 |
| 528 | endif |
| 529 | |
| 530 | # With markdown support |
| 531 | ifdef FOSSIL_ENABLE_MARKDOWN |
| 532 | TCC += -DFOSSIL_ENABLE_MARKDOWN=1 |
| 533 | RCC += -DFOSSIL_ENABLE_MARKDOWN=1 |
| 534 | endif |
| 535 | |
| 536 | #### We add the -static option here so that we can build a static |
| 537 | # executable that will run in a chroot jail. |
| 538 | # |
| 539 | LIB = -static |
| 540 | |
| @@ -966,13 +956,10 @@ | |
| 966 | ZLIB = zlib.lib |
| 967 | |
| 968 | # Uncomment to enable JSON API |
| 969 | # FOSSIL_ENABLE_JSON = 1 |
| 970 | |
| 971 | # Uncomment to enable markdown support |
| 972 | # FOSSIL_ENABLE_MARKDOWN = 1 |
| 973 | |
| 974 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 975 | |
| 976 | CFLAGS = -nologo -MT -O2 |
| 977 | BCC = $(CC) $(CFLAGS) |
| 978 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| @@ -982,15 +969,10 @@ | |
| 982 | |
| 983 | !ifdef FOSSIL_ENABLE_JSON |
| 984 | TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 985 | RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 986 | !endif |
| 987 | |
| 988 | !ifdef FOSSIL_ENABLE_MARKDOWN |
| 989 | TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN |
| 990 | RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN |
| 991 | !endif |
| 992 | } |
| 993 | regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS |
| 994 | set j " \\\n " |
| 995 | writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" |
| 996 | writeln -nonewline "SRC = " |
| 997 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -380,14 +380,10 @@ | |
| 380 | |
| 381 | #### Enable JSON (http://www.json.org) support using "cson" |
| 382 | # |
| 383 | # FOSSIL_ENABLE_JSON = 1 |
| 384 | |
| 385 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 386 | # |
| 387 | # FOSSIL_ENABLE_SSL = 1 |
| 388 | |
| 389 | #### Enable scripting support via Tcl/Tk |
| @@ -525,16 +521,10 @@ | |
| 521 | ifdef FOSSIL_ENABLE_JSON |
| 522 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 523 | RCC += -DFOSSIL_ENABLE_JSON=1 |
| 524 | endif |
| 525 | |
| 526 | #### We add the -static option here so that we can build a static |
| 527 | # executable that will run in a chroot jail. |
| 528 | # |
| 529 | LIB = -static |
| 530 | |
| @@ -966,13 +956,10 @@ | |
| 956 | ZLIB = zlib.lib |
| 957 | |
| 958 | # Uncomment to enable JSON API |
| 959 | # FOSSIL_ENABLE_JSON = 1 |
| 960 | |
| 961 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 962 | |
| 963 | CFLAGS = -nologo -MT -O2 |
| 964 | BCC = $(CC) $(CFLAGS) |
| 965 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| @@ -982,15 +969,10 @@ | |
| 969 | |
| 970 | !ifdef FOSSIL_ENABLE_JSON |
| 971 | TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 972 | RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 973 | !endif |
| 974 | } |
| 975 | regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS |
| 976 | set j " \\\n " |
| 977 | writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" |
| 978 | writeln -nonewline "SRC = " |
| 979 |
-4
| --- src/markdown.c | ||
| +++ src/markdown.c | ||
| @@ -17,12 +17,10 @@ | ||
| 17 | 17 | ** |
| 18 | 18 | ** This file contains code to parse a blob containing markdown text, |
| 19 | 19 | ** using an external renderer. |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -#ifdef FOSSIL_ENABLE_MARKDOWN | |
| 23 | - | |
| 24 | 22 | #include "config.h" |
| 25 | 23 | #include "markdown.h" |
| 26 | 24 | |
| 27 | 25 | #include <assert.h> |
| 28 | 26 | #include <string.h> |
| @@ -2238,7 +2236,5 @@ | ||
| 2238 | 2236 | } |
| 2239 | 2237 | blob_zero(&rndr.refs); |
| 2240 | 2238 | blobarray_zero(rndr.work, rndr.make.max_work_stack); |
| 2241 | 2239 | fossil_free(rndr.work); |
| 2242 | 2240 | } |
| 2243 | - | |
| 2244 | -#endif /* def FOSSIL_ENABLE_MARKDOWN */ | |
| 2245 | 2241 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -17,12 +17,10 @@ | |
| 17 | ** |
| 18 | ** This file contains code to parse a blob containing markdown text, |
| 19 | ** using an external renderer. |
| 20 | */ |
| 21 | |
| 22 | #ifdef FOSSIL_ENABLE_MARKDOWN |
| 23 | |
| 24 | #include "config.h" |
| 25 | #include "markdown.h" |
| 26 | |
| 27 | #include <assert.h> |
| 28 | #include <string.h> |
| @@ -2238,7 +2236,5 @@ | |
| 2238 | } |
| 2239 | blob_zero(&rndr.refs); |
| 2240 | blobarray_zero(rndr.work, rndr.make.max_work_stack); |
| 2241 | fossil_free(rndr.work); |
| 2242 | } |
| 2243 | |
| 2244 | #endif /* def FOSSIL_ENABLE_MARKDOWN */ |
| 2245 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -17,12 +17,10 @@ | |
| 17 | ** |
| 18 | ** This file contains code to parse a blob containing markdown text, |
| 19 | ** using an external renderer. |
| 20 | */ |
| 21 | |
| 22 | #include "config.h" |
| 23 | #include "markdown.h" |
| 24 | |
| 25 | #include <assert.h> |
| 26 | #include <string.h> |
| @@ -2238,7 +2236,5 @@ | |
| 2236 | } |
| 2237 | blob_zero(&rndr.refs); |
| 2238 | blobarray_zero(rndr.work, rndr.make.max_work_stack); |
| 2239 | fossil_free(rndr.work); |
| 2240 | } |
| 2241 |
-4
| --- src/markdown_html.c | ||
| +++ src/markdown_html.c | ||
| @@ -17,12 +17,10 @@ | ||
| 17 | 17 | ** |
| 18 | 18 | ** This file contains callbacks for the markdown parser that generate |
| 19 | 19 | ** XHTML output. |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -#ifdef FOSSIL_ENABLE_MARKDOWN | |
| 23 | - | |
| 24 | 22 | #include "config.h" |
| 25 | 23 | #include "markdown_html.h" |
| 26 | 24 | |
| 27 | 25 | #if INTERFACE |
| 28 | 26 | |
| @@ -405,7 +403,5 @@ | ||
| 405 | 403 | }; |
| 406 | 404 | blob_reset(output_title); |
| 407 | 405 | blob_reset(output_body); |
| 408 | 406 | markdown(output_body, input_markdown, &html_renderer); |
| 409 | 407 | } |
| 410 | - | |
| 411 | -#endif /* def FOSSIL_ENABLE_MARKDOWN */ | |
| 412 | 408 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -17,12 +17,10 @@ | |
| 17 | ** |
| 18 | ** This file contains callbacks for the markdown parser that generate |
| 19 | ** XHTML output. |
| 20 | */ |
| 21 | |
| 22 | #ifdef FOSSIL_ENABLE_MARKDOWN |
| 23 | |
| 24 | #include "config.h" |
| 25 | #include "markdown_html.h" |
| 26 | |
| 27 | #if INTERFACE |
| 28 | |
| @@ -405,7 +403,5 @@ | |
| 405 | }; |
| 406 | blob_reset(output_title); |
| 407 | blob_reset(output_body); |
| 408 | markdown(output_body, input_markdown, &html_renderer); |
| 409 | } |
| 410 | |
| 411 | #endif /* def FOSSIL_ENABLE_MARKDOWN */ |
| 412 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -17,12 +17,10 @@ | |
| 17 | ** |
| 18 | ** This file contains callbacks for the markdown parser that generate |
| 19 | ** XHTML output. |
| 20 | */ |
| 21 | |
| 22 | #include "config.h" |
| 23 | #include "markdown_html.h" |
| 24 | |
| 25 | #if INTERFACE |
| 26 | |
| @@ -405,7 +403,5 @@ | |
| 403 | }; |
| 404 | blob_reset(output_title); |
| 405 | blob_reset(output_body); |
| 406 | markdown(output_body, input_markdown, &html_renderer); |
| 407 | } |
| 408 |
-2
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -304,15 +304,13 @@ | ||
| 304 | 304 | #if defined(FOSSIL_ENABLE_JSON) |
| 305 | 305 | else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){ |
| 306 | 306 | rc = 1; |
| 307 | 307 | } |
| 308 | 308 | #endif |
| 309 | -#if defined(FOSSIL_ENABLE_MARKDOWN) | |
| 310 | 309 | else if( 0 == fossil_strnicmp( zArg, "markdown", 8 ) ){ |
| 311 | 310 | rc = 1; |
| 312 | 311 | } |
| 313 | -#endif | |
| 314 | 312 | if( g.thTrace ){ |
| 315 | 313 | Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc); |
| 316 | 314 | } |
| 317 | 315 | Th_SetResultInt(interp, rc); |
| 318 | 316 | return TH_OK; |
| 319 | 317 | |
| 320 | 318 | ADDED test/markdown-test1.md |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -304,15 +304,13 @@ | |
| 304 | #if defined(FOSSIL_ENABLE_JSON) |
| 305 | else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){ |
| 306 | rc = 1; |
| 307 | } |
| 308 | #endif |
| 309 | #if defined(FOSSIL_ENABLE_MARKDOWN) |
| 310 | else if( 0 == fossil_strnicmp( zArg, "markdown", 8 ) ){ |
| 311 | rc = 1; |
| 312 | } |
| 313 | #endif |
| 314 | if( g.thTrace ){ |
| 315 | Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc); |
| 316 | } |
| 317 | Th_SetResultInt(interp, rc); |
| 318 | return TH_OK; |
| 319 | |
| 320 | DDED test/markdown-test1.md |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -304,15 +304,13 @@ | |
| 304 | #if defined(FOSSIL_ENABLE_JSON) |
| 305 | else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){ |
| 306 | rc = 1; |
| 307 | } |
| 308 | #endif |
| 309 | else if( 0 == fossil_strnicmp( zArg, "markdown", 8 ) ){ |
| 310 | rc = 1; |
| 311 | } |
| 312 | if( g.thTrace ){ |
| 313 | Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc); |
| 314 | } |
| 315 | Th_SetResultInt(interp, rc); |
| 316 | return TH_OK; |
| 317 | |
| 318 | DDED test/markdown-test1.md |
+25
| --- a/test/markdown-test1.md | ||
| +++ b/test/markdown-test1.md | ||
| @@ -0,0 +1,25 @@ | ||
| 1 | + | |
| 2 | +Markdown Formatter Test Document | |
| 3 | +================================ | |
| 4 | + | |
| 5 | +This document is designed to test the markdown formatter. | |
| 6 | + | |
| 7 | + * A bullet item. | |
| 8 | + * A subitem | |
| 9 | + * Second bullet | |
| 10 | + | |
| 11 | +More text | |
| 12 | + | |
| 13 | + 1. Enumeration | |
| 14 | + 1.1. Subitem 1 | |
| 15 | + 1.2. Subitem 2 | |
| 16 | + 2. Second enumeration. | |
| 17 | + | |
| 18 | +Another paragraph. | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | +Other Features | |
| 23 | +-------------- | |
| 24 | + | |
| 25 | +Text can show *emphasis* or _emphasis_ or **strong emphassis**. |
| --- a/test/markdown-test1.md | |
| +++ b/test/markdown-test1.md | |
| @@ -0,0 +1,25 @@ | |
| --- a/test/markdown-test1.md | |
| +++ b/test/markdown-test1.md | |
| @@ -0,0 +1,25 @@ | |
| 1 | |
| 2 | Markdown Formatter Test Document |
| 3 | ================================ |
| 4 | |
| 5 | This document is designed to test the markdown formatter. |
| 6 | |
| 7 | * A bullet item. |
| 8 | * A subitem |
| 9 | * Second bullet |
| 10 | |
| 11 | More text |
| 12 | |
| 13 | 1. Enumeration |
| 14 | 1.1. Subitem 1 |
| 15 | 1.2. Subitem 2 |
| 16 | 2. Second enumeration. |
| 17 | |
| 18 | Another paragraph. |
| 19 | |
| 20 | |
| 21 | |
| 22 | Other Features |
| 23 | -------------- |
| 24 | |
| 25 | Text can show *emphasis* or _emphasis_ or **strong emphassis**. |
-10
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -44,14 +44,10 @@ | ||
| 44 | 44 | |
| 45 | 45 | #### Enable JSON (http://www.json.org) support using "cson" |
| 46 | 46 | # |
| 47 | 47 | # FOSSIL_ENABLE_JSON = 1 |
| 48 | 48 | |
| 49 | -#### Enable markdown support | |
| 50 | -# | |
| 51 | -# FOSSIL_ENABLE_MARKDOWN = 1 | |
| 52 | - | |
| 53 | 49 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 54 | 50 | # |
| 55 | 51 | # FOSSIL_ENABLE_SSL = 1 |
| 56 | 52 | |
| 57 | 53 | #### Enable scripting support via Tcl/Tk |
| @@ -189,16 +185,10 @@ | ||
| 189 | 185 | ifdef FOSSIL_ENABLE_JSON |
| 190 | 186 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 191 | 187 | RCC += -DFOSSIL_ENABLE_JSON=1 |
| 192 | 188 | endif |
| 193 | 189 | |
| 194 | -# With markdown support | |
| 195 | -ifdef FOSSIL_ENABLE_MARKDOWN | |
| 196 | -TCC += -DFOSSIL_ENABLE_MARKDOWN=1 | |
| 197 | -RCC += -DFOSSIL_ENABLE_MARKDOWN=1 | |
| 198 | -endif | |
| 199 | - | |
| 200 | 190 | #### We add the -static option here so that we can build a static |
| 201 | 191 | # executable that will run in a chroot jail. |
| 202 | 192 | # |
| 203 | 193 | LIB = -static |
| 204 | 194 | |
| 205 | 195 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -44,14 +44,10 @@ | |
| 44 | |
| 45 | #### Enable JSON (http://www.json.org) support using "cson" |
| 46 | # |
| 47 | # FOSSIL_ENABLE_JSON = 1 |
| 48 | |
| 49 | #### Enable markdown support |
| 50 | # |
| 51 | # FOSSIL_ENABLE_MARKDOWN = 1 |
| 52 | |
| 53 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 54 | # |
| 55 | # FOSSIL_ENABLE_SSL = 1 |
| 56 | |
| 57 | #### Enable scripting support via Tcl/Tk |
| @@ -189,16 +185,10 @@ | |
| 189 | ifdef FOSSIL_ENABLE_JSON |
| 190 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 191 | RCC += -DFOSSIL_ENABLE_JSON=1 |
| 192 | endif |
| 193 | |
| 194 | # With markdown support |
| 195 | ifdef FOSSIL_ENABLE_MARKDOWN |
| 196 | TCC += -DFOSSIL_ENABLE_MARKDOWN=1 |
| 197 | RCC += -DFOSSIL_ENABLE_MARKDOWN=1 |
| 198 | endif |
| 199 | |
| 200 | #### We add the -static option here so that we can build a static |
| 201 | # executable that will run in a chroot jail. |
| 202 | # |
| 203 | LIB = -static |
| 204 | |
| 205 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -44,14 +44,10 @@ | |
| 44 | |
| 45 | #### Enable JSON (http://www.json.org) support using "cson" |
| 46 | # |
| 47 | # FOSSIL_ENABLE_JSON = 1 |
| 48 | |
| 49 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 50 | # |
| 51 | # FOSSIL_ENABLE_SSL = 1 |
| 52 | |
| 53 | #### Enable scripting support via Tcl/Tk |
| @@ -189,16 +185,10 @@ | |
| 185 | ifdef FOSSIL_ENABLE_JSON |
| 186 | TCC += -DFOSSIL_ENABLE_JSON=1 |
| 187 | RCC += -DFOSSIL_ENABLE_JSON=1 |
| 188 | endif |
| 189 | |
| 190 | #### We add the -static option here so that we can build a static |
| 191 | # executable that will run in a chroot jail. |
| 192 | # |
| 193 | LIB = -static |
| 194 | |
| 195 |
-8
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -26,13 +26,10 @@ | ||
| 26 | 26 | ZLIB = zlib.lib |
| 27 | 27 | |
| 28 | 28 | # Uncomment to enable JSON API |
| 29 | 29 | # FOSSIL_ENABLE_JSON = 1 |
| 30 | 30 | |
| 31 | -# Uncomment to enable markdown support | |
| 32 | -# FOSSIL_ENABLE_MARKDOWN = 1 | |
| 33 | - | |
| 34 | 31 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 35 | 32 | |
| 36 | 33 | CFLAGS = -nologo -MT -O2 |
| 37 | 34 | BCC = $(CC) $(CFLAGS) |
| 38 | 35 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| @@ -43,15 +40,10 @@ | ||
| 43 | 40 | !ifdef FOSSIL_ENABLE_JSON |
| 44 | 41 | TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 45 | 42 | RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 46 | 43 | !endif |
| 47 | 44 | |
| 48 | -!ifdef FOSSIL_ENABLE_MARKDOWN | |
| 49 | -TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN | |
| 50 | -RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN | |
| 51 | -!endif | |
| 52 | - | |
| 53 | 45 | SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 54 | 46 | /DSQLITE_THREADSAFE=0 \ |
| 55 | 47 | /DSQLITE_DEFAULT_FILE_FORMAT=4 \ |
| 56 | 48 | /DSQLITE_ENABLE_STAT3 \ |
| 57 | 49 | /Dlocaltime=fossil_localtime \ |
| 58 | 50 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -26,13 +26,10 @@ | |
| 26 | ZLIB = zlib.lib |
| 27 | |
| 28 | # Uncomment to enable JSON API |
| 29 | # FOSSIL_ENABLE_JSON = 1 |
| 30 | |
| 31 | # Uncomment to enable markdown support |
| 32 | # FOSSIL_ENABLE_MARKDOWN = 1 |
| 33 | |
| 34 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 35 | |
| 36 | CFLAGS = -nologo -MT -O2 |
| 37 | BCC = $(CC) $(CFLAGS) |
| 38 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| @@ -43,15 +40,10 @@ | |
| 43 | !ifdef FOSSIL_ENABLE_JSON |
| 44 | TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 45 | RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 46 | !endif |
| 47 | |
| 48 | !ifdef FOSSIL_ENABLE_MARKDOWN |
| 49 | TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN |
| 50 | RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN |
| 51 | !endif |
| 52 | |
| 53 | SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 54 | /DSQLITE_THREADSAFE=0 \ |
| 55 | /DSQLITE_DEFAULT_FILE_FORMAT=4 \ |
| 56 | /DSQLITE_ENABLE_STAT3 \ |
| 57 | /Dlocaltime=fossil_localtime \ |
| 58 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -26,13 +26,10 @@ | |
| 26 | ZLIB = zlib.lib |
| 27 | |
| 28 | # Uncomment to enable JSON API |
| 29 | # FOSSIL_ENABLE_JSON = 1 |
| 30 | |
| 31 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 32 | |
| 33 | CFLAGS = -nologo -MT -O2 |
| 34 | BCC = $(CC) $(CFLAGS) |
| 35 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| @@ -43,15 +40,10 @@ | |
| 40 | !ifdef FOSSIL_ENABLE_JSON |
| 41 | TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 42 | RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 43 | !endif |
| 44 | |
| 45 | SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 46 | /DSQLITE_THREADSAFE=0 \ |
| 47 | /DSQLITE_DEFAULT_FILE_FORMAT=4 \ |
| 48 | /DSQLITE_ENABLE_STAT3 \ |
| 49 | /Dlocaltime=fossil_localtime \ |
| 50 |