diff options
author | James Moger <james.moger@gitblit.com> | 2011-07-01 21:17:28 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-07-01 21:17:28 -0400 |
commit | d9f68798555e5ba8b4f7ddecf4a8cabbe9bb161a (patch) | |
tree | f9b2b5751b908ae341836cdd7052c0a44147e80c /src/com/gitblit/utils/MarkdownUtils.java | |
parent | 892570d96cdfaf4779c1e92c89d76dabf78be361 (diff) | |
download | gitblit-d9f68798555e5ba8b4f7ddecf4a8cabbe9bb161a.tar.gz gitblit-d9f68798555e5ba8b4f7ddecf4a8cabbe9bb161a.zip |
Documentation. Added JavaDoc comments.
Diffstat (limited to 'src/com/gitblit/utils/MarkdownUtils.java')
-rw-r--r-- | src/com/gitblit/utils/MarkdownUtils.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/MarkdownUtils.java b/src/com/gitblit/utils/MarkdownUtils.java index 697fa99b..c7c1f9fe 100644 --- a/src/com/gitblit/utils/MarkdownUtils.java +++ b/src/com/gitblit/utils/MarkdownUtils.java @@ -23,8 +23,21 @@ import java.io.StringWriter; import org.tautua.markdownpapers.Markdown;
import org.tautua.markdownpapers.parser.ParseException;
+/**
+ * Utility methods for transforming raw markdown text to html.
+ *
+ * @author James Moger
+ *
+ */
public class MarkdownUtils {
+ /**
+ * Returns the html version of the markdown source text.
+ *
+ * @param markdown
+ * @return html version of markdown text
+ * @throws java.text.ParseException
+ */
public static String transformMarkdown(String markdown) throws java.text.ParseException {
try {
return transformMarkdown(new StringReader(markdown));
@@ -33,6 +46,14 @@ public class MarkdownUtils { }
}
+ /**
+ * Returns the html version of the markdown source reader. The reader is
+ * closed regardless of success or failure.
+ *
+ * @param markdownReader
+ * @return html version of the markdown text
+ * @throws java.text.ParseException
+ */
public static String transformMarkdown(Reader markdownReader) throws java.text.ParseException {
// Read raw markdown content and transform it to html
StringWriter writer = new StringWriter();
|