Permalink
Browse files

Updated discount to v2.1.3

  • Loading branch information...
1 parent 9cce6ab commit 83b0b55eb19fab89be96a40576139d8ea8dc21d2 @mugginsoft mugginsoft committed Jan 25, 2012
Showing with 12,330 additions and 981 deletions.
  1. +2 −0 discount-config/config.h
  2. 0 discount-config/update-discount.sh
  3. +35 −0 discount/CREDITS
  4. +61 −0 discount/Csio.c
  5. +41 −0 discount/INSTALL
  6. +139 −0 discount/Makefile.in
  7. +40 −0 discount/Plan9/README
  8. +169 −0 discount/Plan9/markdown.1
  9. +332 −0 discount/Plan9/markdown.2
  10. +543 −0 discount/Plan9/markdown.6
  11. +37 −0 discount/Plan9/mkfile
  12. +1 −1 discount/VERSION
  13. +1 −1 discount/amalloc.c
  14. +43 −0 discount/basename.c
  15. +0 −25 discount/config.h
  16. +1,696 −0 discount/configure.inc
  17. +160 −0 discount/configure.sh
  18. +85 −0 discount/css.c
  19. +17 −8 discount/cstring.h
  20. +13 −7 discount/docheader.c
  21. +7 −2 discount/dumptree.c
  22. +188 −0 discount/emmatch.c
  23. +84 −0 discount/flags.c
  24. +909 −497 discount/generate.c
  25. +22 −0 discount/html5.c
  26. +198 −0 discount/main.c
  27. +45 −0 discount/makepage.1
  28. +86 −0 discount/makepage.c
  29. +171 −0 discount/markdown.1
  30. +137 −0 discount/markdown.3
  31. +1,020 −0 discount/markdown.7
  32. +624 −250 discount/markdown.c
  33. +91 −26 discount/markdown.h
  34. +71 −0 discount/mkd-callbacks.3
  35. +205 −0 discount/mkd-extensions.7
  36. +186 −0 discount/mkd-functions.3
  37. +41 −0 discount/mkd-line.3
  38. +52 −0 discount/mkd2html.1
  39. +184 −0 discount/mkd2html.c
  40. +154 −38 discount/mkdio.c
  41. +0 −65 discount/mkdio.h
  42. +109 −0 discount/mkdio.h.in
  43. +89 −0 discount/mktags.c
  44. +137 −0 discount/pgm_options.c
  45. +9 −0 discount/pgm_options.h
  46. +17 −29 discount/resource.c
  47. +39 −0 discount/setup.c
  48. +91 −0 discount/tags.c
  49. +19 −0 discount/tags.h
  50. +27 −0 discount/tests/autolink.t
  51. +27 −0 discount/tests/automatic.t
  52. +16 −0 discount/tests/backslash.t
  53. +17 −0 discount/tests/callbacks.t
  54. +13 −0 discount/tests/chrome.text
  55. +91 −0 discount/tests/code.t
  56. +29 −0 discount/tests/compat.t
  57. +31 −0 discount/tests/crash.t
  58. +17 −0 discount/tests/defects.t
  59. +49 −0 discount/tests/div.t
  60. +91 −0 discount/tests/dl.t
  61. +9 −0 discount/tests/embedlinks.text
  62. +19 −0 discount/tests/emphasis.t
  63. +35 −0 discount/tests/extrafootnotes.t
  64. +33 −0 discount/tests/flow.t
  65. +16 −0 discount/tests/footnotes.t
  66. +85 −0 discount/tests/functions.sh
  67. +26 −0 discount/tests/header.t
  68. +132 −0 discount/tests/html.t
  69. +17 −0 discount/tests/html5.t
  70. +14 −0 discount/tests/links.text
  71. +130 −0 discount/tests/linkylinky.t
  72. +21 −0 discount/tests/linkypix.t
  73. +155 −0 discount/tests/list.t
  74. +38 −0 discount/tests/list3deep.t
  75. +12 −0 discount/tests/misc.t
  76. +44 −0 discount/tests/pandoc.t
  77. +17 −0 discount/tests/para.t
  78. +12 −0 discount/tests/paranoia.t
  79. +77 −0 discount/tests/peculiarities.t
  80. +20 −0 discount/tests/pseudo.t
  81. +27 −0 discount/tests/reddit.t
  82. +14 −0 discount/tests/reparse.t
  83. +91 −0 discount/tests/schiraldi.t
  84. +25 −0 discount/tests/smarty.t
  85. +29 −0 discount/tests/snakepit.t
  86. +16 −0 discount/tests/strikethrough.t
  87. +34 −0 discount/tests/style.t
  88. +17 −0 discount/tests/superscript.t
  89. +897 −0 discount/tests/syntax.text
  90. +276 −0 discount/tests/tables.t
  91. +48 −0 discount/tests/tabstop.t
  92. +80 −0 discount/tests/toc.t
  93. +18 −0 discount/tests/xml.t
  94. +158 −0 discount/theme.1
  95. +612 −0 discount/theme.c
  96. +81 −29 discount/toc.c
  97. +11 −0 discount/tools/checkbits.sh
  98. +38 −0 discount/tools/cols.c
  99. +24 −0 discount/tools/echo.c
  100. +30 −0 discount/version.c.in
  101. +82 −0 discount/xml.c
  102. +2 −3 discount/xmlpage.c
