Skip to content

Commit c656d08

Browse files
committed
fix: style and misspell in docs
1 parent dc4f110 commit c656d08

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

docs/interpreter/markdown.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ The markdown interpreter provides github flavored markdown.
4747

4848
<img src="../assets/themes/zeppelin/img/docs-img/markdown-example-github-flavored-parser.png" width="70%" />
4949

50-
### Supproted Plugins
50+
### Supported Plugins
5151

52-
`pegdown` parser provides [YUML](http://yuml.me/) and [Websequence](https://www.websequencediagrams.com/) extensions
52+
- [YUML](http://yuml.me/)
53+
- [Websequence](https://www.websequencediagrams.com/)
5354

5455
<img src="../assets/themes/zeppelin/img/docs-img/markdown-example-pegdown-parser.png" width="70%" />
5556

markdown/src/main/java/org/apache/zeppelin/markdown/PegdownWebSequencelPlugin.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@
4242
*/
4343
public class PegdownWebSequencelPlugin extends Parser implements BlockPluginParser {
4444

45+
private static final String URL_WEBSEQUENCE = "http://www.websequencediagrams.com";
46+
4547
public PegdownWebSequencelPlugin() {
4648
super(PegdownParser.OPTIONS,
4749
PegdownParser.PARSING_TIMEOUT_AS_MILLIS,
4850
DefaultParseRunnerProvider);
4951
}
5052

51-
public PegdownWebSequencelPlugin(Integer options,
52-
Long maxParsingTimeInMillis,
53-
ParseRunnerProvider parseRunnerProvider,
53+
public PegdownWebSequencelPlugin(Integer options, Long millis, ParseRunnerProvider provider,
5454
PegDownPlugins plugins) {
55-
super(options, maxParsingTimeInMillis, parseRunnerProvider, plugins);
55+
super(options, millis, provider, plugins);
5656
}
5757

5858
public static final String TAG = "%%%";
@@ -86,14 +86,15 @@ Rule block() {
8686
new TextNode(""))));
8787
}
8888

89-
public static String createWebsequenceUrl(String style,
90-
String content) {
89+
public static String createWebsequenceUrl(String style, String content) {
9190

9291
style = StringUtils.defaultString(style, "default");
9392

9493
OutputStreamWriter writer = null;
9594
BufferedReader reader = null;
9695

96+
String apiUrl = "";
97+
9798
try {
9899
String query = new StringBuilder()
99100
.append("style=")
@@ -103,7 +104,7 @@ public static String createWebsequenceUrl(String style,
103104
.append("&apiVersion=1")
104105
.toString();
105106

106-
URL url = new URL("http://www.websequencediagrams.com");
107+
URL url = new URL(URL_WEBSEQUENCE);
107108
URLConnection conn = url.openConnection();
108109
conn.setDoOutput(true);
109110
writer = new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8);
@@ -128,16 +129,16 @@ public static String createWebsequenceUrl(String style,
128129
int end = json.indexOf("\"", start);
129130

130131
if (start != -1 && end != -1) {
131-
return "http://www.websequencediagrams.com/" + json.substring(start, end);
132+
apiUrl = URL_WEBSEQUENCE + "/" + json.substring(start, end);
132133
}
133134
} catch (IOException e) {
134-
throw new RuntimeException("Failed to get proper response from websequencediagrams.com");
135+
throw new RuntimeException("Failed to get proper response from websequencediagrams.com", e);
135136
} finally {
136137
IOUtils.closeQuietly(writer);
137138
IOUtils.closeQuietly(reader);
138139
}
139140

140-
return "";
141+
return apiUrl;
141142
}
142143

143144
@Override

0 commit comments

Comments
 (0)