From: Freddy Mallet Date: Sat, 23 Apr 2011 21:34:08 +0000 (+0200) Subject: Add some javadoc to the Sonar Markdown module X-Git-Tag: 2.8~135 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e9c89df95a32fae52406c4400a76a68121a1f3d9;p=sonarqube.git Add some javadoc to the Sonar Markdown module --- diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlCodeChannel.java b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlCodeChannel.java index 4fd5d3fd11c..b2601557b34 100644 --- a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlCodeChannel.java +++ b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlCodeChannel.java @@ -21,6 +21,11 @@ package org.sonar.markdown; import org.sonar.channel.RegexChannel; +/** + * Markdown treats double simple quotes ('') as indicators of code. Text wrapped with two '' will be wrapped with an HTML tag. + * + * E.g., the input ''printf()'' will produce printf() + */ class HtmlCodeChannel extends RegexChannel { public HtmlCodeChannel() { diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlEmphasisChannel.java b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlEmphasisChannel.java index ffaf0ac60e7..bb53dd8a43e 100644 --- a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlEmphasisChannel.java +++ b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlEmphasisChannel.java @@ -21,6 +21,11 @@ package org.sonar.markdown; import org.sonar.channel.RegexChannel; +/** + * Markdown treats asterisks (*) as indicators of emphasis. Text wrapped with one * will be wrapped with an HTML tag. + * + * E.g., the input *word* will produce work + */ class HtmlEmphasisChannel extends RegexChannel { public HtmlEmphasisChannel() { diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlEndOfLineChannel.java b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlEndOfLineChannel.java index d7ed7afcdbd..e990b0a9584 100644 --- a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlEndOfLineChannel.java +++ b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlEndOfLineChannel.java @@ -21,6 +21,11 @@ package org.sonar.markdown; import org.sonar.channel.RegexChannel; +/** + * Markdown replace any line return by an HTML
+ * tag. + * + */ class HtmlEndOfLineChannel extends RegexChannel { public HtmlEndOfLineChannel() { diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlUrlChannel.java b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlUrlChannel.java index 14933ca029a..7080a6abe3f 100644 --- a/sonar-markdown/src/main/java/org/sonar/markdown/HtmlUrlChannel.java +++ b/sonar-markdown/src/main/java/org/sonar/markdown/HtmlUrlChannel.java @@ -21,6 +21,10 @@ package org.sonar.markdown; import org.sonar.channel.RegexChannel; +/** + * Markdown will wrap any URL with an HTML tag. + * + */ class HtmlUrlChannel extends RegexChannel { public HtmlUrlChannel() { @@ -29,6 +33,6 @@ class HtmlUrlChannel extends RegexChannel { @Override protected void consume(CharSequence token, MarkdownOutput output) { - output.append("" + token + ""); + output.append("" + token + ""); } } diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/IdentifierAndNumberChannel.java b/sonar-markdown/src/main/java/org/sonar/markdown/IdentifierAndNumberChannel.java index 74b8dffb3b3..126f99d6013 100644 --- a/sonar-markdown/src/main/java/org/sonar/markdown/IdentifierAndNumberChannel.java +++ b/sonar-markdown/src/main/java/org/sonar/markdown/IdentifierAndNumberChannel.java @@ -21,6 +21,9 @@ package org.sonar.markdown; import org.sonar.channel.RegexChannel; +/** + * Channel used only to improve performances of the Markdown engine by consuming any sequence of letter or digit. + */ class IdentifierAndNumberChannel extends RegexChannel { public IdentifierAndNumberChannel() { diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/MarkdownEngine.java b/sonar-markdown/src/main/java/org/sonar/markdown/MarkdownEngine.java index 6a7f84dd7d4..773126ac166 100644 --- a/sonar-markdown/src/main/java/org/sonar/markdown/MarkdownEngine.java +++ b/sonar-markdown/src/main/java/org/sonar/markdown/MarkdownEngine.java @@ -26,6 +26,9 @@ import org.sonar.channel.Channel; import org.sonar.channel.ChannelDispatcher; import org.sonar.channel.CodeReader; +/** + * Entry point of the Markdown library + */ public class MarkdownEngine { private MarkdownOutput output; diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/package-info.java b/sonar-markdown/src/main/java/org/sonar/markdown/package-info.java new file mode 100644 index 00000000000..b31bf274082 --- /dev/null +++ b/sonar-markdown/src/main/java/org/sonar/markdown/package-info.java @@ -0,0 +1,25 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +/** + * Basic implementation of the Markdown markup language (see http://en.wikipedia.org/wiki/Markdown) + * + */ +package org.sonar.markdown; +