diff --git a/README.markdown b/README.markdown index 224b498..97eaba7 100644 --- a/README.markdown +++ b/README.markdown @@ -5,7 +5,16 @@ README MarkdownJ is the pure Java port of Markdown (a text-to-html conversion tool written by John Gruber.) +### Related Projects + +* [markdownj-ant-utils][markdownj-ant-utils] – Markdown-based `FilterReader` for Ant. +* [markdownj-dingus][markdownj-dingus] – [Web Dingus using MarkdownJ][dingus] source. + ### License The project is licensed under a Revised BSD License. Refer to the accompanying LICENSE file. + +[dingus]:http://dingus.markdownj.org +[markdownj-dingus]:https://github.com/myabc/markdownj-dingus/ +[markdownj-ant-utils]:https://github.com/myabc/markdownj-ant-utils/ \ No newline at end of file diff --git a/ant-utils/pom.xml b/ant-utils/pom.xml deleted file mode 100644 index 5da112d..0000000 --- a/ant-utils/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - 4.0.0 - - - org.markdownj - markdownj - 0.4-SNAPSHOT - ../pom.xml - - - jar - - markdownj-ant-utils - MarkdownJ Ant Utils - Utilities for using MarkdownJ with Apache Ant build tool. - - - - ${pom.parent.groupId} - ${pom.parent.artifactId}-core - ${pom.parent.version} - - - org.apache.ant - ant - ${ant.version} - compile - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - - - - ${basedir}/../ - - - diff --git a/ant-utils/src/main/java/org/markdownj/antutils/MarkdownFilter.java b/ant-utils/src/main/java/org/markdownj/antutils/MarkdownFilter.java deleted file mode 100644 index 7ab8f12..0000000 --- a/ant-utils/src/main/java/org/markdownj/antutils/MarkdownFilter.java +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright (c) 2005, Martian Software -Authors: Marty Lamb -http://www.martiansoftware.com/markdownj - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* 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. - -* Neither the name "Markdown", "MarkdownJ" nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -This software is provided by the copyright holders and contributors "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 the copyright owner -or contributors 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. - -*/ -package org.markdownj.antutils; - -import java.io.Reader; -import org.apache.tools.ant.filters.BaseParamFilterReader; -import org.apache.tools.ant.filters.ChainableReader; -import org.markdown.MarkdownProcessor; - -/** - * Provides a Markdown-based FilterReader suitable for use by Ant. - * - *
- * <copy file="${src.file}" tofile="${dest.file}">
- *   <filterchain>
- *     <filterreader classname="org.markdownj.MarkdownFilter"/>
- *   </filterchain>
- * </copy>
- * 
- * @author Marty Lamb - */ -public class MarkdownFilter extends BaseParamFilterReader implements ChainableReader { - - /** - * Stores the characters post markdown - */ - char[] chars = null; - - /** - * The index of the next character to return - */ - int pos = 0; - - /** - * The number of characters in the array (avoid repeated chars.length calls) - */ - int len = 0; - - /** - * Constructor for "dummy" instances. - * - * @see org.apache.tools.ant.filters.BaseFilterReader#BaseFilterReader() - */ - public MarkdownFilter() { - super(); - } - - /** - * Creates a new filtered reader. - * - * @param in A Reader object providing the underlying stream. - * Must not be null. - */ - public MarkdownFilter(Reader reader) { - super(reader); - } - - /** - * Creates a new MarkdownFilter using the passed in - * Reader for instantiation. - * - * @param rdr A Reader object providing the underlying stream. - * Must not be null. - * - * @return a new filter based on this configuration, but filtering - * the specified reader - */ - public Reader chain(Reader reader) { - MarkdownFilter result = new MarkdownFilter(reader); - result.setParameters(this.getParameters()); - return (result); - } - - /** - * Returns the next character in the filtered stream, after performing - * the Markdown processing - * - * @return the next character in the resulting stream, or -1 - * if the end of the resulting stream has been reached - * - * @exception IOException if the underlying stream throws an IOException - * during reading - */ - @Override - public final int read() throws java.io.IOException { - - if (chars == null) { - char[] cbuf = new char[1024]; - StringBuffer buf = new StringBuffer(); - int charsRead = in.read(cbuf); - while (charsRead >= 0) { - buf.append(cbuf, 0, charsRead); - charsRead = in.read(cbuf); - } - MarkdownProcessor markdown = new MarkdownProcessor(); - chars = markdown.markdown(buf.toString()).toCharArray(); - len = chars.length; - } - - return (pos >= len ? -1 : chars[pos++]); - } -} diff --git a/pom.xml b/pom.xml index 2366d31..d287a91 100644 --- a/pom.xml +++ b/pom.xml @@ -242,8 +242,6 @@ software, even if advised of the possibility of such damage. core - ant-utils - www diff --git a/www/gae-deploy b/www/gae-deploy deleted file mode 100755 index 39f5d5d..0000000 --- a/www/gae-deploy +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -mvn war:war -~/Dev/appengine-java-sdk-1.2.1/bin/appcfg.sh update target/www diff --git a/www/pom.xml b/www/pom.xml deleted file mode 100644 index 4f2fb14..0000000 --- a/www/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - 4.0.0 - - - org.markdownj - markdownj - 0.4-SNAPSHOT - ../pom.xml - - - www - war - MarkdownJ Web Dingus - - - - - ${pom.parent.groupId} - ${pom.parent.artifactId}-core - ${pom.parent.version} - - - - javax.servlet - servlet-api - 2.5 - provided - - - - javax.servlet.jsp - jsp-api - 2.1 - provided - - - - junit - junit - 3.8.1 - test - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - ${project.build.sourceEncoding} - - - - org.apache.maven.plugins - maven-resources-plugin - 2.2 - - ${project.build.sourceEncoding} - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.14 - - / - 3 - - - - www - - - - ${basedir}/../ - UTF-8 - gfv3 - - diff --git a/www/src/main/webapp/WEB-INF/appengine-web.xml b/www/src/main/webapp/WEB-INF/appengine-web.xml deleted file mode 100644 index fbaa2fe..0000000 --- a/www/src/main/webapp/WEB-INF/appengine-web.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - markdownjdingus - 1 - diff --git a/www/src/main/webapp/WEB-INF/sun-web.xml b/www/src/main/webapp/WEB-INF/sun-web.xml deleted file mode 100644 index 5c72d1c..0000000 --- a/www/src/main/webapp/WEB-INF/sun-web.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - / - - - - Keep a copy of the generated servlet class' java code. - - - diff --git a/www/src/main/webapp/WEB-INF/web.xml b/www/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index c63d0c7..0000000 --- a/www/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - MarkdownJ Web Dingus - - - index.jsp - - - diff --git a/www/src/main/webapp/index.jsp b/www/src/main/webapp/index.jsp deleted file mode 100644 index 3adfa35..0000000 --- a/www/src/main/webapp/index.jsp +++ /dev/null @@ -1,419 +0,0 @@ -<%@ page language="java" import="org.markdownj.MarkdownProcessor" pageEncoding="utf-8" %> -<% - MarkdownProcessor mp = new MarkdownProcessor(); - String markup = request.getParameter("markdown"); - String view = request.getParameter("view"); - - // determine the view to show - boolean showSource = true; - boolean showPreview = true; - - if (view != null) { - if ("source".equals(view)) { - showSource = true; - showPreview = false; - } else if ("preview".equals(view)) { - showSource = false; - showPreview = true; - }; // otherwise, default to showing both - } -%> - - - - -MarkdownJ - Markdown in Java - - - - -
- - - - - - - -
-
-
-

Markdown Source:

- - -
-
-<%-- -Filter:  ---%> -Results:  -
- - -
- -
-
- -<% if (markup != null) { - String html = mp.markdown(markup); - //java.io.FileWriter log = new java.io.FileWriter("/home/www/markdown/log/" + System.currentTimeMillis() + ".log"); - //log.write(markup); - //log.close(); -%> - <% if(showSource) { %> -

HTML Source:

-
- -
- <% } %> - <% if(showPreview) { %> -

HTML Preview:

-
<%= html %>
- <% } %> -<% } %> - -<% -java.util.Calendar now = java.util.Calendar.getInstance(); -int year = now.get(java.util.Calendar.YEAR); -%> - - -
-
- - - - -