Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[DEV] Replace discount Markdown-to-html engine with mayday.

  • Loading branch information...
commit 28cca588a441b5361a8f8971ed8b1f6aa0052c1b 1 parent 3e1972e
@rentzsch authored
Showing with 15 additions and 13,296 deletions.
  1. +3 −0  .gitmodules
  2. +2 −2 MarkdownLive-Info.plist
  3. +6 −60 MarkdownLive.xcodeproj/project.pbxproj
  4. +3 −23 MyDocument.m
  5. +0 −47 discount-1.5.4/COPYRIGHT
  6. +0 −33 discount-1.5.4/CREDITS
  7. +0 −61 discount-1.5.4/Csio.c
  8. +0 −41 discount-1.5.4/INSTALL
  9. +0 −96 discount-1.5.4/Makefile
  10. +0 −96 discount-1.5.4/Makefile.in
  11. +0 −40 discount-1.5.4/Plan9/README
  12. +0 −169 discount-1.5.4/Plan9/markdown.1
  13. +0 −332 discount-1.5.4/Plan9/markdown.2
  14. +0 −543 discount-1.5.4/Plan9/markdown.6
  15. +0 −37 discount-1.5.4/Plan9/mkfile
  16. +0 −16 discount-1.5.4/README
  17. +0 −1  discount-1.5.4/VERSION
  18. +0 −111 discount-1.5.4/amalloc.c
  19. +0 −29 discount-1.5.4/amalloc.h
  20. +0 −2  discount-1.5.4/config.cmd
  21. +0 −25 discount-1.5.4/config.h
  22. +0 −35 discount-1.5.4/config.log
  23. +0 −1  discount-1.5.4/config.mak
  24. +0 −5 discount-1.5.4/config.md
  25. +0 −27 discount-1.5.4/config.sub
  26. +0 −1,459 discount-1.5.4/configure.inc
  27. +0 −144 discount-1.5.4/configure.sh
  28. +0 −76 discount-1.5.4/css.c
  29. +0 −75 discount-1.5.4/cstring.h
  30. +0 −43 discount-1.5.4/docheader.c
  31. +0 −151 discount-1.5.4/dumptree.c
  32. +0 −1,594 discount-1.5.4/generate.c
  33. +0 −197 discount-1.5.4/main.c
  34. +0 −27 discount-1.5.4/makepage.c
  35. +0 −128 discount-1.5.4/markdown.1
  36. +0 −128 discount-1.5.4/markdown.1.in
  37. +0 −123 discount-1.5.4/markdown.3
  38. +0 −1,019 discount-1.5.4/markdown.7
  39. +0 −1,069 discount-1.5.4/markdown.c
  40. +0 −146 discount-1.5.4/markdown.h
  41. +0 −178 discount-1.5.4/mkd-extensions.7
  42. +0 −180 discount-1.5.4/mkd-functions.3
  43. +0 −41 discount-1.5.4/mkd-line.3
  44. +0 −185 discount-1.5.4/mkd2html.c
  45. +0 −303 discount-1.5.4/mkdio.c
  46. +0 −79 discount-1.5.4/mkdio.h
  47. +0 −155 discount-1.5.4/resource.c
  48. +0 −42 discount-1.5.4/tests/autolink.t
  49. +0 −53 discount-1.5.4/tests/automatic.t
  50. +0 −35 discount-1.5.4/tests/backslash.t
  51. +0 −13 discount-1.5.4/tests/chrome.text
  52. +0 −39 discount-1.5.4/tests/code.t
  53. +0 −47 discount-1.5.4/tests/compat.t
  54. +0 −48 discount-1.5.4/tests/crash.t
  55. +0 −67 discount-1.5.4/tests/div.t
  56. +0 −69 discount-1.5.4/tests/dl.t
  57. +0 −9 discount-1.5.4/tests/embedlinks.text
  58. +0 −40 discount-1.5.4/tests/emphasis.t
  59. +0 −52 discount-1.5.4/tests/flow.t
  60. +0 −34 discount-1.5.4/tests/footnotes.t
  61. +0 −42 discount-1.5.4/tests/header.t
  62. +0 −109 discount-1.5.4/tests/html.t
  63. +0 −14 discount-1.5.4/tests/links.text
  64. +0 −124 discount-1.5.4/tests/linkylinky.t
  65. +0 −31 discount-1.5.4/tests/linkypix.t
  66. +0 −168 discount-1.5.4/tests/list.t
  67. +0 −57 discount-1.5.4/tests/list3deep.t
  68. +0 −33 discount-1.5.4/tests/misc.t
  69. +0 −74 discount-1.5.4/tests/pandoc.t
  70. +0 −38 discount-1.5.4/tests/para.t
  71. +0 −31 discount-1.5.4/tests/paranoia.t
  72. +0 −64 discount-1.5.4/tests/peculiarities.t
  73. +0 −35 discount-1.5.4/tests/pseudo.t
  74. +0 −34 discount-1.5.4/tests/reparse.t
  75. +0 −97 discount-1.5.4/tests/schiraldi.t
  76. +0 −50 discount-1.5.4/tests/smarty.t
  77. +0 −34 discount-1.5.4/tests/snakepit.t
  78. +0 −32 discount-1.5.4/tests/style.t
  79. +0 −897 discount-1.5.4/tests/syntax.text
  80. +0 −164 discount-1.5.4/tests/tables.t
  81. +0 −66 discount-1.5.4/tests/tabstop.t
  82. +0 −41 discount-1.5.4/tests/toc.t
  83. +0 −39 discount-1.5.4/tests/xml.t
  84. +0 −142 discount-1.5.4/theme.1
  85. +0 −593 discount-1.5.4/theme.c
  86. +0 −90 discount-1.5.4/toc.c
  87. +0 −38 discount-1.5.4/tools/cols.c
  88. +0 −22 discount-1.5.4/tools/echo.c
  89. +0 −28 discount-1.5.4/version.c
  90. +0 −28 discount-1.5.4/version.c.in
  91. +0 −82 discount-1.5.4/xml.c
  92. +0 −48 discount-1.5.4/xmlpage.c
  93. +0 −3  discount_wrappers/discountWrapper.h
  94. +0 −29 discount_wrappers/discountWrapper.m
  95. +0 −13 discount_wrappers/markdownWrapper.c
  96. +0 −7 discount_wrappers/markdownWrapper.h
  97. +0 −12 discount_wrappers/mkdioWrapper.c
  98. +0 −7 discount_wrappers/mkdioWrapper.h
  99. +1 −0  mayday
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "mayday"]
+ path = mayday
+ url = git://github.com/jemmons/mayday.git
View
4 MarkdownLive-Info.plist
@@ -40,9 +40,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.5.1</string>
+ <string>1.6</string>
<key>CFBundleShortVersionString</key>
- <string>1.5.1</string>
+ <string>1.6</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key>
View
66 MarkdownLive.xcodeproj/project.pbxproj
@@ -9,17 +9,9 @@
/* Begin PBXBuildFile section */
1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58280DA1D0D100B32029 /* MyDocument.xib */; };
1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; };
- 795F6C4F105D6EC400D1F90A /* mkdio.c in Sources */ = {isa = PBXBuildFile; fileRef = 795F6C4E105D6EC400D1F90A /* mkdio.c */; };
- 795F6C51105D6ECE00D1F90A /* markdown.c in Sources */ = {isa = PBXBuildFile; fileRef = 795F6C50105D6ECE00D1F90A /* markdown.c */; };
- 795F6C53105D6ED800D1F90A /* generate.c in Sources */ = {isa = PBXBuildFile; fileRef = 795F6C52105D6ED800D1F90A /* generate.c */; };
- 795F6C55105D6EE100D1F90A /* resource.c in Sources */ = {isa = PBXBuildFile; fileRef = 795F6C54105D6EE100D1F90A /* resource.c */; };
- 795F6C62105D6F6E00D1F90A /* xml.c in Sources */ = {isa = PBXBuildFile; fileRef = 795F6C61105D6F6E00D1F90A /* xml.c */; };
- 795F6C66105D6F8500D1F90A /* Csio.c in Sources */ = {isa = PBXBuildFile; fileRef = 795F6C65105D6F8500D1F90A /* Csio.c */; };
795F6C87105D70A300D1F90A /* MarkdownLiveApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 795F6C86105D70A300D1F90A /* MarkdownLiveApp.icns */; };
795F6CCD105D741100D1F90A /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 795F6CCC105D741100D1F90A /* WebKit.framework */; };
- 795F6DBA105D75D300D1F90A /* discountWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 795F6DB5105D75D300D1F90A /* discountWrapper.m */; };
- 795F6DBB105D75D300D1F90A /* markdownWrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 795F6DB6105D75D300D1F90A /* markdownWrapper.c */; };
- 795F6DBC105D75D300D1F90A /* mkdioWrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 795F6DB8105D75D300D1F90A /* mkdioWrapper.c */; };
+ 79B3D5441060376F00A8D174 /* MDMarkdownParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 79B3D5431060376F00A8D174 /* MDMarkdownParser.m */; };
8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; };
8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; };
8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */; settings = {ATTRIBUTES = (); }; };
@@ -40,20 +32,10 @@
2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; };
2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
- 795F6C4E105D6EC400D1F90A /* mkdio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mkdio.c; sourceTree = "<group>"; };
- 795F6C50105D6ECE00D1F90A /* markdown.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = markdown.c; sourceTree = "<group>"; };
- 795F6C52105D6ED800D1F90A /* generate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = generate.c; sourceTree = "<group>"; };
- 795F6C54105D6EE100D1F90A /* resource.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resource.c; sourceTree = "<group>"; };
- 795F6C61105D6F6E00D1F90A /* xml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xml.c; sourceTree = "<group>"; };
- 795F6C65105D6F8500D1F90A /* Csio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Csio.c; sourceTree = "<group>"; };
795F6C86105D70A300D1F90A /* MarkdownLiveApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = MarkdownLiveApp.icns; sourceTree = "<group>"; };
795F6CCC105D741100D1F90A /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = "<absolute>"; };
- 795F6DB4105D75D300D1F90A /* discountWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = discountWrapper.h; sourceTree = "<group>"; };
- 795F6DB5105D75D300D1F90A /* discountWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = discountWrapper.m; sourceTree = "<group>"; };
- 795F6DB6105D75D300D1F90A /* markdownWrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = markdownWrapper.c; sourceTree = "<group>"; };
- 795F6DB7105D75D300D1F90A /* markdownWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = markdownWrapper.h; sourceTree = "<group>"; };
- 795F6DB8105D75D300D1F90A /* mkdioWrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mkdioWrapper.c; sourceTree = "<group>"; };
- 795F6DB9105D75D300D1F90A /* mkdioWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mkdioWrapper.h; sourceTree = "<group>"; };
+ 79B3D5421060376F00A8D174 /* MDMarkdownParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MDMarkdownParser.h; path = mayday/MDMarkdownParser.h; sourceTree = "<group>"; };
+ 79B3D5431060376F00A8D174 /* MDMarkdownParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MDMarkdownParser.m; path = mayday/MDMarkdownParser.m; sourceTree = "<group>"; };
8D15AC360486D014006FF6A4 /* MarkdownLive-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MarkdownLive-Info.plist"; sourceTree = "<group>"; };
8D15AC370486D014006FF6A4 /* MarkdownLive.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarkdownLive.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -102,8 +84,6 @@
isa = PBXGroup;
children = (
2A37F4ABFDCFA73011CA2CEA /* Classes */,
- 795F6C4D105D6EA500D1F90A /* discount-1.5.4 */,
- 795F6DB3105D75D300D1F90A /* discount_wrappers */,
2A37F4AFFDCFA73011CA2CEA /* Other Sources */,
2A37F4B8FDCFA73011CA2CEA /* Resources */,
2A37F4C3FDCFA73011CA2CEA /* Frameworks */,
@@ -117,6 +97,8 @@
children = (
2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */,
2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */,
+ 79B3D5421060376F00A8D174 /* MDMarkdownParser.h */,
+ 79B3D5431060376F00A8D174 /* MDMarkdownParser.m */,
);
name = Classes;
sourceTree = "<group>";
@@ -152,32 +134,6 @@
name = Frameworks;
sourceTree = "<group>";
};
- 795F6C4D105D6EA500D1F90A /* discount-1.5.4 */ = {
- isa = PBXGroup;
- children = (
- 795F6C4E105D6EC400D1F90A /* mkdio.c */,
- 795F6C50105D6ECE00D1F90A /* markdown.c */,
- 795F6C52105D6ED800D1F90A /* generate.c */,
- 795F6C54105D6EE100D1F90A /* resource.c */,
- 795F6C61105D6F6E00D1F90A /* xml.c */,
- 795F6C65105D6F8500D1F90A /* Csio.c */,
- );
- path = "discount-1.5.4";
- sourceTree = "<group>";
- };
- 795F6DB3105D75D300D1F90A /* discount_wrappers */ = {
- isa = PBXGroup;
- children = (
- 795F6DB4105D75D300D1F90A /* discountWrapper.h */,
- 795F6DB5105D75D300D1F90A /* discountWrapper.m */,
- 795F6DB6105D75D300D1F90A /* markdownWrapper.c */,
- 795F6DB7105D75D300D1F90A /* markdownWrapper.h */,
- 795F6DB8105D75D300D1F90A /* mkdioWrapper.c */,
- 795F6DB9105D75D300D1F90A /* mkdioWrapper.h */,
- );
- path = discount_wrappers;
- sourceTree = "<group>";
- };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -238,15 +194,7 @@
files = (
8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */,
8D15AC320486D014006FF6A4 /* main.m in Sources */,
- 795F6C4F105D6EC400D1F90A /* mkdio.c in Sources */,
- 795F6C51105D6ECE00D1F90A /* markdown.c in Sources */,
- 795F6C53105D6ED800D1F90A /* generate.c in Sources */,
- 795F6C55105D6EE100D1F90A /* resource.c in Sources */,
- 795F6C62105D6F6E00D1F90A /* xml.c in Sources */,
- 795F6C66105D6F8500D1F90A /* Csio.c in Sources */,
- 795F6DBA105D75D300D1F90A /* discountWrapper.m in Sources */,
- 795F6DBB105D75D300D1F90A /* markdownWrapper.c in Sources */,
- 795F6DBC105D75D300D1F90A /* mkdioWrapper.c in Sources */,
+ 79B3D5441060376F00A8D174 /* MDMarkdownParser.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -330,7 +278,6 @@
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
- USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/discount-1.5.4\"";
};
name = Debug;
};
@@ -343,7 +290,6 @@
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
- USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/discount-1.5.4\"";
};
name = Release;
};
View
26 MyDocument.m
@@ -1,5 +1,5 @@
#import "MyDocument.h"
-#include "discountWrapper.h"
+#import "MDMarkdownParser.h"
NSString *kMarkdownDocumentType = @"MarkdownDocumentType";
@@ -13,28 +13,8 @@ - (NSString*)markdown2html:(NSString*)markdown_ {
if (!markdown_)
return @"";
-#if 0
- NSString *result = nil;
-
- char *markdownUTF8 = (char*)[markdown_ UTF8String];
- Document *document = mkd_string(markdownUTF8, strlen(markdownUTF8), 0);
- if (document) {
- if (mkd_compile(document, 0)) {
- char *htmlUTF8;
- int htmlUTF8Len = mkd_document(document, &htmlUTF8);
- if (htmlUTF8Len != EOF) {
- result = [[[NSString alloc] initWithBytes:htmlUTF8
- length:htmlUTF8Len
- encoding:NSUTF8StringEncoding] autorelease];
- }
- mkd_cleanup(document);
- }
- }
-
- return result;
-#else
- return discountToHTML(markdown_);
-#endif
+ MDMarkdownParser *parser = [[[MDMarkdownParser alloc] init] autorelease];
+ return [parser cleanWhitespaceOnlyLinesInString:[parser detabString:markdown_]];
}
- (id)init {
View
47 discount-1.5.4/COPYRIGHT
@@ -1,47 +0,0 @@
-->Copyright (C) 2007 David Loren Parsons.
-All rights reserved.<-
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation files
-(the "Software"), to deal in the Software without restriction,
-including without limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicence, and/or sell copies of the Software,
-and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions, and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution, and in the same place and form as other
- copyright, license and disclaimer information.
-
- 3. The end-user documentation included with the redistribution, if
- any, must include the following acknowledgment:
-
- This product includes software developed by
- David Loren Parsons <http://www.pell.portland.or.us/~orc>
-
- in the same place and form as other third-party acknowledgments.
- Alternately, this acknowledgment may appear in the software
- itself, in the same form and location as other such third-party
- acknowledgments.
-
- 4. Except as contained in this notice, the name of David Loren
- Parsons shall not be used in advertising or otherwise to promote
- the sale, use or other dealings in this Software without prior
- written authorization from David Loren Parsons.
-
-THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL DAVID LOREN PARSONS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
View
33 discount-1.5.4/CREDITS
@@ -1,33 +0,0 @@
-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.
-
-
View
61 discount-1.5.4/Csio.c
@@ -1,61 +0,0 @@
-#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);
- ___mkd_emblock(&f);
- SUFFIX(*iot, T(f.out), S(f.out));
- ___mkd_freemmiot(&f, 0);
-}
View
41 discount-1.5.4/INSTALL
@@ -1,41 +0,0 @@
-
- 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
96 discount-1.5.4/Makefile
@@ -1,96 +0,0 @@
-CC=cc -I. -L.
-AR=/usr/bin/ar
-RANLIB=/usr/bin/ranlib
-
-BINDIR=/usr/local/bin
-MANDIR=/usr/local/man
-LIBDIR=/usr/local/lib
-INCDIR=/usr/local/include
-
-PGMS=markdown
-SAMPLE_PGMS=mkd2html makepage
-SAMPLE_PGMS+= theme
-MKDLIB=libmarkdown.a
-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
-
-all: $(PGMS) $(SAMPLE_PGMS)
-
-install: $(PGMS)
- /usr/bin/install -s -m 755 $(PGMS) $(DESTDIR)/$(BINDIR)
- /usr/bin/install -m 444 $(MKDLIB) $(DESTDIR)/$(LIBDIR)
- /usr/bin/install -m 444 mkdio.h $(DESTDIR)/$(INCDIR)
-
-install.everything: install install.samples install.man
-
-install.samples: $(SAMPLE_PGMS) install
- /usr/bin/install -s -m 755 $(SAMPLE_PGMS) $(DESTDIR)/$(BINDIR)
- /Users/wolf/Downloads/discount-1.5.4/config.md $(DESTDIR)/$(MANDIR)/man1
- /usr/bin/install -m 444 theme.1 $(DESTDIR)/$(MANDIR)/man1
-
-install.man:
- /Users/wolf/Downloads/discount-1.5.4/config.md $(DESTDIR)/$(MANDIR)/man3
- /usr/bin/install -m 444 mkd-functions.3 markdown.3 mkd-line.3 $(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
- /Users/wolf/Downloads/discount-1.5.4/config.md $(DESTDIR)/$(MANDIR)/man7
- /usr/bin/install -m 444 markdown.7 mkd-extensions.7 $(DESTDIR)/$(MANDIR)/man7
- /Users/wolf/Downloads/discount-1.5.4/config.md $(DESTDIR)/$(MANDIR)/man1
- /usr/bin/install -m 444 markdown.1 $(DESTDIR)/$(MANDIR)/man1
-
-install.everything: install install.man
-
-version.o: version.c VERSION
- $(CC) -DVERSION=\"`cat VERSION`\" -c version.c
-
-markdown: main.o $(MKDLIB)
- $(CC) -o markdown main.o -lmarkdown
-
-# example programs
-theme: theme.o $(MKDLIB) mkdio.h
- $(CC) -o theme theme.o -lmarkdown
-
-
-mkd2html: mkd2html.o $(MKDLIB) mkdio.h
- $(CC) -o mkd2html mkd2html.o -lmarkdown
-
-makepage: makepage.c $(MKDLIB) mkdio.h
- $(CC) -o makepage makepage.c -lmarkdown
-
-main.o: main.c mkdio.h config.h
- $(CC) -I. -c main.c
-
-$(MKDLIB): $(OBJS)
- $(AR) crv $(MKDLIB) $(OBJS)
- $(RANLIB) $(MKDLIB)
-
-test: $(PGMS) echo cols
- @for x in tests/*.t; do \
- sh $$x || exit 1; \
- done
-
-cols: tools/cols.c
- $(CC) -o cols tools/cols.c
-echo: tools/echo.c
- $(CC) -o echo tools/echo.c
-
-clean:
- rm -f $(PGMS) $(SAMPLE_PGMS) *.o $(MKDLIB)
-
-distclean spotless: clean
- rm -f Makefile version.c markdown.1 config.cmd config.sub config.h config.mak config.log config.md
-
-markdown.o: markdown.c config.h cstring.h markdown.h
-generate.o: generate.c config.h cstring.h markdown.h
-dumptree.o: dumptree.c cstring.h markdown.h
-mkdio.o: mkdio.c mkdio.h cstring.h config.h
-xmlpage.o: xmlpage.c mkdio.h cstring.h config.h
-toc.o: toc.c mkdio.h cstring.h config.h
View
96 discount-1.5.4/Makefile.in
@@ -1,96 +0,0 @@
-CC=@CC@ -I. -L.
-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.a
-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 @AMALLOC@
-
-all: $(PGMS) $(SAMPLE_PGMS)
-
-install: $(PGMS)
- @INSTALL_PROGRAM@ $(PGMS) $(DESTDIR)/$(BINDIR)
- @INSTALL_DATA@ $(MKDLIB) $(DESTDIR)/$(LIBDIR)
- @INSTALL_DATA@ mkdio.h $(DESTDIR)/$(INCDIR)
-
-install.everything: install install.samples install.man
-
-install.samples: $(SAMPLE_PGMS) install
- @INSTALL_PROGRAM@ $(SAMPLE_PGMS) $(DESTDIR)/$(BINDIR)
- @INSTALL_DIR@ $(DESTDIR)/$(MANDIR)/man1
- @INSTALL_DATA@ theme.1 $(DESTDIR)/$(MANDIR)/man1
-
-install.man:
- @INSTALL_DIR@ $(DESTDIR)/$(MANDIR)/man3
- @INSTALL_DATA@ mkd-functions.3 markdown.3 mkd-line.3 $(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
-
-version.o: version.c VERSION
- $(CC) -DVERSION=\"`cat VERSION`\" -c version.c
-
-markdown: main.o $(MKDLIB)
- $(CC) -o markdown main.o -lmarkdown @LIBS@
-
-# example programs
-@THEME@theme: theme.o $(MKDLIB) mkdio.h
-@THEME@ $(CC) -o theme theme.o -lmarkdown @LIBS@
-
-
-mkd2html: mkd2html.o $(MKDLIB) mkdio.h
- $(CC) -o mkd2html mkd2html.o -lmarkdown @LIBS@
-
-makepage: makepage.c $(MKDLIB) mkdio.h
- $(CC) -o makepage makepage.c -lmarkdown @LIBS@
-
-main.o: main.c mkdio.h config.h
- $(CC) -I. -c main.c
-
-$(MKDLIB): $(OBJS)
- $(AR) crv $(MKDLIB) $(OBJS)
- $(RANLIB) $(MKDLIB)
-
-test: $(PGMS) echo cols
- @for x in tests/*.t; do \
- sh $$x || exit 1; \
- done
-
-cols: tools/cols.c
- $(CC) -o cols tools/cols.c
-echo: tools/echo.c
- $(CC) -o echo tools/echo.c
-
-clean:
- rm -f $(PGMS) $(SAMPLE_PGMS) *.o $(MKDLIB)
-
-distclean spotless: clean
- rm -f @GENERATED_FILES@ @CONFIGURE_FILES@
-
-markdown.o: markdown.c config.h cstring.h markdown.h
-generate.o: generate.c config.h cstring.h markdown.h
-dumptree.o: dumptree.c cstring.h markdown.h
-mkdio.o: mkdio.c mkdio.h cstring.h config.h
-xmlpage.o: xmlpage.c mkdio.h cstring.h config.h
-toc.o: toc.c mkdio.h cstring.h config.h
View
40 discount-1.5.4/Plan9/README
@@ -1,40 +0,0 @@
-% 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.
View
169 discount-1.5.4/Plan9/markdown.1
@@ -1,169 +0,0 @@
-.TH MARKDOWN 1
-.SH NAME
-markdown \- convert Markdown text to HTML
-.SH SYNOPSIS
-.B markdown
-[
-.B -dTV
-]
-[
-.BI -b " url-base
-]
-[
-.BI -F " bitmap
-]
-[
-.BI -f " flags
-]
-[
-.BI -o " ofile
-]
-[
-.BI -s " text
-]
-[
-.BI -t " text
-]
-[
-.I file
-]
-.SH DESCRIPTION
-The
-.I markdown
-utility reads the
-.IR Markdown (6)-formatted
-.I file
-(or standard input) and writes its
-.SM HTML
-fragment representation on standard output.
-.PP
-The options are:
-.TF dfdoptions
-.TP
-.BI -b " url-base
-Links in source begining with
-.B /
-will be prefixed with
-.I url-base
-in the output.
-.TP
-.B -d
-Instead of printing an
-.SM HTML
-fragment, print a parse tree.
-.TP
-.BI -F " bitmap
-Set translation flags.
-.I Bitmap
-is a bit map of the various configuration options described in
-.IR markdown (2).
-.TP
-.BI -f " flags
-Set or clear various translation
-.IR flags ,
-described below.
-.I Flags
-are in a comma-delimited list, with an optional
-.B +
-(set) prefix on each flag.
-.TP
-.BI -o " ofile
-Write the generated
-.SM HTML
-to
-.IR ofile .
-.TP
-.BI -s " text
-Use the
-.IR markdown (2)
-function to format the
-.I text
-on standard input.
-.TP
-.B -T
-Under
-.B -f
-.BR toc ,
-print the table of contents as an unordered list before the usual
-.SM HTML
-output.
-.TP
-.BI -t " text
-Use
-.IR mkd_text
-(in
-.IR markdown (2))
-to format
-.I text
-instead of processing standard input with
-.IR markdown .
-.TP
-.B -V
-Show version number and configuration. If the version includes the string
-.BR DL_TAG ,
-.I markdown
-was configured with definition list support. If the version includes the string
-.BR HEADER ,
-.I markdown
-was configured to support pandoc header blocks.
-.PD
-.SS TRANSLATION FLAGS
-The translation flags understood by
-.B -f
-are:
-.TF \ noheader
-.TP
-.B noimage
-Don't allow image tags.
-.TP
-.B nolinks
-Don't allow links.
-.TP
-.B nohtml
-Don't allow any embedded HTML.
-.TP
-.B cdata
-Generate valid XML output.
-.TP
-.B noheader
-Do not process pandoc headers.
-.TP
-.B notables
-Do not process the syntax extension for tables.
-.TP
-.B tabstops
-Use Markdown-standard 4-space tabstops.
-.TP
-.B strict
-Disable superscript and relaxed emphasis.
-.TP
-.B relax
-Enable superscript and relaxed emphasis (the default).
-.TP
-.B toc
-Enable table of contents support, generated from headings (in
-.IR markdown (6))
-in the source.
-.TP
-.B 1.0
-Revert to Markdown 1.0 compatibility.
-.PD
-.PP
-For example,
-.B -f nolinks,quot
-tells
-.I markdown
-not to allow
-.B <a>
-tags, and to expand double quotes.
-.SH SOURCE
-.B /sys/src/cmd/discount
-.SH SEE ALSO
-.IR markdown (2),
-.IR markdown (6)
-.PP
-http://daringfireball.net/projects/markdown/,
-``Markdown''.
-.SH DIAGNOSTICS
-.I Markdown
-exits 0 on success and >0 if an error occurs.
View
332 discount-1.5.4/Plan9/markdown.2
@@ -1,332 +0,0 @@
-.TH MARKDOWN 2
-.SH NAME
-mkd_in, mkd_string, markdown, mkd_compile, mkd_css, mkd_generatecss,
-mkd_document, mkd_generatehtml, mkd_xhtmlpage, mkd_toc, mkd_generatetoc,
-mkd_cleanup, mkd_doc_title, mkd_doc_author, mkd_doc_date, mkd_line,
-mkd_generateline \- convert Markdown text to HTML
-.SH SYNOPSIS
-.ta \w'MMIOT* 'u
-.B #include <mkdio.h>
-.PP
-.B
-MMIOT* mkd_in(FILE *input)
-.PP
-.B
-MMIOT* mkd_string(char *string, int size)
-.PP
-.B
-int markdown(MMIOT *doc, FILE *output, int flags)
-.PP
-.B
-int mkd_compile(MMIOT *document, int flags)
-.PP
-.B
-int mkd_css(MMIOT *document, char **doc)
-.PP
-.B
-int mkd_generatecss(MMIOT *document, FILE *output)
-.PP
-.B
-int mkd_document(MMIOT *document, char **doc)
-.PP
-.B
-int mkd_generatehtml(MMIOT *document, FILE *output)
-.PP
-.B
-int mkd_xhtmlpage(MMIOT *document, int flags, FILE *output)
-.PP
-.B
-int mkd_toc(MMIOT *document, char **doc)
-.PP
-.B
-void mkd_generatetoc(MMIOT *document, FILE *output)
-.PP
-.B
-void mkd_cleanup(MMIOT*);
-.PP
-.B
-char* mkd_doc_title(MMIOT*)
-.PP
-.B
-char* mkd_doc_author(MMIOT*)
-.PP
-.B
-char* mkd_doc_date(MMIOT*)
-.PP
-.B
-int mkd_line(char *string, int size, char **doc, int flags)
-.PP
-.B
-int mkd_generateline(char *string, int size, FILE *output, int flags)
-.PD
-.PP
-.SH DESCRIPTION
-These functions convert
-.IR Markdown (6)
-text into
-.SM HTML
-markup.
-.PP
-.I Mkd_in
-reads the text referenced by pointer to
-.B FILE
-.I input
-and returns a pointer to an
-.B MMIOT
-structure of the form expected by
-.I markdown
-and the other converters.
-.I Mkd_string
-accepts one
-.I string
-and returns a pointer to
-.BR MMIOT .
-.PP
-After such preparation,
-.I markdown
-converts
-.I doc
-and writes the result to
-.IR output ,
-while
-.I mkd_compile
-transforms
-.I document
-in-place.
-.PP
-One or more of the following
-.I flags
-(combined with
-.BR OR )
-control
-.IR markdown 's
-processing of
-.IR doc :
-.TF MKD_NOIMAGE
-.TP
-.B MKD_NOIMAGE
-Do not process
-.B ![]
-and remove
-.B <img>
-tags from the output.
-.TP
-.B MKD_NOLINKS
-Do not process
-.B []
-and remove
-.B <a>
-tags from the output.
-.TP
-.B MKD_NOPANTS
-Suppress Smartypants-style replacement of quotes, dashes, or ellipses.
-.TP
-.B MKD_STRICT
-Disable superscript and relaxed emphasis processing if configured; otherwise a no-op.
-.TP
-.B MKD_TAGTEXT
-Process as inside an
-.SM HTML
-tag: no
-.BR <em> ,
-no
-.BR <bold> ,
-no
-.SM HTML
-or
-.B []
-expansion.
-.TP
-.B MKD_NO_EXT
-Don't process pseudo-protocols (in
-.IR markdown (6)).
-.TP
-.B MKD_CDATA
-Generate code for
-.SM XML
-.B ![CDATA[...]]
-element.
-.TP
-.B MKD_NOHEADER
-Don't process Pandoc-style headers.
-.TP
-.B MKD_TABSTOP
-When reading documents, expand tabs to 4 spaces, overriding any compile-time configuration.
-.TP
-.B MKD_TOC
-Label headings for use with the
-.I mkd_generatetoc
-and
-.I mkd_toc
-functions.
-.TP
-.B MKD_1_COMPAT
-MarkdownTest_1.0 compatibility. Trim trailing spaces from first line of code blocks and disable implicit reference links (in
-.IR markdown (6)).
-.TP
-.B MKD_AUTOLINK
-Greedy
-.SM URL
-generation. When set, any
-.SM URL
-is converted to a hyperlink, even those not encased in
-.BR <> .
-.TP
-.B MKD_SAFELINK
-Don't make hyperlinks from
-.B [][]
-links that have unknown
-.SM URL
-protocol types.
-.TP
-.B MKD_NOTABLES
-Do not process the syntax extension for tables (in
-.IR markdown (6)).
-.TP
-.B MKD_EMBED
-All of
-.BR MKD_NOLINKS ,
-.BR MKD_NOIMAGE ,
-and
-.BR MKD_TAGTEXT .
-.PD
-.PP
-This implementation supports
-Pandoc-style
-headers and inline
-.SM CSS
-.B <style>
-blocks, but
-.I markdown
-does not access the data provided by these extensions.
-The following functions do, and allow other manipulations.
-.PP
-Given a pointer to
-.B MMIOT
-prepared by
-.I mkd_in
-or
-.IR mkd_string ,
-.I mkd_compile
-compiles the
-.I document
-into
-.BR <style> ,
-Pandoc, and
-.SM HTML
-sections. It accepts the
-.I flags
-described for
-.IR markdown ,
-above.
-.PP
-Once compiled, the document particulars can be read and written:
-.PP
-.I Mkd_css
-allocates a string and populates it with any
-.B <style>
-sections from the document.
-.I Mkd_generatecss
-writes any
-.B <style>
-sections to
-.IR output .
-.PP
-.I Mkd_document
-points
-.I doc
-to the
-.B MMIOT
-.IR document ,
-returning
-.IR document 's
-size.
-.PP
-.I Mkd_generatehtml
-writes the rest of the
-.I document
-to the
-.IR output .
-.PP
-.IR Mkd_doc_title ,
-.IR mkd_doc_author ,
-and
-.I mkd_doc_date
-read the contents of any Pandoc header.
-.PP
-.I Mkd_xhtmlpage
-writes an
-.SM XHTML
-page representation of the document.
-It accepts the
-.I flags
-described for
-.IR markdown ,
-above.
-.PP
-.I Mkd_toc
-.IR malloc s
-a buffer into which it writes an outline, in the form of a
-.B <ul>
-element populated with
-.BR <li> s
-each containing a link to successive headings in the
-.IR document .
-It returns the size of that string.
-.I Mkd_generatetoc
-is similar,
-but writes the outline to the
-.I output
-referenced by a pointer to
-.BR FILE .
-.PP
-.I Mkd_cleanup
-deletes a processed
-.BR MMIOT .
-.PP
-The last two functions convert a single line of markdown source, for example a page title or a signature.
-.I Mkd_line
-allocates a buffer into which it writes an
-.SM HTML
-fragment representation of the
-.IR string .
-.I Mkd_generateline
-writes the result to
-.IR output .
-.SH SOURCE
-.B /sys/src/cmd/discount
-.SH SEE ALSO
-.IR markdown (1),
-.IR markdown (6)
-.SH DIAGNOSTICS
-The
-.I mkd_in
-and
-.I mkd_string
-functions return a pointer to
-.B MMIOT
-on success, null on failure.
-.IR Markdown ,
-.IR mkd_compile ,
-.IR mkd_style ,
-and
-.I mkd_generatehtml
-return
-.B 0
-on success,
-.B -1
-otherwise.
-.SH BUGS
-Error handling is minimal at best.
-.PP
-The
-.B MMIOT
-created by
-.I mkd_string
-is deleted by the
-.I markdown
-function.
-.PP
-This is an
-.SM APE
-library.
View
543 discount-1.5.4/Plan9/markdown.6
@@ -1,543 +0,0 @@
-.TH MARKDOWN 6
-.SH NAME
-Markdown \- text formatting syntax
-.SH DESCRIPTION
-Markdown
-is a text markup syntax for machine conversion to
-the more complex
-.SM HTML
-or
-.SM XHTML
-markup languages.
-It is intended to be easy to read and to write, with
-emphasis on readability.
-A Markdown-formatted document should be publishable as-is,
-in plain text, without the formatting distracting the reader.
-.PP
-The biggest source of inspiration for Markdown's
-syntax is the format of plain text email. The markup is comprised entirely
-of punctuation characters, chosen so as to look like what they mean.
-Asterisks around a word look like
-.IR *emphasis* .
-Markdown lists look like lists. Even
-blockquotes look like quoted passages of text, assuming the reader has
-used email.
-.PP
-.SS Block Elements
-.TF W
-.PD
-.TP
-Paragraphs and Line Breaks
-A paragraph is one or more consecutive lines of text, separated
-by one or more blank lines. (A blank line is any line that looks like a
-blank line -- a line containing nothing but spaces or tabs is considered
-blank.) Normal paragraphs should not be indented with spaces or tabs.
-.IP
-Lines may be freely broken for readability; Markdown
-does not translate source line breaks to
-.B <br />
-tags. To request generation of
-.B <br />
-in the output, end a line with two or more spaces, then a newline.
-.TP
-Headings
-Headings can be marked in two ways, called
-.I setext
-and
-.IR atx .
-.IP
-Setext-style headings are
-``underlined'' using equal signs (for first-level
-headings) and dashes (for second-level headings).
-.IP
-Atx-style headings use 1-6 hash characters at the start of the line,
-corresponding to
-.SM HTML
-.BR <h^(1-6)^> .
-Optional closing hashes may follow
-the heading text.
-.TP
-Blockquotes
-Lines beginning with
-.B >
-are output in blockquotes.
-Blockquotes can be nested
-by multiple levels of
-.BR >> .
-Blockquotes can contain other Markdown elements, including
-headings, lists, and code blocks.
-.TP
-Lists
-Markdown supports ordered (numbered) and unordered (bulleted) lists.
-List markers typically start at the left margin, but may be indented by
-up to three spaces.
-List markers must be followed by one or more spaces
-or a tab, then the list item text.
-A newline terminates each list item.
-.IP
-Unordered lists use asterisks, pluses, and hyphens interchangeably as
-list markers.
-.IP
-Ordered lists use integers followed by periods as list markers.
-The order of the integers is not interpreted,
-but the list should begin with
-.BR 1 .
-.IP
-If list items are separated by blank lines, Markdown will wrap each list
-item in
-.B <p>
-tags in the
-.SM HTML
-output.
-.IP
-List items may consist of multiple paragraphs.
-Each subsequent
-paragraph within a list item must be indented by either 4 spaces
-or one tab.
-To put a blockquote within a list item, the blockquote's
-.B >
-marker needs to be indented.
-To put a code block within a list item, the code block needs
-to be indented
-.I twice
--- 8 spaces or two tabs.
-.TP
-Code Blocks
-To produce a code block, indent every line of the
-block by at least 4 spaces or 1 tab.
-A code block continues until it reaches a line that is not indented.
-.IP
-Rather than forming normal paragraphs, the lines
-of a code block are interpreted literally.
-Regular Markdown syntax is not processed within code blocks.
-Markdown wraps a code block in both
-.B <pre>
-and
-.B <code>
-tags.
-One level of indentation -- 4
-spaces or 1 tab -- is removed from each line of the code block in
-the output.
-.TP
-Horizontal Rules
-Produce a horizontal rule tag
-.RB ( <hr\ /> )
-by placing three or
-more hyphens, asterisks, or underscores on a line by themselves.
-.SS Span Elements
-.TF W
-.PD
-.TP
-Links
-Markdown supports two styles of links:
-.I inline
-and
-.IR reference .
-In both styles, the link text is delimited by square brackets
-.RB ( [] ).
-To create an inline link, use a set of regular parentheses immediately
-after the link text's closing square bracket.
-Inside the parentheses,
-put the link URL, along with an optional
-title for the link surrounded in double quotes.
-For example:
-.IP
-.EX
- An [example](http://example.com/ "Title") inline link.
-.EE
-.IP
-Reference-style links use a second set of square brackets, inside
-which you place a label of your choosing to identify the link:
-.IP
-.EX
- An [example][id] reference-style link.
-.EE
-.IP
-The label is then assigned a value on its own line, anywhere in the document:
-.IP
-.EX
- [id]: http://example.com/ "Optional Title"
-.EE
-.IP
-Link label names may consist of letters, numbers, spaces, and
-punctuation.
-Labels are not case sensitive.
-An empty label bracket
-set after a reference-style link implies the link label is equivalent to
-the link text.
-A URL value can then be assigned to the link by referencing
-the link text as the label name.
-.TP
-Emphasis
-Markdown treats asterisks
-.RB ( * )
-and underscores
-.RB ( _ )
-as indicators of emphasis.
-Text surrounded with single asterisks or underscores
-will be wrapped with an
-.SM HTML
-.B <em>
-tag.
-Double asterisks or underscores generate an
-.SM HTML
-.B <strong>
-tag.
-.TP
-Code
-To indicate a span of code, wrap it with backtick quotes
-.RB ( ` ).
-Unlike a code block, a code span indicates code within a
-normal paragraph.
-To include a literal backtick character within a code span, you can use
-multiple backticks as the opening and closing delimiters:
-.IP
-.EX
- ``There is a literal backtick (`) here.``
-.EE
-.TP
-Images
-Markdown image syntax is intended to resemble that
-for links, allowing for two styles, once again
-.I inline
-and
-.IR reference .
-The syntax is as for each respective style of link, described above, but
-prefixed with an exclamation mark character
-.RB ( ! ).
-Inline image syntax looks like this:
-.IP
-.EX
- ![Alt text](/path/to/img.jpg "Optional title")
-.EE
-.IP
-That is:
-An exclamation mark;
-followed by a set of square brackets containing the `alt'
-attribute text for the image;
-followed by a set of parentheses containing the URL or path to
-the image, and an optional `title' attribute enclosed in double
-or single quotes.
-.IP
-Reference-style image syntax looks like this:
-.IP
-.EX
- ![Alt text][id]
-.EE
-.IP
-Where
-.I id
-is a label used as for reference-style URL links, described above.
-.SS Convenience
-.TF W
-.PD
-.TP
-Automatic Links
-There is a shortcut style for creating ``automatic''
-links for URLs and email addresses.
-Surround the URL
-or address with angle brackets.
-.TP
-Backslash Escapes
-Use backslash escapes to generate literal
-characters which would otherwise have special meaning in Markdown's
-formatting syntax.
-.TP
-Inline HTML
-For markup that is not covered by Markdown's
-syntax, simply use the
-.SM HTML
-directly.
-The only restrictions are that block-level
-.SM HTML
-elements --
-.BR <div> ,
-.BR <table> ,
-.BR <pre> ,
-.BR <p> ,
-etc. -- must be separated from surrounding
-content by blank lines, and the start and end tags of the block should
-not be indented with tabs or spaces. Markdown formatting syntax is
-not processed within block-level
-.SM HTML
-tags.
-.IP
-Span-level
-.SM HTML
-tags -- e.g.
-.BR <span> ,
-.BR <cite> ,
-or
-.B <del>
--- can be
-used anywhere in a Markdown
-paragraph, list item, or heading.
-It is permitted to use
-.SM HTML
-tags instead of Markdown formatting; e.g.
-.SM HTML
-.B <a>
-or
-.B <img>
-tags instead of Markdown's
-link or image syntax.
-Unlike block-level
-.SM HTML
-tags, Markdown
-syntax
-.I is
-processed within the elements of span-level tags.
-.TP
-Automatic Special Character Escapes
-To be displayed literally in a user agent, the characters
-.B <
-and
-.B &
-must appear as escaped entities in
-.SM HTML
-source, e.g.
-.B &lt;
-and
-.BR &amp; .
-Markdown
-allows natural use of these characters, taking care of
-the necessary escaping.
-The ampersand part of a directly-used
-.SM HTML
-entity remains unchanged; otherwise it will be translated
-into
-.BR &amp; .
-Inside code spans and blocks, angle brackets and
-ampersands are always encoded automatically.
-This makes it easy to use Markdown to write about
-.SM HTML
-code.
-.PP
-.SS Smarty Pants
-The
-.IR markdown (1)
-utility transforms a few plain text symbols into their typographically-fancier
-.SM HTML
-entity equivalents.
-These are extensions to the standard Markdown syntax.
-.TF W
-.PD
-.TP
-Punctuation
-Input single- and double-quotes are transformed
-into ``curly'' quote entities in the output (e.g.,
-.B 'text'
-becomes
-.BR &lsquo;text&rsquo; ).
-Input double-dashes
-.RB ( -- )
-and triple-dashes become en- and em-dashes, respectively,
-while a series of three dots
-.RB ( ... )
-in the input becomes an ellipsis entity
-.RB ( &hellip; )
-in the
-.SM HTML
-output.
-.TP
-Symbols
-Three other transformations replace the common plain-text shorthands
-.BR (c) ,
-.BR (r) ,
-and
-.BR (tm)
-from the input with their respective
-.SM HTML
-entities. (As in
-.B (c)
-becoming
-.BR &copy; ,
-the Copyright symbol entity.)
-.TP
-Fractions
-A small set of plain-text shorthands for fractions is recognized.
-.B 1/4
-becomes
-.BR &frac14; ,
-for example. These fraction notations are replaced with their
-.SM HTML
-entity equivalents:
-.BR 1/4 ,
-.BR 1/2 ,
-.BR 3/4 .
-.B 1/4th
-and
-.B 3/4ths
-are replaced with their entity and the indicated ordinal suffix letters.
-.PP
-Like the basic Markdown syntax, none of the ``Smarty Pants'' extensions are processed
-inside code blocks or spans.
-.PP
-.SS Discount Extensions
-.IR Markdown (1)
-recognizes some extensions to the Markdown format,
-many of them adopted or adapted from other Markdown
-interpreters or document formatting systems.
-.TF W
-.PD
-.TP
-Pandoc Headers
-If
-.I markdown
-was configured with
-.BR --enable-pandoc-header ,
-the markdown source can have a 3-line Pandoc header in the format of
-.IP
-.EX
-% Title
-% Author
-% Date
-.EE
-.IP
-whose data is available to the
-.IR mkd_doc_title ,
-.IR mkd_doc_author ,
-and
-.I mkd_doc_date
-(in
-.IR markdown (2))
-functions.
-.TP
-Embedded Stylesheets
-Stylesheets may be defined and modified in a
-.B <style>
-block. A style block is parsed like any other block-level
-.SM HTML;
-.B <style>
-starting on column 1, raw
-.SM HTML
-(or, in this case,
-.SM CSS \)
-following it, and either ending with a
-.B </style>
-at the end of the line or at the beginning of a subsequent line.
-.IP
-Style blocks apply to the entire document regardless of where they are defined.
-.TP
-Image Dimensions
-Image specification has been extended with an argument describing image dimensions:
-.BI = height x width.
-For an image 400 pixels high and 300 wide, the new syntax is:
-.IP
-.EX
- ![Alt text](/path/to/image.jpg =400x300 "Title")
-.EE
-.TP
-Pseudo-Protocols
-Pseudo-protocols that may replace the common
-.B http:
-or
-.B mailto:
-have been added to the link syntax described above.
-.IP
-.BR abbr :
-Text following is used as the
-.B title
-attribute of an
-.B abbr
-tag wrapping the link text. So
-.B [LT](abbr:Link Text)
-gives
-.B <abbr title="Link Text">LT</abbr>.
-.IP
-.BR id :
-The link text is marked up and written to the output, wrapped with
-.B <a id=text following>
-and
-.BR </a> .
-.IP
-.BR class :
- The link text is marked up and written to the output, wrapped with
-.B <span class=text following>
-and
-.BR </span> .
-.IP
-.BR raw :
-Text following is written to the output with no further processing.
-The link text is discarded.
-.TP
-Alphabetic Lists
-If
-.I markdown
-was configured with
-.BR --enable-alpha-list ,
-.IP
-.EX
-a. this
-b. is
-c. an alphabetic
-d. list
-.EE
-.IP
-yields an
-.SM HTML
-.B ol
-ordered list.
-.TP
-Definition Lists
-If configured with
-.BR --enable-dl-tag ,
-markup for definition lists is enabled. A definition list item is defined as
-.IP
-.EX
-=term=
- definition
-.EE
-.TP
-Tables
-Tables are specified with a pipe
-.RB ( | )
-and dash
-.RB ( - )
-marking. The markdown text
-.IP
-.EX
-header0|header1
--------|-------
- textA|textB
- textC|textD
-.EE
-.IP
-will produce an
-.SM HTML
-.B table
-of two columns and three rows.
-A header row is designated by ``underlining'' with dashes.
-Declare a column's alignment by affixing a colon
-.RB ( : )
-to the left or right end of the dashes underlining its header.
-In the output, this
-yields the corresponding value for the
-.B align
-attribute on each
-.B td
-cell in the column.
-A colon at both ends of a column's header dashes indicates center alignment.
-.TP
-Relaxed Emphasis
-If configured with
-.BR --relaxed-emphasis ,
-the rules for emphasis are changed so that a single
-.B _
-will not count as an emphasis character in the middle of a word.
-This is useful for documenting some code where
-.B _
-appears frequently, and would normally require a backslash escape.
-.PD
-.SH SEE ALSO
-.IR markdown (1),
-.IR markdown (2)
-.PP
-http://daringfireball.net/projects/markdown/syntax/,
-``Markdown: Syntax''.
-.PP
-http://daringfireball.net/projects/smartypants/,
-``Smarty Pants''.
-.PP
-http://michelf.com/projects/php-markdown/extra/#table,
-``PHP Markdown Extra: Tables''.
View
37 discount-1.5.4/Plan9/mkfile
@@ -1,37 +0,0 @@
-BIN=/$objtype/bin
-CC='cc -D_BSD_EXTENSION'
-
-markdown:
- ape/psh -c 'cd .. && make'
-
-none:V: markdown
-
-test: markdown
- ape/psh -c 'cd ..&& make test'
-
-install: markdown
- cp ../markdown $BIN/markdown
-
-install.progs: install
- cp ../makepage $BIN/makepage
- cp ../mkd2html $BIN/mkd2html
-
-install.libs: install
- cp ../mkdio.h /sys/include/ape/mkdio.h
- cp ../libmarkdown.a /$objtype/lib/ape/libmarkdown.a
-
-install.man: install
- cp markdown.1 /sys/man/1/markdown
- cp markdown.2 /sys/man/2/markdown
- cp markdown.6 /sys/man/6/markdown
-
-installall:V: install.libs install.man install.progs
-
-config:
- ape/psh -c 'cd .. && ./configure.sh $CONFIG'
-
-clean:
- ape/psh -c 'cd .. && make clean'
-
-nuke:
- ape/psh -c 'cd .. && make distclean'
View
16 discount-1.5.4/README
@@ -1,16 +0,0 @@
-DISCOUNT is a implementation of John Gruber's Markdown markup
-language. It implements, as far as I can tell, all of the
-language as described in
-<http://daringfireball.net/projects/markdown/syntax>
-and passes the Markdown test suite at
-<http://daringfireball.net/projects/downloads/MarkdownTest_1.0.zip>
-
-DISCOUNT is free software written by David Parsons <orc@pell.chi.il.us>;
-it is released under a BSD-style license that allows you to do
-as you wish with it as long as you don't attempt to claim it as
-your own work.
-
-Most of the programs included in the DISCOUNT distribution have
-manual pages describing how they work.
-
-The file INSTALL describes how to build and install discount
View
1  discount-1.5.4/VERSION
@@ -1 +0,0 @@
-1.5.4
View
111 discount-1.5.4/amalloc.c
@@ -1,111 +0,0 @@
-/*
- * debugging malloc()/realloc()/calloc()/free() that attempts
- * to keep track of just what's been allocated today.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#define MAGIC 0x1f2e3d4c
-
-struct alist { int magic, size; struct alist *next, *last; };
-
-static struct alist list = { 0, 0, 0, 0 };
-
-static int mallocs=0;
-static int reallocs=0;
-static int frees=0;
-
-void *
-acalloc(int size, int count)
-{
- struct alist *ret = calloc(size + sizeof(struct alist), count);
-
- if ( ret ) {
- ret->magic = MAGIC;
- ret->size = size * count;
- if ( list.next ) {
- ret->next = list.next;
- ret->last = &list;
- ret->next->last = ret;
- list.next = ret;
- }
- else {
- ret->last = ret->next = &list;
- list.next = list.last = ret;
- }
- ++mallocs;
- return ret+1;
- }
- return 0;
-}
-
-
-void*
-amalloc(int size)
-{
- return acalloc(size,1);
-}
-
-
-void
-afree(void *ptr)
-{
- struct alist *p2 = ((struct alist*)ptr)-1;
-
- if ( p2->magic == MAGIC ) {
- p2->last->next = p2->next;
- p2->next->last = p2->last;
- ++frees;
- free(p2);
- }
- else
- free(ptr);
-}
-
-
-void *
-arealloc(void *ptr, int size)
-{
- struct alist *p2 = ((struct alist*)ptr)-1;
- struct alist save;
-
- if ( p2->magic == MAGIC ) {
- save.next = p2->next;
- save.last = p2->last;
- p2 = realloc(p2, sizeof(*p2) + size);
-
- if ( p2 ) {
- p2->size = size;
- p2->next->last = p2;
- p2->last->next = p2;
- ++reallocs;
- return p2+1;
- }
- else {
- save.next->last = save.last;
- save.last->next = save.next;
- return 0;
- }
- }
- return realloc(ptr, size);
-}
-
-
-void
-adump()
-{
- struct alist *p;
-
-
- for ( p = list.next; p && (p != &list); p = p->next ) {
- fprintf(stderr, "allocated: %d byte%s\n", p->size, (p->size==1) ? "" : "s");
- fprintf(stderr, " [%.*s]\n", p->size, p+1);
- }
-
- if ( getenv("AMALLOC_STATISTICS") ) {
- fprintf(stderr, "%d malloc%s\n", mallocs, (mallocs==1)?"":"s");
- fprintf(stderr, "%d realloc%s\n", reallocs, (reallocs==1)?"":"s");
- fprintf(stderr, "%d free%s\n", frees, (frees==1)?"":"s");
- }
-}
View
29 discount-1.5.4/amalloc.h
@@ -1,29 +0,0 @@
-/*
- * debugging malloc()/realloc()/calloc()/free() that attempts
- * to keep track of just what's been allocated today.
- */
-#ifndef AMALLOC_D
-#define AMALLOC_D
-
-#include "config.h"
-
-#ifdef USE_AMALLOC
-
-extern void *amalloc(int);
-extern void *acalloc(int,int);
-extern void *arealloc(void*,int);
-extern void afree(void*);
-extern void adump();
-
-#define malloc amalloc
-#define calloc acalloc
-#define realloc arealloc
-#define free afree
-
-#else
-
-#define adump() (void)1
-
-#endif
-
-#endif/*AMALLOC_D*/
View
2  discount-1.5.4/config.cmd
@@ -1,2 +0,0 @@
-#! /bin/sh
- configure.sh
View
25 discount-1.5.4/config.h
@@ -1,25 +0,0 @@
-/*
- * configuration for markdown, generated Sun Sep 13 13:13:06 CDT 2009
- * by wolf@wolf-mbp.local
- */
-#ifndef __AC_MARKDOWN_D
-#define __AC_MARKDOWN_D 1
-
-
-#define OS_DARWIN 1
-#define DWORD unsigned int
-#define WORD unsigned short
-#define BYTE unsigned char
-#define HAVE_PWD_H 1
-#define HAVE_GETPWUID 1
-#define HAVE_SRANDOM 1
-#define INITRNG(x) srandom((unsigned int)x)
-#define HAVE_RANDOM 1
-#define COINTOSS() (random()&1)
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_FCHDIR 1
-#define TABSTOP 4
-#define PATH_SED "/usr/bin/sed"
-
-#endif/* __AC_MARKDOWN_D */
View
35 discount-1.5.4/config.log
@@ -1,35 +0,0 @@
-[echo ...Configuring for [markdown]
-Looking for cpp
-CPP=[/usr/bin/cpp], CPPFLAGS=[]
-looking for install
- (/usr/bin/install)
-checking out the C compiler
-checking for "volatile" keyword
-checking for "const" keyword
-defining WORD & DWORD scalar types
-/tmp/pd717.c: In function ‘main’:
-/tmp/pd717.c:13: warning: incompatible implicit declaration of built-in function ‘exit’
-/tmp/ngc717.c: In function ‘main’:
-/tmp/ngc717.c:5: warning: initialization makes pointer from integer without a cast
-/tmp/ngc717.c:6: warning: initialization makes pointer from integer without a cast
-./configure.inc: line 1058: 857 Segmentation fault /tmp/ngc$$
-looking for header pwd.h
-looking for the getpwuid function
-looking for the srandom function
-looking for the random function
-looking for the strcasecmp function
-looking for the strncasecmp function
-looking for the fchdir function
-looking for header malloc.h
-test failed: command was cc -c -o /tmp/doto717.o /tmp/ngc717.c
-output:
-/tmp/ngc717.c:2:20: error: malloc.h: No such file or directory
-offending sources:
-/tmp/ngc717.c:
-/* AC_CHECK_HEADERS */
-#include <malloc.h>
-main() { }
-sed is /usr/bin/sed
-generating Makefile
-generating version.c
-generating markdown.1
View
1  discount-1.5.4/config.mak
@@ -1 +0,0 @@
-HAVE_SED = 1
View
5 discount-1.5.4/config.md
@@ -1,5 +0,0 @@
-#! /bin/sh
-# script generated Sun Sep 13 13:13:07 CDT 2009 by configure.sh
-
-test -d "$1" || mkdir -p "$1"
-exit 0
View
27 discount-1.5.4/config.sub
@@ -1,27 +0,0 @@
-s;@CPP@;/usr/bin/cpp;g
-s;@CPPFLAGS@;;g
-s;@INSTALL@;/usr/bin/install;g
-s;@INSTALL_PROGRAM@;/usr/bin/install -s -m 755;g
-s;@INSTALL_DATA@;/usr/bin/install -m 444;g
-s;@INSTALL_DIR@;/Users/wolf/Downloads/discount-1.5.4/config.md;g
-s;@CC@;cc;g
-s;@AR@;/usr/bin/ar;g
-s;@RANLIB@;/usr/bin/ranlib;g
-s;@THEME@;;g
-s;@TABSTOP@;4;g
-s;@AMALLOC@;;g
-s;@STRICT@;.\";g
-s;@LIBS@;;g
-s;@CONFIGURE_FILES@;config.cmd config.sub config.h config.mak config.log config.md;g
-s;@GENERATED_FILES@;Makefile version.c markdown.1;g
-s;@CFLAGS@;-g;g
-s;@LDFLAGS@;-g;g
-s;@srcdir@;/Users/wolf/Downloads/discount-1.5.4;g
-s;@prefix@;/usr/local;g
-s;@exedir@;/usr/local/bin;g
-s;@sbindir@;/usr/local/sbin;g
-s;@libdir@;/usr/local/lib;g
-s;@libexec@;/usr/local/lib;g
-s;@confdir@;/etc;g
-s;@mandir@;/usr/local/man;g
-s;@SED@;/usr/bin/sed;g
View
1,459 discount-1.5.4/configure.inc
@@ -1,1459 +0,0 @@
-# @(#) configure.inc 1.42@(#)
-# Copyright (c) 1999-2007 David Parsons. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# 3. My name may not be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY DAVID PARSONS ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID
-# PARSONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-
-#
-# this preamble code is executed when this file is sourced and it picks
-# interesting things off the command line.
-#
-ac_default_path="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"
-
-ac_standard="--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"
-
-__fail=exit
-
-if dirname B/A 2>/dev/null >/dev/null; then
-__ac_dirname() {
- dirname "$1"
-}
-else
-__ac_dirname() {
- echo "$1" | sed -e 's:/[^/]*$::'
-}
-fi
-
-ac_progname=$0
-ac_configure_command=
-Q=\'
-for x in "$@"; do
- ac_configure_command="$ac_configure_command $Q$x$Q"
-done
-# ac_configure_command="$*"
-
-__d=`__ac_dirname "$ac_progname"`
-if [ "$__d" = "$ac_progname" ]; then
- AC_SRCDIR=`pwd`
-else
- AC_SRCDIR=`cd $__d;pwd`
-fi
-
-__ac_dir() {
- if test -d "$1"; then
- (cd "$1";pwd)
- else
- echo "$1";
- fi
-}
-
-#
-# echo w/o newline
-#
-echononl()
-{
- ${ac_echo:-echo} "${@}$ac_echo_nonl"
-}
-
-#
-# log something to the terminal and to a logfile.
-#
-LOG () {
- echo "$@"
- echo "$@" 1>&5
-}
-
-#
-# log something to the terminal without a newline, and to a logfile with
-# a newline
-#
-LOGN () {
- echononl "$@" 1>&5
- echo "$@"
-}
-
-#
-# log something to the terminal
-#
-TLOG () {
- echo "$@" 1>&5
-}
-
-#
-# log something to the terminal, no newline
-#
-TLOGN () {
- echononl "$@" 1>&5
-}
-
-
-#
-# AC_CONTINUE tells configure not to bomb if something fails, but to
-# continue blithely along
-#
-AC_CONTINUE () {
- __fail="return"
-}
-
-
-#
-# generate a .o file from sources
-#
-__MAKEDOTO() {
- AC_PROG_CC
-
- if $AC_CC -c -o /tmp/doto$$.o "$@" $AC_LIBS 2>/tmp/doto$$.err; then
- rm -f /tmp/doto$$.o /tmp/doto$$.err
- TLOG " (found)"
- return 0
- fi
- rm -f /tmp/doto$$.o
- TLOG " (not found)"
- echo "test failed: command was $AC_CC -c -o /tmp/doto$$.o" "$@" $AC_LIBS
- echo "output:"
- cat /tmp/doto$$.err
- rm -f /tmp/doto$$.err
- echo "offending sources:"
- for x in "$@"; do
- echo "$x:"
- cat $x
- done
- return 1
-}
-
-
-#
-# Emulate gnu autoconf's AC_CHECK_HEADERS() function
-#
-AC_CHECK_HEADERS () {
-
- echo "/* AC_CHECK_HEADERS */" > /tmp/ngc$$.c
- for hdr in $*; do
- echo "#include <$hdr>" >> /tmp/ngc$$.c
- done
- echo "main() { }" >> /tmp/ngc$$.c
-
- LOGN "looking for header $hdr"
-
- if __MAKEDOTO /tmp/ngc$$.c; then
- AC_DEFINE 'HAVE_'`echo $hdr | $AC_UPPERCASE | tr './' '_'` 1
- rc=0
- else
- rc=1
- fi
- rm -f /tmp/ngc$$.c
- return $rc
-}
-
-
-#
-# emulate GNU autoconf's AC_CHECK_FUNCS function
-#
-AC_CHECK_FUNCS () {
- AC_PROG_CC
-
-F=$1
-shift
-rm -f /tmp/ngc$$.c
-
-while [ "$1" ]; do
- echo "#include <$1>" >> /tmp/ngc$$.c
- shift
-done
-
- cat >> /tmp/ngc$$.c << EOF
-main()
-{
-
- $F();
-}
-EOF
-
- LOGN "looking for the $F function"
-
- if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $LIBS; then
- AC_DEFINE `echo ${2:-HAVE_$F} | $AC_UPPERCASE` 1
- TLOG " (found)"
- rc=0
- else
- echo "offending command was:"
- cat /tmp/ngc$$.c
- echo "$AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $LIBS"
- TLOG " (not found)"
- rc=1
- fi
- rm -f /tmp/ngc$$.c /tmp/ngc$$
- return $rc
-}
-
-
-#
-# check to see if some structure exists
-#
-# usage: AC_CHECK_STRUCT structure {include ...}
-#
-AC_CHECK_STRUCT () {
- struct=$1
- shift
-
- rm -f /tmp/ngc$$.c
-
- for include in $*; do
- echo "#include <$include>" >> /tmp/ngc$$.c
- done
-
- cat >> /tmp/ngc$$.c << EOF
-main()
-{
- struct $struct foo;
-}
-EOF
-
- LOGN "looking for struct $struct"
-
- if __MAKEDOTO /tmp/ngc$$.c; then
- AC_DEFINE HAVE_STRUCT_`echo ${struct} | $AC_UPPERCASE`
- rc=0
- else
- rc=1
- fi
- rm -f /tmp/ngc$$.c
- return $rc
-}
-
-
-#
-# check to see if some type exists
-#
-# usage: AC_CHECK_TYPE type {include ...}
-#
-AC_CHECK_TYPE () {
- type=$1
- shift
-
- rm -f /tmp/ngc$$.c
-
- for include in $*; do
- echo "#include <$include>" >> /tmp/ngc$$.c
- done
-
- cat >> /tmp/ngc$$.c << EOF
-main()
-{
- $type foo;
-}
-EOF
-
- LOGN "looking for $type type"
-
- if __MAKEDOTO /tmp/ngc$$.c; then
- AC_DEFINE HAVE_TYPE_`echo ${type} | $AC_UPPERCASE`
- rc=0
- else
- rc=1
- fi
- rm -f /tmp/ngc$$.c
- return $rc
-}
-
-
-#
-# check to see if some structure contains a field
-#
-# usage: AC_CHECK_FIELD structure field {include ...}
-#
-AC_CHECK_FIELD () {
-
- struct=$1
- field=$2
- shift 2
-
- rm -f /tmp/ngc$$.c
-
- for include in $*;do
- echo "#include <$include>" >> /tmp/ngc$$.c
- done
-
- cat >> /tmp/ngc$$.c << EOF
-main()
-{
- struct $struct foo;
-
- foo.$field;
-}
-EOF
-
- LOGN "checking that struct $struct has a $field field"
-
- if __MAKEDOTO /tmp/ngc$$.c; then
- AC_DEFINE HAVE_`echo ${struct}_$field | $AC_UPPERCASE`
- rc=0
- else
- rc=1
- fi
- rm -f /tmp/ngc$$.c
- return $rc
-}
-
-
-#
-# check that the C compiler works
-#
-AC_PROG_CC () {
- test "$AC_CC" && return 0
-
- cat > /tmp/ngc$$.c << \EOF
-#include <stdio.h>
-main()
-{
- puts("hello, sailor");
-}
-EOF
-
- TLOGN "checking the C compiler"
-
- unset AC_CFLAGS AC_LDFLAGS
-
- if [ "$CC" ] ; then
- AC_CC="$CC"
- elif [ "$WITH_PATH" ]; then
- AC_CC=`acLookFor cc`
- elif [ "`acLookFor cc`" ]; then
- # don't specify the full path if the user is looking in their $PATH
- # for a C compiler.
- AC_CC=cc
- fi
-
- # finally check for POSIX c89
- test "$AC_CC" || AC_CC=`acLookFor c89`
-
- if [ ! "$AC_CC" ]; then
- TLOG " (no C compiler found)"
- $__fail 1
- fi
- echo "checking out the C compiler"
-
- $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c
- status=$?
-
- TLOGN " ($AC_CC)"
- if [ $status -eq 0 ]; then
- if $AC_CC -v 2>&1 | grep 'gcc version' >/dev/null; then
- TLOG " oh ick, it looks like gcc"
- IS_BROKEN_CC=T
- else
- TLOG " ok"
- fi
-
- # check that the CFLAGS and LDFLAGS aren't bogus
-
- unset AC_CFLAGS AC_LDFLAGS
-
- if [ "$CFLAGS" ]; then
- test "$CFLAGS" && echo "validating CFLAGS=${CFLAGS}"
- if $AC_CC $CFLAGS -o /tmp/ngc$$.o /tmp/ngc$$.c ; then
- AC_CFLAGS=${CFLAGS:-"-g"}
- test "$CFLAGS" && echo "CFLAGS=\"${CFLAGS}\" are okay"
- elif [ "$CFLAGS" ]; then
- echo "ignoring bogus CFLAGS=\"${CFLAGS}\""
- fi
- else
- AC_CFLAGS=-g
- fi
- if [ "$LDFLAGS" ]; then
- test "$LDFLAGS" && echo "validating LDFLAGS=${LDFLAGS}"
- if $AC_CC $LDFLAGS -o /tmp/ngc$$ /tmp/ngc$$.o; then
- AC_LDFLAGS=${LDFLAGS:-"-g"}
- test "$LDFLAGS" && TLOG "LDFLAGS=\"${LDFLAGS}\" are okay"
- elif [ "$LDFLAGS" ]; then
- TLOG "ignoring bogus LDFLAGS=\"${LDFLAGS}\""
- fi
- else
- AC_LDFLAGS=${CFLAGS:-"-g"}
- fi
- else
- AC_FAIL " does not compile code properly"
- fi
-
- AC_SUB 'CC' "$AC_CC"
-
- rm -f /tmp/ngc$$ /tmp/ngc$$.c /tmp/ngc$$.o
-
- return $status
-}
-
-
-#
-# acLookFor actually looks for a program, without setting anything.
-#
-acLookFor () {
- path=${AC_PATH:-$ac_default_path}
- case "X$1" in
- X-[rx]) __mode=$1
- shift
- ;;
- *) __mode=-x
- ;;
- esac
- oldifs="$IFS"
- for program in $*; do
- IFS=":"
- for x in $path; do
- if [ $__mode $x/$program -a -f $x/$program ]; then
- echo $x/$program
- break 2
- fi
- done
- done
- IFS="$oldifs"
- unset __mode
-}
-
-
-#
-# check that a program exists and set its path
-#
-MF_PATH_INCLUDE () {
- SYM=$1; shift
-
- case X$1 in
- X-[rx]) __mode=$1
- shift
- ;;
- *) unset __mode