|
|
|
@ -4,6 +4,7 @@ |
|
|
|
|
import { onMount } from 'svelte'; |
|
|
|
|
import Layout from '$/client/Layout.svelte'; |
|
|
|
|
import Icon from '$/client/components/Icon.svelte'; |
|
|
|
|
import Markdown from '$/client/components/Markdown.svelte'; |
|
|
|
|
import Blockstart from "$/client/components/Blockstart.svelte"; |
|
|
|
|
import Code from "$/client/components/Code.svelte"; |
|
|
|
|
import api from "$/client/api.js"; |
|
|
|
@ -18,6 +19,7 @@ |
|
|
|
|
|
|
|
|
|
docs_data = status === 200 ? data : {}; |
|
|
|
|
url = to_load; |
|
|
|
|
console.log(docs_data); |
|
|
|
|
window.scrollTo(0, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -51,54 +53,125 @@ |
|
|
|
|
overflow-y: auto; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#content { |
|
|
|
|
right { |
|
|
|
|
display: flex; |
|
|
|
|
flex-direction: column; |
|
|
|
|
min-height: 100vh; |
|
|
|
|
height: 100vh; |
|
|
|
|
max-height: 100vh; |
|
|
|
|
overflow-y: auto; |
|
|
|
|
padding: 0.5rem; |
|
|
|
|
|
|
|
|
|
width: calc(100vw - 300px); |
|
|
|
|
min-width: calc(100vw - 300px); |
|
|
|
|
max-width: calc(100vw - 300px); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export > heading { |
|
|
|
|
display: flex; |
|
|
|
|
flex-direction: column; |
|
|
|
|
background-color: var(--color-bg-secondary); |
|
|
|
|
border: 1px solid var(--value3); |
|
|
|
|
width: 100%; |
|
|
|
|
padding: 0.5rem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export > heading h4 { |
|
|
|
|
margin: 0px !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export > heading meta-data { |
|
|
|
|
display: grid; |
|
|
|
|
gap: 0.5rem; |
|
|
|
|
grid-template-columns: repeat(4, 1fr); |
|
|
|
|
grid-template-rows: auto; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export { |
|
|
|
|
margin-top: 1rem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export > info { |
|
|
|
|
display: block; |
|
|
|
|
padding: 0.5rem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export > info commment { |
|
|
|
|
display: block; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Layout footer={ false} header={ false } centered={ true } fullscreen={ true }> |
|
|
|
|
<Blockstart> |
|
|
|
|
<block class="horizontal"> |
|
|
|
|
<sidebar> |
|
|
|
|
<top><h4><a href="/" use:link><Icon name="chevrons-up" /> Docs</a></h4></top> |
|
|
|
|
<items> |
|
|
|
|
{#each Object.keys(index) as item} |
|
|
|
|
<a class:active={ item === url } href="/docs/{item}" use:link>{item}</a> |
|
|
|
|
{/each} |
|
|
|
|
</items> |
|
|
|
|
</sidebar> |
|
|
|
|
|
|
|
|
|
<right id="content" style="--pad: 0.5rem;"> |
|
|
|
|
{#if docs_data} |
|
|
|
|
{#each docs_data.exports as exp} |
|
|
|
|
<h1>{ url }</h1> |
|
|
|
|
<h2>{exp.name}</h2> |
|
|
|
|
<sidebar> |
|
|
|
|
<top><h4><a href="/" use:link><Icon name="chevrons-up" /> Docs</a></h4></top> |
|
|
|
|
<items> |
|
|
|
|
{#each Object.keys(index) as item} |
|
|
|
|
<a class:active={ item === url } href="/docs/{item}" use:link>{item}</a> |
|
|
|
|
{/each} |
|
|
|
|
</items> |
|
|
|
|
</sidebar> |
|
|
|
|
|
|
|
|
|
<right> |
|
|
|
|
<h1>{ url }</h1> |
|
|
|
|
{#if docs_data} |
|
|
|
|
{#each docs_data.exports as exp} |
|
|
|
|
{#if exp.isa === "class"} |
|
|
|
|
<h2>Class: { exp.name }</h2> |
|
|
|
|
<comment> |
|
|
|
|
{#if exp.comment} |
|
|
|
|
<pre> |
|
|
|
|
{ exp.comment.value } |
|
|
|
|
</pre> |
|
|
|
|
{@html exp.comment} |
|
|
|
|
{/if} |
|
|
|
|
{#if exp.isa === "class"} |
|
|
|
|
{#each exp.methods as method} |
|
|
|
|
<h4>{ method.name }</h4> |
|
|
|
|
</comment> |
|
|
|
|
<Code content={ exp.code } language="javascript" /> |
|
|
|
|
|
|
|
|
|
{#each exp.methods as member} |
|
|
|
|
<export> |
|
|
|
|
<heading> |
|
|
|
|
<h4>{ member.name }</h4> |
|
|
|
|
<meta-data> |
|
|
|
|
{docs_data.source}:{ member.line_start } |
|
|
|
|
<em>{ member.isa }</em> |
|
|
|
|
{#if member.static}<b>static</b>{/if} |
|
|
|
|
{#if member.async}<b>async</b>{/if} |
|
|
|
|
{#if member.generator}<b>generator</b>{/if} |
|
|
|
|
</meta-data> |
|
|
|
|
</heading> |
|
|
|
|
<info> |
|
|
|
|
{#if exp.comment} |
|
|
|
|
<pre> |
|
|
|
|
{ exp.comment.value } |
|
|
|
|
</pre> |
|
|
|
|
<comment> |
|
|
|
|
{ @html exp.comment } |
|
|
|
|
</comment> |
|
|
|
|
{/if} |
|
|
|
|
<Code content={ method.code } language="javascript" /> |
|
|
|
|
{/each} |
|
|
|
|
{:else} |
|
|
|
|
<Code content={ exp.code } language="javascript" /> |
|
|
|
|
{/if} |
|
|
|
|
<h4>Signature</h4> |
|
|
|
|
<Code content={ member.code } language="javascript" /> |
|
|
|
|
</info> |
|
|
|
|
</export> |
|
|
|
|
{/each} |
|
|
|
|
{:else} |
|
|
|
|
<export> |
|
|
|
|
<heading> |
|
|
|
|
<h4> {exp.name}</h4> |
|
|
|
|
<meta-data> |
|
|
|
|
{docs_data.source}:{ exp.line_start } |
|
|
|
|
<em>{ exp.isa }</em> |
|
|
|
|
{#if exp.static}<b>static</b>{/if} |
|
|
|
|
{#if exp.async}<b>async</b>{/if} |
|
|
|
|
{#if exp.generator}<b>generator</b>{/if} |
|
|
|
|
</meta-data> |
|
|
|
|
</heading> |
|
|
|
|
<info> |
|
|
|
|
{#if exp.comment} |
|
|
|
|
<comment> |
|
|
|
|
{@html exp.comment} |
|
|
|
|
</comment> |
|
|
|
|
{/if} |
|
|
|
|
<h4>Signature</h4> |
|
|
|
|
<Code content={ exp.code } language="javascript" /> |
|
|
|
|
</info> |
|
|
|
|
</export> |
|
|
|
|
{/if} |
|
|
|
|
</right> |
|
|
|
|
</block> |
|
|
|
|
</Blockstart> |
|
|
|
|
{/each} |
|
|
|
|
{/if} |
|
|
|
|
</right> |
|
|
|
|
</Layout> |
|
|
|
|
|
|
|
|
|