Skip to content

Commit

Permalink
fix(okidoc-site): Fixes rendering for long types
Browse files Browse the repository at this point in the history
fixes #34
  • Loading branch information
bodia-uz authored Sep 11, 2018
1 parent cc105c0 commit 0439eb6
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`buildMarkdown for API class should render markdown for getters/setters
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand All @@ -37,7 +37,7 @@ exports[`buildMarkdown for API class should render markdown for getters/setters
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -69,7 +69,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -103,7 +103,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -125,7 +125,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -201,7 +201,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -223,7 +223,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -254,7 +254,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -276,7 +276,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -308,7 +308,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -329,7 +329,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -360,7 +360,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -381,7 +381,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -412,7 +412,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -445,7 +445,7 @@ myMethod comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -487,7 +487,7 @@ myMethod1 comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -509,7 +509,7 @@ myMethod1 comment
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -538,7 +538,7 @@ myMethod2 comment
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -560,7 +560,7 @@ myMethod2 comment
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -597,7 +597,7 @@ creates new Component
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -633,7 +633,7 @@ myFunc1 description
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -655,7 +655,7 @@ myFunc1 description
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -686,7 +686,7 @@ myFunc2 description
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -717,7 +717,7 @@ myFunc2 description
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -757,7 +757,7 @@ exports[`buildMarkdown for functions should render valid markdown with UnionType
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -767,7 +767,7 @@ exports[`buildMarkdown for functions should render valid markdown with UnionType
<code>fn</code>
</td>
<td>
<code>function(<code>value</code>: (string | null)): void</code>
<code class=\\"function-type\\">function(<code>value</code>: (string | null)): void</code>
<p>event handler</p>
</td>
</tr>
Expand All @@ -788,7 +788,7 @@ exports[`buildMarkdown for functions should render valid markdown with function
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -807,7 +807,7 @@ exports[`buildMarkdown for functions should render valid markdown with function
<code>fn</code>
</td>
<td>
<code>function(<code>name</code>: string, <code>data</code>: Object): any</code>
<code class=\\"function-type\\">function(<code>name</code>: string, <code>data</code>: Object): any</code>
<p>event handler</p>
</td>
</tr>
Expand All @@ -828,7 +828,7 @@ exports[`buildMarkdown for functions should render valid markdown with function
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand All @@ -837,7 +837,7 @@ exports[`buildMarkdown for functions should render valid markdown with function
<td class=\\"param\\">
</td>
<td>
<code>function(<code>flag</code>: boolean): void</code>
<code class=\\"function-type\\">function(<code>flag</code>: boolean): void</code>
<p>myFunc result function</p>
</td>
</tr>
Expand All @@ -860,7 +860,7 @@ create new entity
<table>
<thead>
<tr>
<th>ARGUMENTS</th>
<th class=\\"title\\">ARGUMENTS</th>
<th></th>
</tr>
</thead>
Expand All @@ -882,7 +882,7 @@ create new entity
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand All @@ -908,15 +908,15 @@ create new entity
<code>updateTitle</code>
</td>
<td>
<code>function(<code>id</code>: string, <code>title</code>: string): Promise&#x3C;any></code>
<code class=\\"function-type\\">function(<code>id</code>: string, <code>title</code>: string): Promise&#x3C;any></code>
</td>
</tr>
<tr>
<td class=\\"param\\">
<code>destroy</code>
</td>
<td>
<code>function(): void</code>
<code class=\\"function-type\\">function(): void</code>
<p>destroy entity</p>
</td>
</tr>
Expand All @@ -937,7 +937,7 @@ exports[`buildMarkdown with ApplicationType as return type should render markdow
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th><div class=\\"type\\">Array&#x3C;IResult></div></th>
</tr>
</thead>
Expand Down Expand Up @@ -975,7 +975,7 @@ exports[`buildMarkdown with ApplicationType as return type should render markdow
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -1005,7 +1005,7 @@ exports[`buildMarkdown with ApplicationType as return type should render markdow
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th><div class=\\"type\\">Promise&#x3C;IResult></div></th>
</tr>
</thead>
Expand Down Expand Up @@ -1043,7 +1043,7 @@ exports[`buildMarkdown with ApplicationType as return type should render markdow
<table>
<thead>
<tr>
<th>RETURN VALUE</th>
<th class=\\"title\\">RETURN VALUE</th>
<th></th>
</tr>
</thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ function renderMultilineHTML(node) {
return cleanUpMultilineHTML(renderHTML(node));
}

export { renderInlineHTML, renderMultilineHTML, cleanUpMultilineHTML };
export {
renderInlineHTML,
renderMultilineHTML,
cleanUpInlineHTML,
cleanUpMultilineHTML,
};

export default renderHTML;
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function renderParamsHTML(params, { title, applicationType }) {
<table>
<thead>
<tr>
<th>${title}</th>
<th class="title">${title}</th>
<th>${
applicationType
? `<div class="type">${renderType(applicationType)}</div>`
Expand All @@ -70,7 +70,9 @@ function renderParamsHTML(params, { title, applicationType }) {
${
!isUnionWithLiterals(param)
? hasType(param, Syntax.FunctionType)
? `<code>${renderType(param.type)}</code>`
? `<code class="function-type">${renderType(
param.type,
)}</code>`
: `<div class="type">${renderType(param.type)}</div>`
: ''
}
Expand Down
Loading

0 comments on commit 0439eb6

Please sign in to comment.