Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support API docs having multiline code segments. #1430

Merged
merged 4 commits into from
Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion findbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
</Match>
<Match>
<Class name="io.siddhi.core.table.holder.IndexEventHolder"/>
<Bug pattern="EI_EXPOSE_REP"/>
<Bug pattern="EI_EXPOSE_REP, SE_TRANSIENT_FIELD_NOT_RESTORED"/>
</Match>
<Match>
<Class name="io.siddhi.core.table.holder.SnapshotableIndexEventHolder"/>
Expand Down Expand Up @@ -212,6 +212,10 @@
<Class name="io.siddhi.core.util.snapshot.state.SingleSyncStateHolder"/>
<Bug pattern="DC_DOUBLECHECK"/>
</Match>
<Match>
<Class name="io.siddhi.doc.gen.core.utils.DocumentationUtils"/>
<Bug pattern="NP_NULL_ON_SOME_PATH_EXCEPTION"/>
</Match>


<Match>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ public void receive(Event[] inEvents) {
long timeElapsed = endTime - startTime;
AssertJUnit.assertEquals("Event arrived", true, eventArrived);
AssertJUnit.assertEquals("Event count", 400 * 3, inEventCount);
AssertJUnit.assertTrue("Event processing time", timeElapsed < 400);
AssertJUnit.assertTrue("Event processing time", timeElapsed < 1000);
siddhiAppRuntime.shutdown();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ public Object exec(List args) throws TemplateModelException {
inputString = replaceNewLines(inputString);

inputString = inputString.replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");
inputString = inputString.replaceAll("```([^```]*)```", "<pre>$1</pre>");
inputString = inputString.replaceAll("```([^```]*)```",
"</p><pre>$1</pre><p style=\"word-wrap: break-word;margin: 0;\">");
inputString = inputString.replaceAll("`([^`]*)`", "<code>$1</code>");

return inputString;
return "<p style=\"word-wrap: break-word;margin: 0;\">" + inputString + "</p>";
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
<#else>
### ${extension.name} <@utils.renderLinkToExtensionTypeDocWB extensionType=extensionType/>
</#if>
<p style="word-wrap: break-word">${formatDescription(extension.description)}</p>
<p></p>
${formatDescription(extension.description)}
<p></p>
<#if extension.originName??>
<p><i>Origin: ${extension.originName}:${extension.originVersion}</i></p>
</#if>
Expand Down Expand Up @@ -129,7 +131,7 @@ define function <FunctionName>[${extension.name}] return <type> {
<#items as systemParameter>
<tr>
<td style="vertical-align: top">${systemParameter.name}</td>
<td style="vertical-align: top; word-wrap: break-word">${formatDescription(systemParameter.description)}</td>
<td style="vertical-align: top;">${formatDescription(systemParameter.description)}</td>
<td style="vertical-align: top">${systemParameter.defaultValue}</td>
<td style="vertical-align: top">${systemParameter.possibleParameters?join("<br>", "")}</td>
</tr>
Expand All @@ -149,7 +151,7 @@ define function <FunctionName>[${extension.name}] return <type> {
<#items as returnAttribute>
<tr>
<td style="vertical-align: top">${returnAttribute.name}</td>
<td style="vertical-align: top; word-wrap: break-word">${formatDescription(returnAttribute.description)}</td>
<td style="vertical-align: top;">${formatDescription(returnAttribute.description)}</td>
<td style="vertical-align: top">${returnAttribute.type?join("<br>", "")}</td>
</tr>
</#items>
Expand All @@ -166,8 +168,9 @@ define function <FunctionName>[${extension.name}] return <type> {
```
${example.syntax}
```
<p style="word-wrap: break-word">${formatDescription(example.description)}</p>

<p></p>
${formatDescription(example.description)}
<p></p>
</#items>
</#list>
</#list>
Expand Down