@@ -4,6 +4,8 @@
#define OS_DARWIN 1
#define USE_DISCOUNT_DL 1
+#define while(x) while( (x) != 0 )
+#define if(x) if( (x) != 0 )
#define DWORD unsigned int
#define WORD unsigned short
#define BYTE unsigned char
View
No changes.
View
@@ -0,0 +1,35 @@
+Discount is primarily my work, but it has only reached the point
+where it is via contributions, critiques, and bug reports from a
+host of other people, some of which are listed before. If your
+name isn't on this list, please remind me
+ -david parsons (orc@pell.chi.il.us)
+
+
+Josh Wood -- Plan9 support.
+Mike Schiraldi -- Reddit style automatic links, MANY MANY MANY
+ bug reports about boundary conditions and
+ places where I didn't get it right.
+Jjgod Jiang -- Table of contents support.
+Petite Abeille -- Many bug reports about places where I didn't
+ get it right.
+Tim Channon -- inspiration for the `mkd_xhtmlpage()` function
+Christian Herenz-- Many bug reports regarding my implementation of
+ `[]()` and `![]()`
+A.S.Bradbury -- Portability bug reports for 64 bit systems.
+Joyent -- Loan of a solaris box so I could get discount
+ working under solaris.
+Ryan Tomayko -- Portability requests (and the rdiscount ruby
+ binding.)
+yidabu -- feedback on the documentation, bug reports
+ against utf-8 support.
+Pierre Joye -- bug reports, php discount binding.
+Masayoshi Sekimura- perl discount binding.
+Jeremy Hinegardner- bug reports about list handling.
+Andrew White -- bug reports about the format of generated urls.
+Steve Huff -- bug reports about Makefile portability (for Fink)
+Ignacio Burgue?o-- bug reports about `>%class%`
+Henrik Nyh -- bug reports about embedded html handling.
+John J. Foerch -- bug reports about incorrect `–` and `—`
+ translations.
+
+
View
@@ -0,0 +1,61 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include "cstring.h"
+#include "markdown.h"
+#include "amalloc.h"
+
+
+/* putc() into a cstring
+ */
+void
+Csputc(int c, Cstring *iot)
+{
+ EXPAND(*iot) = c;
+}
+
+
+/* printf() into a cstring
+ */
+int
+Csprintf(Cstring *iot, char *fmt, ...)
+{
+ va_list ptr;
+ int siz=100;
+
+ do {
+ RESERVE(*iot, siz);
+ va_start(ptr, fmt);
+ siz = vsnprintf(T(*iot)+S(*iot), ALLOCATED(*iot)-S(*iot), fmt, ptr);
+ va_end(ptr);
+ } while ( siz > (ALLOCATED(*iot)-S(*iot)) );
+
+ S(*iot) += siz;
+ return siz;
+}
+
+
+/* write() into a cstring
+ */
+int
+Cswrite(Cstring *iot, char *bfr, int size)
+{
+ RESERVE(*iot, size);
+ memcpy(T(*iot)+S(*iot), bfr, size);
+ S(*iot) += size;
+ return size;
+}
+
+
+/* reparse() into a cstring
+ */
+void
+Csreparse(Cstring *iot, char *buf, int size, int flags)
+{
+ MMIOT f;
+ ___mkd_initmmiot(&f, 0);
+ ___mkd_reparse(buf, size, 0, &f, 0);
+ ___mkd_emblock(&f);
+ SUFFIX(*iot, T(f.out), S(f.out));
+ ___mkd_freemmiot(&f, 0);
+}
View
@@ -0,0 +1,41 @@
+
+ HOW TO BUILD AND INSTALL DISCOUNT
+
+1) Unpacking the distribution
+
+The DISCOUNT sources are distributed in tarballs. After extracting from
+the tarball, you should end up with all the source and build files in the
+directory
+ discount-(version)
+
+2) Installing the distribution
+
+DISCOUNT uses configure.sh to set itself up for compilation. To run
+configure, just do ``./configure.sh'' and it will check your system for
+build dependencies and build makefiles for you. If configure.sh finishes
+without complaint, you can then do a ``make'' to compile everything and a
+``make install'' to install the binaries.
+
+Configure.sh has a few options that can be set:
+
+--src=DIR where the source lives (.)
+--prefix=DIR where to install the final product (/usr/local)
+--execdir=DIR where to put executables (prefix/bin)
+--sbindir=DIR where to put static executables (prefix/sbin)
+--confdir=DIR where to put configuration information (/etc)
+--libdir=DIR where to put libraries (prefix/lib)
+--libexecdir=DIR where to put private executables
+--mandir=DIR where to put manpages
+--enable-dl-tag Use the DL tag extension
+--enable-pandoc-header Use pandoc-style header blocks
+--enable-superscript A^B expands to A<sup>B</sup>
+--enable-amalloc Use a debugging memory allocator (to detect leaks)
+--relaxed-emphasis Don't treat _ in the middle of a word as emphasis
+--with-tabstops=N Set tabstops to N characters (default is 4)
+
+3) Installing sample programs and manpages
+
+The standard ``make install'' rule just installs the binaries. If you
+want to install the sample programs, they are installed with
+``make install.samples''; to install manpages, ``make install.man''.
+A shortcut to install everything is ``make install.everything''
View
@@ -0,0 +1,139 @@
+CC=@CC@ -I.
+LFLAGS=-L.
+CFLAGS=@CFLAGS@
+AR=@AR@
+RANLIB=@RANLIB@
+
+BINDIR=@exedir@
+MANDIR=@mandir@
+LIBDIR=@libdir@
+INCDIR=@prefix@/include
+
+PGMS=markdown
+SAMPLE_PGMS=mkd2html makepage
+@THEME@SAMPLE_PGMS+= theme
+MKDLIB=libmarkdown
+OBJS=mkdio.o markdown.o dumptree.o generate.o \
+ resource.o docheader.o version.o toc.o css.o \
+ xml.o Csio.o xmlpage.o basename.o emmatch.o \
+ setup.o tags.o html5.o flags.o @AMALLOC@
+TESTFRAMEWORK=echo cols
+
+MAN3PAGES=mkd-callbacks.3 mkd-functions.3 markdown.3 mkd-line.3
+
+all: $(PGMS) $(SAMPLE_PGMS) $(TESTFRAMEWORK)
+
+install: $(PGMS) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCDIR)
+ @INSTALL_PROGRAM@ $(PGMS) $(DESTDIR)$(BINDIR)
+ ./librarian.sh install libmarkdown VERSION $(DESTDIR)$(LIBDIR)
+ @INSTALL_DATA@ mkdio.h $(DESTDIR)$(INCDIR)
+
+install.everything: install install.samples install.man
+
+install.samples: $(SAMPLE_PGMS) install $(DESTDIR)$(BINDIR)
+ @INSTALL_PROGRAM@ $(SAMPLE_PGMS) $(DESTDIR)$(BINDIR)
+ @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man1
+ @INSTALL_DATA@ theme.1 makepage.1 mkd2html.1 $(DESTDIR)$(MANDIR)/man1
+
+install.man:
+ @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man3
+ @INSTALL_DATA@ $(MAN3PAGES) $(DESTDIR)$(MANDIR)/man3
+ for x in mkd_line mkd_generateline; do \
+ ( echo '.\"' ; echo ".so man3/mkd-line.3" ) > $(DESTDIR)$(MANDIR)/man3/$$x.3;\
+ done
+ for x in mkd_in mkd_string; do \
+ ( echo '.\"' ; echo ".so man3/markdown.3" ) > $(DESTDIR)$(MANDIR)/man3/$$x.3;\
+ done
+ for x in mkd_compile mkd_css mkd_generatecss mkd_generatehtml mkd_cleanup mkd_doc_title mkd_doc_author mkd_doc_date; do \
+ ( echo '.\"' ; echo ".so man3/mkd-functions.3" ) > $(DESTDIR)$(MANDIR)/man3/$$x.3; \
+ done
+ @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man7
+ @INSTALL_DATA@ markdown.7 mkd-extensions.7 $(DESTDIR)$(MANDIR)/man7
+ @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man1
+ @INSTALL_DATA@ markdown.1 $(DESTDIR)$(MANDIR)/man1
+
+install.everything: install install.man
+
+$(DESTDIR)$(BINDIR):
+ @INSTALL_DIR@ $(DESTDIR)$(BINDIR)
+
+$(DESTDIR)$(INCDIR):
+ @INSTALL_DIR@ $(DESTDIR)$(INCDIR)
+
+$(DESTDIR)$(LIBDIR):
+ @INSTALL_DIR@ $(DESTDIR)$(LIBDIR)
+
+version.o: version.c VERSION
+ $(CC) -DVERSION=\"`cat VERSION`\" -c version.c
+
+VERSION:
+ @true
+
+tags.o: tags.c blocktags
+
+blocktags: mktags
+ ./mktags > blocktags
+
+# example programs
+@THEME@theme: theme.o $(MKDLIB) mkdio.h
+@THEME@ $(CC) $(LFLAGS) -o theme theme.o -lmarkdown @LIBS@
+
+
+mkd2html: mkd2html.o $(MKDLIB) mkdio.h
+ $(CC) $(LFLAGS) -o mkd2html mkd2html.o -lmarkdown @LIBS@
+
+markdown: main.o pgm_options.o $(MKDLIB)
+ $(CC) $(LFLAGS) -o markdown main.o pgm_options.o -lmarkdown @LIBS@
+
+makepage: makepage.c pgm_options.o $(MKDLIB) mkdio.h
+ $(CC) $(LFLAGS) -o makepage makepage.c pgm_options.o -lmarkdown @LIBS@
+
+pgm_options.o: pgm_options.c mkdio.h config.h
+ $(CC) -I. -c pgm_options.c
+
+main.o: main.c mkdio.h config.h
+ $(CC) -I. -c main.c
+
+$(MKDLIB): $(OBJS)
+ ./librarian.sh make $(MKDLIB) VERSION $(OBJS)
+
+verify: echo tools/checkbits.sh
+ @./echo -n "headers ... "; tools/checkbits.sh && echo "GOOD"
+
+test: $(PGMS) $(TESTFRAMEWORK) verify
+ @for x in tests/*.t; do \
+ @LD_LIBRARY_PATH@=`pwd` sh $$x || exit 1; \
+ done
+
+cols: tools/cols.c config.h
+ $(CC) -o cols tools/cols.c
+echo: tools/echo.c config.h
+ $(CC) -o echo tools/echo.c
+
+clean:
+ rm -f $(PGMS) $(TESTFRAMEWORK) $(SAMPLE_PGMS) *.o
+ rm -f $(MKDLIB) `./librarian.sh files $(MKDLIB) VERSION`
+
+distclean spotless: clean
+ rm -f @GENERATED_FILES@ @CONFIGURE_FILES@
+
+Csio.o: Csio.c cstring.h amalloc.h config.h markdown.h
+amalloc.o: amalloc.c
+basename.o: basename.c config.h cstring.h amalloc.h markdown.h
+css.o: css.c config.h cstring.h amalloc.h markdown.h
+docheader.o: docheader.c config.h cstring.h amalloc.h markdown.h
+dumptree.o: dumptree.c markdown.h cstring.h amalloc.h config.h
+emmatch.o: emmatch.c config.h cstring.h amalloc.h markdown.h
+generate.o: generate.c config.h cstring.h amalloc.h markdown.h
+main.o: main.c config.h amalloc.h
+pgm_options.o: pgm_options.c pgm_options.h config.h amalloc.h
+makepage.o: makepage.c
+markdown.o: markdown.c config.h cstring.h amalloc.h markdown.h
+mkd2html.o: mkd2html.c config.h mkdio.h cstring.h amalloc.h
+mkdio.o: mkdio.c config.h cstring.h amalloc.h markdown.h
+resource.o: resource.c config.h cstring.h amalloc.h markdown.h
+theme.o: theme.c config.h mkdio.h cstring.h amalloc.h
+toc.o: toc.c config.h cstring.h amalloc.h markdown.h
+version.o: version.c config.h
+xml.o: xml.c config.h cstring.h amalloc.h markdown.h
+xmlpage.o: xmlpage.c config.h cstring.h amalloc.h markdown.h
View
@@ -0,0 +1,40 @@
+% Discount on Plan 9
+% Josh Wood
+% 2009-06-12
+
+# *Discount* Markdown compiler on Plan 9
+
+## Build
+
+ % CONFIG='--enable-all-features' mk config
+ % mk install
+ % markdown -V
+ markdown: discount X.Y.Z DL_TAG HEADER DEBUG SUPERSCRIPT RELAXED DIV
+
+`--enable-all-features` may be replaced by zero or more of:
+
+ --enable-dl-tag Use the DL tag extension
+ --enable-pandoc-header Use pandoc-style header blocks
+ --enable-superscript A^B becomes A<sup>B</sup>
+ --enable-amalloc Enable memory allocation debugging
+ --relaxed-emphasis underscores aren't special in the middle of words
+ --with-tabstops=N Set tabstops to N characters (default is 4)
+ --enable-div Enable >%id% divisions
+ --enable-alpha-list Enable (a)/(b)/(c) lists
+ --enable-all-features Turn on all stable optional features
+
+## Notes
+
+The supplied mkfile merely drives Discount's own configure script and
+then APE's *psh* environment to build the Discount source, then copies
+the result(s) to locations appropriate for system-wide use on Plan 9.
+There are a few other *mk*(1) targets:
+
+`install.libs`: Discount includes a C library and header.
+Installation is optional. Plan 9 binaries are statically linked.
+
+`install.man`: Add manual pages for markdown(1) and (6).
+
+`install.progs`: Extra programs. *makepage* writes complete XHTML
+documents, rather than fragments. *mkd2html* is similar, but produces
+HTML.
Oops, something went wrong.

0 comments on commit 83b0b55

Please sign in to comment.