Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Enable markdown by default. Render as markdown any document that ends with either "md" or "markdown". |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | markdown |
| Files: | files | file ages | folders |
| SHA1: |
02f312e698ee699cf66e8fc229d9aa1f |
| User & Date: | drh 2013-03-29 15:43:59.605 |
Context
|
2013-03-29
| ||
| 16:38 | Add the N-card to control artifacts for wiki, checkins, events, and attachments, which opens up the possibility (not yet implemented) of being able to save wiki text, check-in comments, event text, and attachment descriptions in a variety of formats, such as text/plain, text/html, or text/x-markdown. check-in: 2336a2d86e user: drh tags: markdown | |
| 15:43 | Enable markdown by default. Render as markdown any document that ends with either "md" or "markdown". check-in: 02f312e698 user: drh tags: markdown | |
| 15:05 | Win32: Fossil now understands Cygwin paths containing one or more of the characters <nowiki>"*:<>?|</nowiki>. Those are normally forbidden in win32. This means that the win32 fossil.exe is better usable in a Cygwin environment. See [http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars]. check-in: fc413110eb user: jan.nijtmans tags: trunk | |
Changes
Changes to auto.def.
| ︙ | ︙ | |||
9 10 11 12 13 14 15 |
with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
with-tcl-stubs=0 => {Enable Tcl integration via stubs mechanism}
internal-sqlite=1 => {Don't use the internal sqlite, use the system one}
static=0 => {Link a static executable}
lineedit=1 => {Disable line editing}
fossil-debug=0 => {Build with fossil debugging enabled}
json=0 => {Build with fossil JSON API enabled}
| < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
with-tcl-stubs=0 => {Enable Tcl integration via stubs mechanism}
internal-sqlite=1 => {Don't use the internal sqlite, use the system one}
static=0 => {Link a static executable}
lineedit=1 => {Disable line editing}
fossil-debug=0 => {Build with fossil debugging enabled}
json=0 => {Build with fossil JSON API enabled}
}
# sqlite wants these types if possible
cc-with {-includes {stdint.h inttypes.h}} {
cc-check-types uint32_t uint16_t int16_t uint8_t
}
|
| ︙ | ︙ | |||
74 75 76 77 78 79 80 |
# have #ifdef guards around the whole file without
# reading config.h first.
define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
define FOSSIL_ENABLE_JSON
}
if {[opt-bool markdown]} {
| | < | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# have #ifdef guards around the whole file without
# reading config.h first.
define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
define FOSSIL_ENABLE_JSON
}
if {[opt-bool markdown]} {
# no-op. Markdown is now enabled by default.
}
if {[opt-bool static]} {
# XXX: This will not work on all systems.
define-append EXTRA_LDFLAGS -static
}
|
| ︙ | ︙ |
Changes to src/db.c.
| ︙ | ︙ | |||
2102 2103 2104 2105 2106 2107 2108 |
{ "gmerge-command",0, 40, 0, "" },
{ "http-port", 0, 16, 0, "8080" },
{ "https-login", 0, 0, 0, "off" },
{ "ignore-glob", 0, 40, 1, "" },
{ "localauth", 0, 0, 0, "off" },
{ "main-branch", 0, 40, 0, "trunk" },
{ "manifest", 0, 0, 1, "off" },
| < < < | 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 |
{ "gmerge-command",0, 40, 0, "" },
{ "http-port", 0, 16, 0, "8080" },
{ "https-login", 0, 0, 0, "off" },
{ "ignore-glob", 0, 40, 1, "" },
{ "localauth", 0, 0, 0, "off" },
{ "main-branch", 0, 40, 0, "trunk" },
{ "manifest", 0, 0, 1, "off" },
{ "max-upload", 0, 25, 0, "250000" },
{ "mtime-changes", 0, 0, 0, "on" },
{ "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
{ "proxy", 0, 32, 0, "off" },
{ "relative-paths",0, 0, 0, "on" },
{ "repo-cksum", 0, 0, 0, "on" },
{ "self-register", 0, 0, 0, "off" },
|
| ︙ | ︙ |
Changes to src/doc.c.
| ︙ | ︙ | |||
167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
{ "lha", 3, "application/octet-stream" },
{ "lsp", 3, "application/x-lisp" },
{ "lzh", 3, "application/octet-stream" },
{ "m", 1, "text/plain" },
{ "m3u", 3, "audio/x-mpegurl" },
{ "man", 3, "application/x-troff-man" },
{ "markdown", 8, "text/x-markdown" },
{ "me", 2, "application/x-troff-me" },
{ "mesh", 4, "model/mesh" },
{ "mid", 3, "audio/midi" },
{ "midi", 4, "audio/midi" },
{ "mif", 3, "application/x-mif" },
{ "mime", 4, "www/mime" },
{ "mkd", 3, "text/x-markdown" },
| > | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
{ "lha", 3, "application/octet-stream" },
{ "lsp", 3, "application/x-lisp" },
{ "lzh", 3, "application/octet-stream" },
{ "m", 1, "text/plain" },
{ "m3u", 3, "audio/x-mpegurl" },
{ "man", 3, "application/x-troff-man" },
{ "markdown", 8, "text/x-markdown" },
{ "md", 2, "text/x-markdown" },
{ "me", 2, "application/x-troff-me" },
{ "mesh", 4, "model/mesh" },
{ "mid", 3, "audio/midi" },
{ "midi", 4, "audio/midi" },
{ "mif", 3, "application/x-mif" },
{ "mime", 4, "www/mime" },
{ "mkd", 3, "text/x-markdown" },
|
| ︙ | ︙ | |||
502 503 504 505 506 507 508 |
style_header(blob_str(&title));
wiki_convert(&tail, 0, WIKI_BUTTONS);
}else{
style_header("Documentation");
wiki_convert(&filebody, 0, WIKI_BUTTONS);
}
style_footer();
| < | < < | 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
style_header(blob_str(&title));
wiki_convert(&tail, 0, WIKI_BUTTONS);
}else{
style_header("Documentation");
wiki_convert(&filebody, 0, WIKI_BUTTONS);
}
style_footer();
}else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
Blob title = BLOB_INITIALIZER;
Blob tail = BLOB_INITIALIZER;
markdown_to_html(&filebody, &title, &tail);
if( blob_size(&title)>0 ){
style_header(blob_str(&title));
}else{
style_header("Documentation");
}
blob_append(cgi_output_blob(), blob_buffer(&tail), blob_size(&tail));
style_footer();
}else if( fossil_strcmp(zMime, "text/plain")==0 ){
style_header("Documentation");
@ <blockquote><pre>
@ %h(blob_str(&filebody))
@ </pre></blockquote>
style_footer();
}else{
|
| ︙ | ︙ |
Changes to src/main.c.
| ︙ | ︙ | |||
778 779 780 781 782 783 784 |
++count;
fossil_print("\tTCL_STUBS\n");
#endif
#if defined(FOSSIL_ENABLE_JSON)
++count;
fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION);
#endif
| < < < < | 778 779 780 781 782 783 784 785 786 787 788 789 790 791 |
++count;
fossil_print("\tTCL_STUBS\n");
#endif
#if defined(FOSSIL_ENABLE_JSON)
++count;
fossil_print("\tJSON (API %s)\n", FOSSIL_JSON_API_VERSION);
#endif
if( !count ){
fossil_print("\tNo optional features were enabled.\n");
}
}
}
|
| ︙ | ︙ |
Changes to src/makemake.tcl.
| ︙ | ︙ | |||
378 379 380 381 382 383 384 | # # FOSSIL_ENABLE_SYMBOLS = 1 #### Enable JSON (http://www.json.org) support using "cson" # # FOSSIL_ENABLE_JSON = 1 | < < < < | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | # # FOSSIL_ENABLE_SYMBOLS = 1 #### Enable JSON (http://www.json.org) support using "cson" # # FOSSIL_ENABLE_JSON = 1 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) # # FOSSIL_ENABLE_SSL = 1 #### Enable scripting support via Tcl/Tk # # FOSSIL_ENABLE_TCL = 1 |
| ︙ | ︙ | |||
523 524 525 526 527 528 529 | # With JSON support ifdef FOSSIL_ENABLE_JSON TCC += -DFOSSIL_ENABLE_JSON=1 RCC += -DFOSSIL_ENABLE_JSON=1 endif | < < < < < < | 519 520 521 522 523 524 525 526 527 528 529 530 531 532 | # With JSON support ifdef FOSSIL_ENABLE_JSON TCC += -DFOSSIL_ENABLE_JSON=1 RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static # MinGW: If available, use the Unicode capable runtime startup code. ifndef BROKEN_MINGW_CMDLINE |
| ︙ | ︙ | |||
964 965 966 967 968 969 970 | ZINCDIR = $(B)\compat\zlib ZLIBDIR = $(B)\compat\zlib ZLIB = zlib.lib # Uncomment to enable JSON API # FOSSIL_ENABLE_JSON = 1 | < < < < < < < < | 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 |
ZINCDIR = $(B)\compat\zlib
ZLIBDIR = $(B)\compat\zlib
ZLIB = zlib.lib
# Uncomment to enable JSON API
# FOSSIL_ENABLE_JSON = 1
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
CFLAGS = -nologo -MT -O2
BCC = $(CC) $(CFLAGS)
TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
RCC = rc -D_WIN32 -D_MSC_VER $(INCL)
LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
LIBDIR = -LIBPATH:$(ZLIBDIR)
!ifdef FOSSIL_ENABLE_JSON
TCC = $(TCC) -DFOSSIL_ENABLE_JSON
RCC = $(RCC) -DFOSSIL_ENABLE_JSON
!endif
}
regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
set j " \\\n "
writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n"
writeln -nonewline "SRC = "
set i 0
foreach s [lsort $src] {
|
| ︙ | ︙ |
Changes to src/markdown.c.
| ︙ | ︙ | |||
15 16 17 18 19 20 21 | ** ******************************************************************************* ** ** This file contains code to parse a blob containing markdown text, ** using an external renderer. */ | < < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ** ******************************************************************************* ** ** This file contains code to parse a blob containing markdown text, ** using an external renderer. */ #include "config.h" #include "markdown.h" #include <assert.h> #include <string.h> #include <stdlib.h> |
| ︙ | ︙ | |||
2236 2237 2238 2239 2240 2241 2242 |
blob_zero(&lr[i].link);
blob_zero(&lr[i].title);
}
blob_zero(&rndr.refs);
blobarray_zero(rndr.work, rndr.make.max_work_stack);
fossil_free(rndr.work);
}
| < < | 2234 2235 2236 2237 2238 2239 2240 |
blob_zero(&lr[i].link);
blob_zero(&lr[i].title);
}
blob_zero(&rndr.refs);
blobarray_zero(rndr.work, rndr.make.max_work_stack);
fossil_free(rndr.work);
}
|
Changes to src/markdown_html.c.
| ︙ | ︙ | |||
15 16 17 18 19 20 21 | ** ******************************************************************************* ** ** This file contains callbacks for the markdown parser that generate ** XHTML output. */ | < < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ** ******************************************************************************* ** ** This file contains callbacks for the markdown parser that generate ** XHTML output. */ #include "config.h" #include "markdown_html.h" #if INTERFACE void markdown_to_html( struct Blob *input_markdown, |
| ︙ | ︙ | |||
403 404 405 406 407 408 409 |
"*_", /* emphasis characters */
output_title /* opaque data */
};
blob_reset(output_title);
blob_reset(output_body);
markdown(output_body, input_markdown, &html_renderer);
}
| < < | 401 402 403 404 405 406 407 |
"*_", /* emphasis characters */
output_title /* opaque data */
};
blob_reset(output_title);
blob_reset(output_body);
markdown(output_body, input_markdown, &html_renderer);
}
|
Changes to src/th_main.c.
| ︙ | ︙ | |||
302 303 304 305 306 307 308 |
}
#endif
#if defined(FOSSIL_ENABLE_JSON)
else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){
rc = 1;
}
#endif
| < < | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
}
#endif
#if defined(FOSSIL_ENABLE_JSON)
else if( 0 == fossil_strnicmp( zArg, "json", 4 ) ){
rc = 1;
}
#endif
else if( 0 == fossil_strnicmp( zArg, "markdown", 8 ) ){
rc = 1;
}
if( g.thTrace ){
Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc);
}
Th_SetResultInt(interp, rc);
return TH_OK;
}
|
| ︙ | ︙ |
Added test/markdown-test1.md.
> > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
Markdown Formatter Test Document
================================
This document is designed to test the markdown formatter.
* A bullet item.
* A subitem
* Second bullet
More text
1. Enumeration
1.1. Subitem 1
1.2. Subitem 2
2. Second enumeration.
Another paragraph.
Other Features
--------------
Text can show *emphasis* or _emphasis_ or **strong emphassis**.
|
Changes to win/Makefile.mingw.
| ︙ | ︙ | |||
42 43 44 45 46 47 48 | # # FOSSIL_ENABLE_SYMBOLS = 1 #### Enable JSON (http://www.json.org) support using "cson" # # FOSSIL_ENABLE_JSON = 1 | < < < < | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | # # FOSSIL_ENABLE_SYMBOLS = 1 #### Enable JSON (http://www.json.org) support using "cson" # # FOSSIL_ENABLE_JSON = 1 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) # # FOSSIL_ENABLE_SSL = 1 #### Enable scripting support via Tcl/Tk # # FOSSIL_ENABLE_TCL = 1 |
| ︙ | ︙ | |||
187 188 189 190 191 192 193 | # With JSON support ifdef FOSSIL_ENABLE_JSON TCC += -DFOSSIL_ENABLE_JSON=1 RCC += -DFOSSIL_ENABLE_JSON=1 endif | < < < < < < | 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | # With JSON support ifdef FOSSIL_ENABLE_JSON TCC += -DFOSSIL_ENABLE_JSON=1 RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static # MinGW: If available, use the Unicode capable runtime startup code. ifndef BROKEN_MINGW_CMDLINE |
| ︙ | ︙ |
Changes to win/Makefile.msc.
| ︙ | ︙ | |||
24 25 26 27 28 29 30 | ZINCDIR = $(B)\compat\zlib ZLIBDIR = $(B)\compat\zlib ZLIB = zlib.lib # Uncomment to enable JSON API # FOSSIL_ENABLE_JSON = 1 | < < < < < < < < | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
ZINCDIR = $(B)\compat\zlib
ZLIBDIR = $(B)\compat\zlib
ZLIB = zlib.lib
# Uncomment to enable JSON API
# FOSSIL_ENABLE_JSON = 1
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR)
CFLAGS = -nologo -MT -O2
BCC = $(CC) $(CFLAGS)
TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
RCC = rc -D_WIN32 -D_MSC_VER $(INCL)
LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
LIBDIR = -LIBPATH:$(ZLIBDIR)
!ifdef FOSSIL_ENABLE_JSON
TCC = $(TCC) -DFOSSIL_ENABLE_JSON
RCC = $(RCC) -DFOSSIL_ENABLE_JSON
!endif
SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \
/DSQLITE_THREADSAFE=0 \
/DSQLITE_DEFAULT_FILE_FORMAT=4 \
/DSQLITE_ENABLE_STAT3 \
/Dlocaltime=fossil_localtime \
/DSQLITE_ENABLE_LOCKING_STYLE=0
|
| ︙ | ︙ |