[mod] xqdoc
This commit is contained in:
parent
5fe9b6ab18
commit
9fc8fe4a46
@ -4,6 +4,14 @@
|
||||
<v-toolbar dense >
|
||||
<v-toolbar-title>documentation</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
icon
|
||||
:loading="loading"
|
||||
@click="get()"
|
||||
:disabled="loading"
|
||||
>
|
||||
<v-icon>refresh</v-icon>
|
||||
</v-btn>
|
||||
<a href="/vue-poc/api/xqdocjob" target="doc">json</a>
|
||||
</v-toolbar>
|
||||
|
||||
@ -15,8 +23,11 @@
|
||||
:key="item.id"
|
||||
>
|
||||
<v-card :hover="true" >
|
||||
<v-card-title>{{ item.id }}</v-card-title>
|
||||
<v-card-title color="#26c6da">{{ item.id }}</v-card-title>
|
||||
<v-card-text>{{ item.name }}</v-card-text>
|
||||
<v-card-actions>
|
||||
<a :href="item.href" target="_new">go</a>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
@ -29,7 +40,8 @@
|
||||
data: function(){
|
||||
return {
|
||||
message: 'Hello Vue.js!',
|
||||
items:[]
|
||||
items:[],
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
@ -37,7 +49,6 @@
|
||||
HTTP.get('xqdocjob')
|
||||
.then((res) => {
|
||||
this.items = res.data;
|
||||
console.log("items",this.items)
|
||||
});
|
||||
},
|
||||
doEdit(item){
|
||||
|
@ -14,12 +14,13 @@ declare
|
||||
function j:list()
|
||||
as element(json)
|
||||
{
|
||||
let $jlist:=(279,280)
|
||||
let $jlist:=file:list(db:option("webpath") || "/static/xqdoc/")
|
||||
return <json type="array">
|
||||
{for $j in $jlist
|
||||
{for $j in reverse($jlist)
|
||||
return <_ type="object">
|
||||
<id>{ $j }</id>
|
||||
<name>todo</name>
|
||||
<href>/static/xqdoc/{ $j }index.html</href>
|
||||
</_>
|
||||
}</json>
|
||||
};
|
||||
|
@ -13,8 +13,8 @@
|
||||
<v-flex xs12 sm6>
|
||||
<v-combobox
|
||||
v-model="url"
|
||||
:items="urls"
|
||||
label="Select target"
|
||||
:items="entities" item-text="name"
|
||||
label="Select target" clearable open-on-clear
|
||||
></v-combobox>
|
||||
|
||||
</v-flex>
|
||||
@ -22,6 +22,7 @@
|
||||
<table class="v-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th xs1>url</th>
|
||||
<th xs1>Action</th>
|
||||
<th xs1>Repeat</th>
|
||||
<th xs1>Last</th>
|
||||
@ -36,11 +37,13 @@
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
{{ url && url.name }}
|
||||
</td>
|
||||
<td>
|
||||
<v-btn @click="get()" >
|
||||
<v-btn @click="get()" :disabled="!url" >
|
||||
Read <v-icon right>compare_arrows</v-icon>
|
||||
</v-btn>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<v-switch v-on:change="gchange" v-model="repeat.get"></v-switch>
|
||||
@ -84,17 +87,18 @@
|
||||
return {
|
||||
getValues: new perfStat(),
|
||||
repeat: {get:false},
|
||||
url: "data/entity",
|
||||
urls: ["data/entity","data/taskhistory"],
|
||||
url: null,
|
||||
counter: 0,
|
||||
result: null
|
||||
result: null,
|
||||
entities: null
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
get(){
|
||||
var _start = performance.now();
|
||||
HTTP.get(this.url,axios_json)
|
||||
console.log("FFFFF"," "+ this.url.parentlink)
|
||||
HTTP.get(this.url.parentlink,axios_json)
|
||||
.then(r=>{
|
||||
var elapsed=Math.floor(performance.now() - _start);
|
||||
this.counter++;
|
||||
@ -113,8 +117,19 @@
|
||||
reset(){
|
||||
Object.assign(this.getValues,this.getValues.clear());
|
||||
this.$forceUpdate()
|
||||
},
|
||||
getentities(){
|
||||
HTTP.get("data/entity",axios_json)
|
||||
.then(r=>{
|
||||
console.log("entities: ",r.data);
|
||||
this.entities=r.data.items
|
||||
})
|
||||
}
|
||||
},
|
||||
created(){
|
||||
console.log("GET entities: ");
|
||||
this.getentities()
|
||||
},
|
||||
beforeRouteLeave(to, from, next){
|
||||
var on=this.repeat.get
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
<v-card-text>
|
||||
<v-container fluid>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-flex xs12 v-if="!loading">
|
||||
<vp-paramform ref="params" :endpoint="'tasks/'+task"></vp-paramform>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
@ -4,9 +4,11 @@
|
||||
:)
|
||||
|
||||
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
|
||||
import module namespace xqhtml = 'quodatum:build.xqdoc-html' at "../../../lib/xqdoc/xqdoc-html.xqm";
|
||||
import module namespace store = 'quodatum.store' at "../../../lib/store.xqm";
|
||||
declare namespace c="http://www.w3.org/ns/xproc-step";
|
||||
declare namespace xqdoc="http://www.xqdoc.org/1.0";
|
||||
|
||||
|
||||
|
||||
(:~ URL of the root folder to document
|
||||
: @default C:/Users/andy/git/vue-poc/src/vue-poc
|
||||
:)
|
||||
@ -15,51 +17,55 @@ declare variable $efolder as xs:anyURI external := xs:anyURI("C:/Users/andy/git
|
||||
declare variable $id as element(last-id):=db:open("vue-poc","/state.xml")/state/last-id;
|
||||
|
||||
let $target:="file:///" || db:option("webpath") || "/static/xqdoc/" || $id || "/"
|
||||
let $project:=tokenize($efolder,"[/\\]")[last()]
|
||||
|
||||
let $state:=xqd:read($efolder)=>trace("READ: ")
|
||||
let $opts:=map{
|
||||
"src-folder": $efolder,
|
||||
"project": $project,
|
||||
"ext-id": $id/string()
|
||||
"project": $state?project,
|
||||
"ext-id": $id/string(),
|
||||
"resources": "resources/"
|
||||
}
|
||||
let $state:=xqd:read($efolder)=>trace("READ: ")
|
||||
let $imports:= xqd:imports($state)?xqdoc=>head()
|
||||
|
||||
(: generate o/ps per source file :)
|
||||
let $modmap:=for $file at $pos in $state?files
|
||||
let $params:=map:merge((map{
|
||||
"source": "** source**",
|
||||
"filename": "**FILE**",
|
||||
"source": $file?xqparse/string(),
|
||||
"filename": $file?path,
|
||||
"cache": $xqd:cache,
|
||||
"show-private": true(),
|
||||
"root": "../",
|
||||
"root": "../../",
|
||||
"resources": "resources/"},
|
||||
$opts))
|
||||
return (
|
||||
map{
|
||||
"uri": ``[f`{ $pos}`/xqdoc.xml]``,
|
||||
"document": $file?xqdoc,
|
||||
"opts": $xqd:XML
|
||||
"uri": $file?href || "/xqdoc.xml", "opts": $xqd:XML
|
||||
},
|
||||
map{
|
||||
"uri": ``[f`{ $pos}`/xqparse.xml]``,
|
||||
"document": $file?xqparse,
|
||||
"opts": $xqd:XML
|
||||
"uri": $file?href || "xqparse.xml", "opts": $xqd:XML
|
||||
},
|
||||
map{
|
||||
"uri": ``[f`{ $pos}`/index.html]``,
|
||||
"document": xqd:xqdoc-html($file?xqdoc,$params),
|
||||
"opts": $xqd:HTML5
|
||||
"uri": $file?href || "index.html", "opts": $xqd:HTML5
|
||||
}
|
||||
)
|
||||
let $indexmap:=
|
||||
map{
|
||||
"uri": ``[index.html]``,
|
||||
"document": <html><title>todo</title></html>,
|
||||
"opts": $xqd:HTML5
|
||||
|
||||
let $index:= map{
|
||||
"document": xqhtml:index-html2($state,$opts),
|
||||
"uri": ``[index.html]``, "opts": $xqd:HTML5
|
||||
}
|
||||
|
||||
let $restxq:= map{
|
||||
"document": xqhtml:restxq($state, xqd:rxq-paths($state),$opts),
|
||||
"uri": ``[restxq.html]``, "opts": $xqd:HTML5
|
||||
}
|
||||
let $imports:=map{
|
||||
"document": xqhtml:imports($state,xqd:imports($state),$opts),
|
||||
"uri": ``[imports.html]``, "opts": $xqd:HTML5
|
||||
}
|
||||
|
||||
return (
|
||||
store:store(($indexmap,$modmap),$target),
|
||||
store:store(($index,$restxq,$imports,$modmap),$target),
|
||||
xqd:export-resources2($target),
|
||||
replace value of node $id with 1+$id,
|
||||
update:output(
|
||||
|
@ -11,7 +11,7 @@
|
||||
Source not available
|
||||
</xsl:param>
|
||||
<xsl:param name="filename" as="xs:string" select="'?file'" />
|
||||
<xsl:param name="ext-id" as="xs:string"></xsl:param>
|
||||
|
||||
<xsl:param name="show-private" as="xs:boolean" select="false()" />
|
||||
<xsl:param name="resources" as="xs:string" select="'resources/'" />
|
||||
<xsl:param name="root" as="xs:string" select="'../../'" />
|
||||
@ -36,7 +36,6 @@
|
||||
<title>
|
||||
<xsl:value-of select="$docuri" />
|
||||
- xqDoc
|
||||
<xsl:value-of select="$ext-id" />
|
||||
</title>
|
||||
<xsl:call-template name="resources">
|
||||
<xsl:with-param name="path" select="concat($root,$resources)" />
|
||||
@ -56,11 +55,7 @@
|
||||
mode="restxq" />
|
||||
<div>
|
||||
<h3 id="source">Original Source Code</h3>
|
||||
<pre>
|
||||
<code class="language-xquery">
|
||||
<xsl:value-of select="$source" />
|
||||
</code>
|
||||
</pre>
|
||||
<pre><code class="language-xquery"><xsl:value-of select="$source" /></code></pre>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
@ -71,7 +66,7 @@
|
||||
<a href="xqdoc.xml" target="xqdoc">
|
||||
xqdoc
|
||||
</a>
|
||||
<a href="xparse.xml" target="xparse">
|
||||
<a href="xqparse.xml" target="xqparse">
|
||||
xparse
|
||||
</a>
|
||||
</i>
|
||||
@ -96,26 +91,29 @@
|
||||
<xsl:value-of select="@type" />
|
||||
module
|
||||
</small>
|
||||
|
||||
<xsl:if test="count($restxq)">
|
||||
<span title="RestXQ" class="tag tag-success" style="float:right">R</span>
|
||||
</xsl:if>
|
||||
<xsl:if test=".//doc:annotations/doc:annotation[@name='updating']">
|
||||
<div class="tag tag-danger" title="Updating" style="float:right">U
|
||||
</div>
|
||||
</xsl:if>
|
||||
</h1>
|
||||
<dl>
|
||||
<xsl:apply-templates select="doc:comment/doc:description" />
|
||||
<dt>Tags</dt>
|
||||
<dd>
|
||||
<xsl:if test="count($restxq)">
|
||||
<span class="tag tag-success">RESTXQ</span>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates
|
||||
select="doc:comment/* except doc:comment/doc:description" />
|
||||
</dd>
|
||||
</dl>
|
||||
<div> Imported by <a href="{ $root }imports.html#{ doc:uri }">*</a></div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:imports[doc:import]">
|
||||
<div id="imports">
|
||||
<h3>
|
||||
<a href="#imports">Imports</a>
|
||||
</h3>
|
||||
<details>
|
||||
<summary><a href="#imports">Imports</a></summary>
|
||||
<table class="data" style="float:none">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -137,6 +135,7 @@
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
@ -238,9 +237,10 @@
|
||||
|
||||
<div id="{$id}">
|
||||
<h4>
|
||||
<a href="#{$id}">
|
||||
<xsl:value-of select="$id" />
|
||||
</a>
|
||||
<xsl:value-of select="$id" />
|
||||
<div style="float:right">
|
||||
<a href="#{$id}" >#</a>
|
||||
</div>
|
||||
</h4>
|
||||
|
||||
<xsl:apply-templates select="$fun/doc:comment/doc:description[1]" />
|
||||
@ -251,7 +251,15 @@
|
||||
<xsl:apply-templates select="$fun[1]/doc:parameters" />
|
||||
<xsl:apply-templates select="$fun[1]/doc:return" />
|
||||
<xsl:apply-templates select="$fun[1]/doc:comment/doc:error" />
|
||||
|
||||
<xsl:apply-templates select="doc:annotations" />
|
||||
<details>
|
||||
<summary>External functions that invoke this function</summary>
|
||||
todo
|
||||
</details>
|
||||
<details>
|
||||
<summary>Internal functions used by this function</summary>
|
||||
todo
|
||||
</details>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
@ -281,7 +289,7 @@
|
||||
<xsl:value-of select="doc:return/doc:type/@occurrence/string()" />
|
||||
</code>
|
||||
</div>
|
||||
<xsl:apply-templates select="doc:annotations" />
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:functions[doc:function]" mode="restxq">
|
||||
@ -458,20 +466,18 @@
|
||||
|
||||
<xsl:template name="toc">
|
||||
<nav id="toc">
|
||||
<div>
|
||||
<a href="{$index}">
|
||||
↰
|
||||
<xsl:value-of select="$project" />
|
||||
:id=
|
||||
<xsl:value-of select="$ext-id" />
|
||||
</a>
|
||||
</div>
|
||||
<h2>
|
||||
<a href="{ $index }" class="tag tag-success">
|
||||
<xsl:value-of select="$project" />
|
||||
</a>
|
||||
/ Module
|
||||
</h2>
|
||||
<h3>
|
||||
<a id="contents"></a>
|
||||
<span class="">
|
||||
<xsl:value-of select="$docuri" />
|
||||
</span>
|
||||
</h2>
|
||||
</h3>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#main">
|
||||
@ -480,10 +486,16 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#imports">
|
||||
<span class="secno">2 </span>
|
||||
<span class="content">Imports</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#variables">
|
||||
<span class="secno">2 </span>
|
||||
<span class="secno">3 </span>
|
||||
<span class="content">Variables</span>
|
||||
</a>
|
||||
<ol class="toc">
|
||||
@ -509,7 +521,7 @@
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#functions">
|
||||
<span class="secno">3 </span>
|
||||
<span class="secno">4 </span>
|
||||
<span class="content">Functions</span>
|
||||
</a>
|
||||
<ol class="toc">
|
||||
@ -517,7 +529,7 @@
|
||||
<xsl:sort select="lower-case(doc:name)" />
|
||||
<xsl:variable name="id" select="current-grouping-key()" />
|
||||
<li>
|
||||
<a href="#{$id}#0">
|
||||
<a href="#{$id}">
|
||||
<span class="secno">
|
||||
<xsl:value-of select="concat('3.',position())" />
|
||||
</span>
|
||||
@ -544,7 +556,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="#namespaces">
|
||||
<span class="secno">4 </span>
|
||||
<span class="secno">5 </span>
|
||||
<span class="content">Namespaces</span>
|
||||
</a>
|
||||
</li>
|
||||
@ -552,7 +564,7 @@
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#restxq">
|
||||
<span class="secno">5 </span>
|
||||
<span class="secno">6 </span>
|
||||
<span class="content">Restxq</span>
|
||||
</a>
|
||||
<ol class="toc">
|
||||
@ -576,6 +588,12 @@
|
||||
</ol>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="#source">
|
||||
<span class="secno">7 </span>
|
||||
<span class="content">Source</span>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</xsl:template>
|
||||
|
@ -5,6 +5,7 @@
|
||||
: $target:="file:///C:/Users/andy/workspace/app-doc/src/doc/generated/models.xqm"
|
||||
:)
|
||||
module namespace xqhtml = 'quodatum:build.xqdoc-html';
|
||||
import module namespace tree = 'quodatum.data.tree' at "../tree.xqm";
|
||||
|
||||
declare namespace c="http://www.w3.org/ns/xproc-step";
|
||||
declare namespace xqdoc="http://www.xqdoc.org/1.0";
|
||||
@ -15,6 +16,81 @@ declare namespace xqdoc="http://www.xqdoc.org/1.0";
|
||||
: "src-folder": "C:/Users/andy/git/vue-poc/src/vue-poc",
|
||||
: "project": "vue-poc"
|
||||
:)
|
||||
declare function xqhtml:index-html2($state as map(*),
|
||||
$params as map(*)
|
||||
)
|
||||
as document-node()
|
||||
{
|
||||
let $d:=<div>
|
||||
<h1>
|
||||
<span class="tag tag-success">
|
||||
{ $params?project }
|
||||
</span>
|
||||
XQuery module Documentation
|
||||
</h1>
|
||||
{ xqhtml:toc($params) }
|
||||
<dl>
|
||||
<dt><a href="restxq.html">RestXQ</a></dt>
|
||||
<dd>Summary of RESTXQ usage</dd>
|
||||
<dt> <a href="imports.html">Imports</a></dt>
|
||||
<dd>Summary of all imports</dd>
|
||||
</dl>
|
||||
<div>src: { $params?src-folder }</div>
|
||||
|
||||
<div id="ns">
|
||||
<h1>Module Uris</h1>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Uri</th>
|
||||
<th>parsed</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{ for $file at $pos in $state?files
|
||||
let $ns:=$file?xqdoc/xqdoc:module/xqdoc:uri/string()
|
||||
order by $ns
|
||||
return <tr>
|
||||
<td>
|
||||
<a href="{ $file?href }index.html" title="{ $file?path }">
|
||||
{$ns}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{ $file?xqparse/name() }
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="file">
|
||||
<h1>Files</h1>
|
||||
<ul>
|
||||
{ for $file at $pos in $state?files
|
||||
|
||||
return <li>
|
||||
<a href="{ $file?href }index.html">
|
||||
{ $file?path }
|
||||
</a>
|
||||
{ $pos }
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
return document{ xqhtml:page($d, $params ) }
|
||||
};
|
||||
|
||||
(:~ transform files to html using c:files
|
||||
: @param $params keys: resources
|
||||
: "ext-id": "299",
|
||||
: "src-folder": "C:/Users/andy/git/vue-poc/src/vue-poc",
|
||||
: "project": "vue-poc",
|
||||
: "resources"
|
||||
:)
|
||||
declare function xqhtml:index-html($files,
|
||||
$params as map(*)
|
||||
)
|
||||
@ -62,10 +138,13 @@ let $d:=<div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
let $params:= map:merge(($params,map:entry("resources","resources/")))
|
||||
return document{ xqhtml:page($d, $params ) }
|
||||
};
|
||||
|
||||
(:~
|
||||
: build toc
|
||||
: params: map{"project":..}
|
||||
:)
|
||||
declare function xqhtml:toc($params)
|
||||
as element()
|
||||
{
|
||||
@ -86,7 +165,7 @@ as element()
|
||||
<li>
|
||||
<a href="#ns">
|
||||
<span class="secno">2 </span>
|
||||
<span class="content">Namespaces</span>
|
||||
<span class="content">Module uris</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -99,8 +178,141 @@ as element()
|
||||
</nav>
|
||||
};
|
||||
|
||||
(:~ tree to list :)
|
||||
declare function xqhtml:tree-list($tree as element(*),$seq as xs:integer*){
|
||||
typeswitch ($tree )
|
||||
case element(directory)
|
||||
return <li>
|
||||
<span class="secno">{string-join($seq,'.')}</span>
|
||||
<span class="content">{$tree/@name/string()}/</span>
|
||||
<ol class="toc">{$tree/*!xqhtml:tree-list(.,($seq,position()))}</ol>
|
||||
</li>
|
||||
case element(file)
|
||||
return <li>{if($tree/@target) then
|
||||
<a href="#{$tree/@target}">
|
||||
<span class="secno">{string-join($seq,'.')}</span>
|
||||
|
||||
<span class="content" title="{$tree/@target}">{ $tree/@name/string() }</span>
|
||||
<div class="tag tag-success"
|
||||
title="RESTXQ: {$tree/@target}">GET
|
||||
</div>
|
||||
<div class="tag tag-danger" style="float:right"
|
||||
title="RESTXQ: {$tree/@target}">X
|
||||
</div>
|
||||
</a>
|
||||
else
|
||||
<span class="content">{$tree/@name/string()}</span>
|
||||
}</li>
|
||||
default
|
||||
return <li>unknown</li>
|
||||
};
|
||||
|
||||
(:~
|
||||
: html for page.
|
||||
:)
|
||||
declare function xqhtml:restxq($state,$annots,$opts)
|
||||
{
|
||||
let $tree:=trace($annots?uri)
|
||||
let $tree:=tree:build($tree)=>trace("TRRES")
|
||||
let $body:= <div>
|
||||
<nav id="toc">
|
||||
<h2>
|
||||
<a href="index.html" class="tag tag-success">
|
||||
{ $state?project }
|
||||
</a>
|
||||
/ RestXQ
|
||||
</h2>
|
||||
<h3>
|
||||
Contents
|
||||
</h3>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#main">
|
||||
<span class="secno">1 </span>
|
||||
<span class="content">Introduction</span>
|
||||
</a>
|
||||
</li>
|
||||
<li href="#main">
|
||||
<a >
|
||||
<span class="secno">2 </span>
|
||||
<span class="content">Paths.</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<ol class="toc"> { $tree/*/*!xqhtml:tree-list(.,2) } </ol>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<a href="index.html">index: </a>
|
||||
|
||||
<ul>{$annots!xqhtml:path-to-html(.)}</ul>
|
||||
</div>
|
||||
return xqhtml:page($body,$opts)
|
||||
};
|
||||
|
||||
declare function xqhtml:imports($state,$imports,$opts)
|
||||
{
|
||||
let $body:=<div>
|
||||
<nav id="toc">
|
||||
<h2>
|
||||
<a href="index.html" class="tag tag-success">
|
||||
{ $state?project }
|
||||
</a>
|
||||
/ Imports
|
||||
</h2>
|
||||
|
||||
<h3>
|
||||
Contents
|
||||
</h3>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#main">
|
||||
<span class="secno">1 </span>
|
||||
<span class="content">Introduction</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
<a href="index.html">index</a>
|
||||
<p>Lists all modules imported.</p>
|
||||
{for $import in $imports
|
||||
order by $import?uri
|
||||
return <div id="{ $import?uri }">
|
||||
<h4>{ $import?uri }
|
||||
<div style="float:right"><a href="#{ $import?uri }">#</a></div>
|
||||
</h4>
|
||||
<ul>
|
||||
{for $f in $import?where
|
||||
return <li><a href="{$f}index.html">mod</a></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
return xqhtml:page($body,$opts)
|
||||
};
|
||||
(:~ html for a path :)
|
||||
declare function xqhtml:path-to-html($rep as map(*))
|
||||
as element(li){
|
||||
<li id="{ $rep?uri }">
|
||||
<h4>{ $rep?uri }</h4>
|
||||
<ul>{
|
||||
let $methods as map(*) :=$rep?methods
|
||||
for $method in map:keys($methods)
|
||||
let $d:=$methods?($method)
|
||||
let $id:=head($d?function)
|
||||
return <li>
|
||||
<a href="{$d?uri}index.html#{$id }">{ $method }</a>
|
||||
<div>{$d?description}</div>
|
||||
</li>
|
||||
}</ul>
|
||||
</li>
|
||||
};
|
||||
(:~
|
||||
: generate standard page wrapper
|
||||
: uses $opts?resources
|
||||
:)
|
||||
declare function xqhtml:page($body,$opts as map(*))
|
||||
as element(html)
|
||||
|
@ -74,37 +74,41 @@ declare function xqd:gendoc(
|
||||
)
|
||||
};
|
||||
|
||||
(:~
|
||||
: create documentation folder map
|
||||
: map{"base-uri":.., "files":map(*)*}
|
||||
:)
|
||||
declare function xqd:read($efolder as xs:string)
|
||||
(:~
|
||||
: create documentation folder map
|
||||
: map{"base-uri":.., "files":map(*)*}
|
||||
:)
|
||||
declare function xqd:read($efolder as xs:string)
|
||||
as map(*)
|
||||
{
|
||||
let $files:= file:list($efolder,true(),"*.xqm")
|
||||
let $full:= $files!concat($efolder || "\",.)
|
||||
return map{
|
||||
"base-uri": $efolder,
|
||||
"files": for $file in $files
|
||||
"project": tokenize($efolder,"[/\\]")[last()],
|
||||
"files": for $file at $pos in $files
|
||||
let $full:=concat($efolder || "\", $file)
|
||||
let $spath:=translate($file,"\","/")
|
||||
return map{
|
||||
"full":$full,
|
||||
"xqdoc": xqd:xqdoc($full,map{"_source": $full}),
|
||||
"xqparse": xqd:parse($full)
|
||||
"path":$file,
|
||||
"href": ``[modules/F`{ $pos }`/]``,
|
||||
"xqdoc": xqd:xqdoc($full,map{"_source": $spath}),
|
||||
"xqparse": fetch:text($full)=>xqd:parse()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
(: return sequence of maps are imported ns values are where imported:)
|
||||
declare function xqd:imports($doc)
|
||||
as map(*)*
|
||||
{
|
||||
let $keys:=$doc?files?xqdoc!map:entry(generate-id(.),position())=>map:merge()
|
||||
let $ns:=for $in in $doc?files?xqdoc//xqdoc:import[@type="library"]
|
||||
group by $ns:=$in/xqdoc:uri
|
||||
let $id:=$keys?($in/root()/generate-id())
|
||||
return map:entry($ns,$id)
|
||||
return map:merge(($doc,map{"keys": $keys,
|
||||
"imports": $ns}))
|
||||
for $f in $doc?files
|
||||
for $in in $f?xqdoc//xqdoc:import[@type="library"]
|
||||
group by $ns:=$in/xqdoc:uri
|
||||
return map{ "uri": $ns, "where": $f?href}
|
||||
|
||||
};
|
||||
|
||||
(:~
|
||||
@ -164,7 +168,7 @@ declare function xqd:store2($data,$url as xs:string,$params as map(*))
|
||||
declare function xqd:parse($xq as xs:string)
|
||||
as element(*)
|
||||
{
|
||||
xp:parse($xq || "",map{"lang":"xquery","version":"3.1 basex-20161204"})
|
||||
xp:parse($xq || "",map{"lang":"xquery","version":"3.1 basex"})
|
||||
};
|
||||
|
||||
(:~
|
||||
@ -211,17 +215,57 @@ declare %updating
|
||||
function xqd:export-resources2($target as xs:string)
|
||||
as empty-sequence(){
|
||||
archive:extract-to($target, file:read-binary(resolve-uri('resources.zip')))
|
||||
};
|
||||
};
|
||||
|
||||
(:~ return sequence of maps with maps uri and methods :)
|
||||
declare function xqd:rxq-paths($state)
|
||||
as map(*)*
|
||||
{
|
||||
let $reports:= xqd:annots-rxq($state)
|
||||
(: map keyed on uris :)
|
||||
let $data:=map:merge(for $report in $reports
|
||||
group by $uri:=$report?annot/xqdoc:literal/string()
|
||||
let $methods:= map:merge(
|
||||
for $annot in $report
|
||||
let $hits:=for $method in $xqd:methods
|
||||
let $hit:= xqd:methods($annot?annot/.., $xqd:nsRESTXQ, $method)
|
||||
where $hit
|
||||
return map{$method: $annot}
|
||||
return if(exists($hits))then $hits else map{"ALL":$annot}
|
||||
)
|
||||
return map:entry($uri,map{ "uri": $uri, "methods": $methods})
|
||||
)
|
||||
let $uris:=sort(map:keys($data))
|
||||
return $data?($uris)
|
||||
};
|
||||
(:~
|
||||
: map for each restxq:path annotation
|
||||
:)
|
||||
declare function xqd:annots-rxq($state as map(*))
|
||||
as map(*)*
|
||||
{
|
||||
for $f at $index in $state?files
|
||||
for $annot in xqd:annotations($f?xqdoc, $xqd:nsRESTXQ,"path")
|
||||
return map{
|
||||
"id": $index,
|
||||
"uri": $f?href,
|
||||
"path": $f?path,
|
||||
"annot": $annot,
|
||||
"function": $annot/../../(xqdoc:name/string(),@arity/string()),
|
||||
"description": $annot/../../xqdoc:comment/xqdoc:description/node()
|
||||
}
|
||||
};
|
||||
|
||||
(:~
|
||||
: return all matching annotations in xqdoc
|
||||
:)
|
||||
:)
|
||||
declare function xqd:annotations($xqdoc as element(xqdoc:xqdoc),
|
||||
$annotns as xs:string,
|
||||
$aname as xs:string)
|
||||
as element(xqdoc:annotation)*
|
||||
{
|
||||
let $prefixes:=$xqdoc//xqdoc:namespace[@uri=$annotns]/@prefix/string()
|
||||
return $xqdoc//xqdoc:annotations/xqdoc:annotation[@name=(for $p in $prefixes return concat($p,':',$aname))]
|
||||
let $prefixes:=$xqdoc//xqdoc:namespace[@uri=$annotns]/@prefix/string()
|
||||
return $xqdoc//xqdoc:annotations/xqdoc:annotation[@name=(for $p in $prefixes return concat($p,':',$aname))]
|
||||
|
||||
};
|
||||
|
||||
@ -242,7 +286,8 @@ as element(xqdoc:annotation)*
|
||||
|
||||
|
||||
(: @return map of functions and variables having annotations :)
|
||||
declare function xqd:annotation-map($xqdoc){
|
||||
declare function xqd:annotation-map($xqdoc)
|
||||
{
|
||||
let $ns:=map:merge((
|
||||
map:entry("", "http://www.w3.org/2012/xquery"),
|
||||
$xqdoc//xqdoc:namespace!map:entry(string(@prefix),string(@uri))
|
||||
|
@ -1,4 +1,4 @@
|
||||
// generated 2019-03-16T22:59:26.228Z
|
||||
// generated 2019-04-04T23:01:43.478+01:00
|
||||
|
||||
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
|
||||
Vue.component('qd-autoheight',{template:`
|
||||
@ -1395,7 +1395,7 @@ Vue.use(Fullscreen);
|
||||
|
||||
|
||||
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/mimetypes.js
|
||||
// Mimetype info
|
||||
// Mimetype info as vue extension. defines $MimeTypes
|
||||
//
|
||||
//
|
||||
const MimeTypes=new function(){
|
||||
@ -4541,6 +4541,9 @@ const Documentation=Vue.extend({template:`
|
||||
<v-toolbar dense>
|
||||
<v-toolbar-title>documentation</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn icon :loading="loading" @click="get()" :disabled="loading">
|
||||
<v-icon>refresh</v-icon>
|
||||
</v-btn>
|
||||
<a href="/vue-poc/api/xqdocjob" target="doc">json</a>
|
||||
</v-toolbar>
|
||||
|
||||
@ -4548,8 +4551,11 @@ const Documentation=Vue.extend({template:`
|
||||
<v-layout row wrap>
|
||||
<v-flex height="80px" xs2 v-for="item in items" :key="item.id">
|
||||
<v-card :hover="true">
|
||||
<v-card-title>{{ item.id }}</v-card-title>
|
||||
<v-card-title color="#26c6da">{{ item.id }}</v-card-title>
|
||||
<v-card-text>{{ item.name }}</v-card-text>
|
||||
<v-card-actions>
|
||||
<a :href="item.href" target="_new">go</a>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
@ -4561,7 +4567,8 @@ const Documentation=Vue.extend({template:`
|
||||
data: function(){
|
||||
return {
|
||||
message: 'Hello Vue.js!',
|
||||
items:[]
|
||||
items:[],
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
@ -4569,7 +4576,6 @@ const Documentation=Vue.extend({template:`
|
||||
HTTP.get('xqdocjob')
|
||||
.then((res) => {
|
||||
this.items = res.data;
|
||||
console.log("items",this.items)
|
||||
});
|
||||
},
|
||||
doEdit(item){
|
||||
@ -5538,13 +5544,14 @@ const Dicetest=Vue.extend({template:`
|
||||
<v-card-text>
|
||||
<p>Read json data for 1st page for entity.</p>
|
||||
<v-flex xs12 sm6>
|
||||
<v-combobox v-model="url" :items="urls" label="Select target"></v-combobox>
|
||||
<v-combobox v-model="url" :items="entities" item-text="name" label="Select target" clearable open-on-clear></v-combobox>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<table class="v-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th xs1>url</th>
|
||||
<th xs1>Action</th>
|
||||
<th xs1>Repeat</th>
|
||||
<th xs1>Last</th>
|
||||
@ -5559,11 +5566,13 @@ const Dicetest=Vue.extend({template:`
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
{{ url && url.name }}
|
||||
</td>
|
||||
<td>
|
||||
<v-btn @click="get()">
|
||||
<v-btn @click="get()" :disabled="!url">
|
||||
Read <v-icon right>compare_arrows</v-icon>
|
||||
</v-btn>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<v-switch v-on:change="gchange" v-model="repeat.get"></v-switch>
|
||||
@ -5606,17 +5615,18 @@ const Dicetest=Vue.extend({template:`
|
||||
return {
|
||||
getValues: new perfStat(),
|
||||
repeat: {get:false},
|
||||
url: "data/entity",
|
||||
urls: ["data/entity","data/taskhistory"],
|
||||
url: null,
|
||||
counter: 0,
|
||||
result: null
|
||||
result: null,
|
||||
entities: null
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
get(){
|
||||
var _start = performance.now();
|
||||
HTTP.get(this.url,axios_json)
|
||||
console.log("FFFFF"," "+ this.url.parentlink)
|
||||
HTTP.get(this.url.parentlink,axios_json)
|
||||
.then(r=>{
|
||||
var elapsed=Math.floor(performance.now() - _start);
|
||||
this.counter++;
|
||||
@ -5635,8 +5645,19 @@ const Dicetest=Vue.extend({template:`
|
||||
reset(){
|
||||
Object.assign(this.getValues,this.getValues.clear());
|
||||
this.$forceUpdate()
|
||||
},
|
||||
getentities(){
|
||||
HTTP.get("data/entity",axios_json)
|
||||
.then(r=>{
|
||||
console.log("entities: ",r.data);
|
||||
this.entities=r.data.items
|
||||
})
|
||||
}
|
||||
},
|
||||
created(){
|
||||
console.log("GET entities: ");
|
||||
this.getentities()
|
||||
},
|
||||
beforeRouteLeave(to, from, next){
|
||||
var on=this.repeat.get
|
||||
|
||||
@ -6303,7 +6324,7 @@ const Runtask=Vue.extend({template:`
|
||||
<v-card-text>
|
||||
<v-container fluid>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-flex xs12 v-if="!loading">
|
||||
<vp-paramform ref="params" :endpoint="'tasks/'+task"></vp-paramform>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<link rel="shortcut icon" href="/vue-poc/ui/icon.png"/>
|
||||
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"/>
|
||||
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"/>
|
||||
<link rel="stylesheet" href="//unpkg.com/vuetify@1.5.7/dist/vuetify.min.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="//unpkg.com/vuetify@1.5.9/dist/vuetify.min.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="//unpkg.com/@riophae/vue-treeselect@0.0.29/dist/vue-treeselect.min.css"/>
|
||||
<link rel="stylesheet" href="/vue-poc/ui/prism/prism.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" href="//unpkg.com/leaflet@1.0.3/dist/leaflet.css"/>
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<h3><code>vue-poc</code> <small>(v0.3.160)</small> </h3>
|
||||
<h3><code>vue-poc</code> <small>(v0.3.161)</small> </h3>
|
||||
|
||||
<div class="spinner">
|
||||
<div class="rect1"></div>
|
||||
@ -39,7 +39,7 @@
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js" crossorigin="anonymous"></script>
|
||||
<script src="//unpkg.com/vuex@3.1.0/dist/vuex.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js" crossorigin="anonymous" ></script>
|
||||
<script src="//unpkg.com/vuetify@1.5.7/dist/vuetify.min.js" crossorigin="anonymous"></script>
|
||||
<script src="//unpkg.com/vuetify@1.5.9/dist/vuetify.min.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.3/ace.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.3/ext-language_tools.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.3/ext-linking.js" crossorigin="anonymous" charset="utf-8"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user