[mod] vuetify 2.1.3
This commit is contained in:
parent
62e071578b
commit
291ede8162
87 changed files with 1330 additions and 5458 deletions
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
<v-navigation-drawer app :mini-variant.sync="mini" v-model="drawer" :clipped="$vuetify.breakpoint.lgAndUp"
|
||||
>
|
||||
|
||||
<v-list class="pa-0">
|
||||
|
||||
<v-list-item tag="div">
|
||||
|
|
@ -38,10 +39,11 @@
|
|||
|
||||
</v-list>
|
||||
<qd-navlist2 :items="items" :mini="mini"></qd-navlist2>
|
||||
<router-view name="helper" class="view ma-3"></router-view>
|
||||
</v-navigation-drawer>
|
||||
|
||||
<v-app-bar app :clipped-left="$vuetify.breakpoint.lgAndUp"
|
||||
color="blue darken-3"
|
||||
color="blue darken-3" dense
|
||||
dark >
|
||||
<v-app-bar-nav-icon @click.stop="drawer = !drawer" ></v-app-bar-nav-icon>
|
||||
<v-toolbar-title class="hidden-sm-and-down" >
|
||||
|
|
@ -51,9 +53,9 @@
|
|||
<vp-favorite :frmfav.sync="frmfav"></vp-favorite>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-toolbar-items>
|
||||
<qd-search></qd-search>
|
||||
|
||||
</v-toolbar-items>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-menu left transition="v-fade-transition">
|
||||
|
|
@ -150,6 +152,7 @@
|
|||
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
|
||||
{href: '/transform',text: 'XSLT Transform',icon: 'forward'},
|
||||
{href: '/tasks',text: 'Tasks',icon: 'update'},
|
||||
{href: '/logdate',text: 'XML logs',icon: 'dns'},
|
||||
{href: '/history/tasks',text: 'history',icon: 'history'}
|
||||
]},
|
||||
{
|
||||
|
|
@ -159,15 +162,15 @@
|
|||
children: [
|
||||
{href: '/database', text: 'Databases',icon: 'developer_mode' },
|
||||
{href: '/files', text: 'File system',icon: 'folder' },
|
||||
|
||||
{href: '/history/files',text: 'history',icon: 'history'}
|
||||
{href: '/documentation', text: 'Documentation',icon: 'library_books' },
|
||||
{href: '/history/files',text: 'history',icon: 'history'}
|
||||
]},
|
||||
{
|
||||
icon: 'memory',
|
||||
text: 'Models' ,
|
||||
model: false,
|
||||
children: [
|
||||
{href: '/documentation', text: 'Documentation',icon: 'library_books' },
|
||||
|
||||
{href: '/namespace', text: 'Namespaces',icon: 'label' },
|
||||
{href: '/entity', text: 'Entities',icon: 'redeem' },
|
||||
]},
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ for nav drawer
|
|||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</template>
|
||||
<v-divider :inset="true"></v-divider>
|
||||
<v-list-item :to="child.href"
|
||||
v-for="(child, i) in item.children"
|
||||
:key="i" :title="child.text"
|
||||
|
|
@ -37,6 +38,7 @@ for nav drawer
|
|||
<v-icon v-text="child.icon"></v-icon>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
<v-divider :inset="true"></v-divider>
|
||||
</v-list-group>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:item="items"
|
||||
:items="items"
|
||||
:search="search"
|
||||
v-model="selected"
|
||||
show-select
|
||||
|
|
|
|||
|
|
@ -13,12 +13,25 @@ for vis-time-line http://visjs.org/docs/graph2d/
|
|||
methods:{
|
||||
select(properties){
|
||||
this.$emit('select',properties.items);
|
||||
},
|
||||
rebuild(data){
|
||||
var items = new vis.DataSet(data);
|
||||
//this.timeline = new vis.Timeline(this.$el, items, this.groups, this.options);
|
||||
this.timeline.setItems(items)
|
||||
this.timeline.fit(true)
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
items(newItems){
|
||||
console.log("timeline new:" + newItems.length)
|
||||
this.rebuild(newItems)
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
var items = new vis.DataSet(this.items);
|
||||
|
||||
var options = this.options;
|
||||
var groups = this.groups;
|
||||
var items = new vis.DataSet(this.items);
|
||||
this.timeline = new vis.Timeline(this.$el, items, groups, options);
|
||||
this.timeline.on('select', this.select);
|
||||
if(this.events){
|
||||
|
|
|
|||
|
|
@ -1,73 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
job component
|
||||
A toolbar that displays information about a job run
|
||||
job:{id:
|
||||
job:
|
||||
job:{id:,job:},
|
||||
jobState: {reads: writes:}
|
||||
-->
|
||||
<template id="vp-job">
|
||||
<v-card >
|
||||
|
||||
<v-toolbar dense>
|
||||
<v-card-title>Details:</v-card-title>
|
||||
<v-toolbar dense>
|
||||
<v-chip class="primary white--text">{{job.id}}</v-chip>
|
||||
<v-spacer></v-spacer>
|
||||
<v-chip class="primary white--text">{{job.job}}</v-chip>
|
||||
|
||||
<v-chip label class="grey white--text">
|
||||
<v-avatar class="red"> <v-icon>lock</v-icon>W</v-avatar>
|
||||
<v-avatar class="red">W</v-avatar><v-icon>lock</v-icon>
|
||||
{{ jobState.writes }}</v-chip>
|
||||
|
||||
<v-chip label class="grey white--text">
|
||||
<v-avatar class="amber"> <v-icon>lock</v-icon>R</v-avatar>
|
||||
{{ jobState.reads }}</v-chip>
|
||||
<v-avatar class="amber">R</v-avatar><v-icon>lock</v-icon>
|
||||
{{ jobState.reads }}</v-chip>
|
||||
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
<v-progress-circular v-if="waiting" indeterminate class="primary--text"></v-progress-circular>
|
||||
<v-chip>{{ jobState.state }}</v-chip>
|
||||
<v-chip class="primary white--text">
|
||||
<v-avatar > <v-icon>timer</v-icon></v-avatar>
|
||||
{{elapsed}}ms</v-chip>
|
||||
</v-toolbar>
|
||||
<v-card-text >
|
||||
<v-flex xs12 style="height:60px;" fill-height>
|
||||
<vue-ace :content="query" mode="xquery" wrap="true" :read-only="true"
|
||||
|
||||
></vue-ace>
|
||||
</v-flex>
|
||||
</v-card-text>
|
||||
<!-- result -->
|
||||
<v-card-text >
|
||||
<v-flex xs12 style="height:60px;" fill-height>
|
||||
<vue-ace :content="result" mode="xquery" min-lines="1" wrap="true" read-only="true" ></vue-ace>
|
||||
</v-flex>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
</v-toolbar>
|
||||
</template>
|
||||
|
||||
<script>{
|
||||
props: ['job',
|
||||
'result',
|
||||
'jobState',
|
||||
'elapsed',
|
||||
'query'
|
||||
'waiting'
|
||||
],
|
||||
data:function(){
|
||||
return {
|
||||
error: null,
|
||||
res1: "??"
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
result:function(a){
|
||||
if(this.res1 === "???"){ this.res1=a};
|
||||
console.log("vp-result:",a);
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
aresult:function(){return this.res1 || "none"}
|
||||
},
|
||||
created:function(){
|
||||
console.log("vp-job: ", this.job,this.result);
|
||||
console.log("vp-job: ", this.job);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -4,43 +4,51 @@
|
|||
including submit form function
|
||||
-->
|
||||
<template id="vp-paramform">
|
||||
<v-card >
|
||||
<v-toolbar color="blue lighten-3" dense>
|
||||
<v-card-title >{{ description }}</v-card-title>
|
||||
</v-toolbar>
|
||||
<v-card-text>
|
||||
<v-form ref="form" lazy-validation>
|
||||
<div class="title">{{ description }}</div>
|
||||
<div :title="url">{{ updating }}</div>
|
||||
|
||||
<v-layout row>
|
||||
|
||||
<v-layout column xs11>
|
||||
<v-flex v-for="field in fields" :key="field.model" >
|
||||
|
||||
<v-text-field v-if="field.type === 'xs:anyURI'" :full-width="true"
|
||||
v-model="params[field.model]" :label="field.label"
|
||||
clearable :rules="fieldrules(field)" filled
|
||||
append-outer-icon="send" @click:append-outer="source(field)"
|
||||
></v-text-field>
|
||||
|
||||
<v-switch v-else-if="field.type === 'xs:boolean'" :full-width="true"
|
||||
:label="field.label" v-model="params[field.model]">
|
||||
</v-switch>
|
||||
|
||||
|
||||
<v-text-field v-else :full-width="true" amber
|
||||
v-model="params[field.model]" :label="field.type"
|
||||
clearable filled ></v-text-field>
|
||||
|
||||
</v-flex>
|
||||
<v-flex>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout align-center justify-center column fill-height xs1 amber lighten-5>
|
||||
<v-btn @click="clear()" id="btn-clear"
|
||||
>Clear</v-btn>
|
||||
<v-btn @click="reset()"
|
||||
>Reset</v-btn>
|
||||
</v-layout>
|
||||
<v-layout column xs8>
|
||||
<v-flex v-for="field in fields" :key="field.model" >
|
||||
|
||||
<v-text-field v-if="field.type === 'xs:anyURI'"
|
||||
v-model="params[field.model]" :label="field.label"
|
||||
clearable :rules="fieldrules(field)" filled
|
||||
append-outer-icon="send" @click:append-outer="source(field)"
|
||||
></v-text-field>
|
||||
|
||||
<v-switch v-else-if="field.type === 'xs:boolean'"
|
||||
:label="field.label" v-model="params[field.model]">
|
||||
</v-switch>
|
||||
|
||||
<v-text-field v-else filled
|
||||
v-model="params[field.model]" :label="field.label"
|
||||
clearable ></v-text-field>
|
||||
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
<v-layout column >TODO
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
</v-form>
|
||||
<div :title="url">{{ url }} {{ updating }}</div>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn @click="clear()" id="btn-clear"
|
||||
>Clear</v-btn>
|
||||
<v-btn @click="reset()"
|
||||
>Reset</v-btn>
|
||||
</v-card-actions>
|
||||
<v-btn @click="zlog()"
|
||||
>console</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>{
|
||||
|
|
@ -71,6 +79,9 @@
|
|||
source(field){
|
||||
router.push({ path: 'tabs', query: { url:this.params[field.model]}})
|
||||
},
|
||||
zlog(){
|
||||
console.log(JSON.stringify(this.params))
|
||||
},
|
||||
clear () {
|
||||
this.$refs.form.reset()
|
||||
},
|
||||
|
|
@ -84,6 +95,11 @@
|
|||
return this.$refs.form.validate()
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
params(vold,vnew) {
|
||||
console.log("params: ",vnew)
|
||||
}
|
||||
},
|
||||
created:function(){
|
||||
this.reset();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<entity name="basexlog" xmlns="https://github.com/Quodatum/app-doc/entity">
|
||||
<description>BaseX log entries </description>
|
||||
<description>BaseX log entries for today and yesterday from the running server</description>
|
||||
|
||||
<fields>
|
||||
<field name="time" type="xs:string">
|
||||
<description>time of event</description>
|
||||
<xpath>concat(@date,'T',@time)</xpath>
|
||||
<description>time of event with date if available</description>
|
||||
<xpath>concat(@date,@date!'T',@time)</xpath>
|
||||
</field>
|
||||
<field name="address" type="xs:string">
|
||||
<description>IP address</description>
|
||||
16
src/vue-poc/data/vue-poc/entities/basexlogfile.xml
Normal file
16
src/vue-poc/data/vue-poc/entities/basexlogfile.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<entity name="basexlogfile" xmlns="https://github.com/Quodatum/app-doc/entity">
|
||||
<description>saved BaseX log entries in the vue-poc database</description>
|
||||
|
||||
<fields>
|
||||
<field name="name" type="xs:string">
|
||||
<description>file name</description>
|
||||
<xpath>.</xpath>
|
||||
</field>
|
||||
|
||||
</fields>
|
||||
<views iconclass="calendar_today"/>
|
||||
|
||||
<data type="element(resource)">
|
||||
db:dir("vue-poc","logs")
|
||||
</data>
|
||||
</entity>
|
||||
39
src/vue-poc/data/vue-poc/entities/logxml.xml
Normal file
39
src/vue-poc/data/vue-poc/entities/logxml.xml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<entity name="logxml" xmlns="https://github.com/Quodatum/app-doc/entity">
|
||||
<description> log entries in XML format</description>
|
||||
|
||||
<fields>
|
||||
<field name="time" type="xs:string">
|
||||
<description>time of event</description>
|
||||
<xpath>concat("2019-01-01",'T',@time)</xpath>
|
||||
</field>
|
||||
<field name="end" type="xs:string?">
|
||||
<description>end time of event</description>
|
||||
<xpath>self::*[@ms]!(xs:dateTime(concat("2019-01-01",'T',@time))+ xs:dayTimeDuration("PT" || (@ms div 1000) || "S"))</xpath>
|
||||
</field>
|
||||
<field name="address" type="xs:string">
|
||||
<description>IP address</description>
|
||||
<xpath>@address</xpath>
|
||||
</field>
|
||||
<field name="user" type="xs:string">
|
||||
<description>user name</description>
|
||||
<xpath>@user</xpath>
|
||||
</field>
|
||||
<field name="status" type="xs:string">
|
||||
<description>type of log msg</description>
|
||||
<xpath>@type</xpath>
|
||||
</field>
|
||||
<field name="ms" type="xs:integer">
|
||||
<description>time (ms)</description>
|
||||
<xpath>@ms</xpath>
|
||||
</field>
|
||||
<field name="text" type="xs:string">
|
||||
<description>log message</description>
|
||||
<xpath>.</xpath>
|
||||
</field>
|
||||
</fields>
|
||||
<views iconclass="calendar_today"/>
|
||||
|
||||
<data type="element(entry)">
|
||||
db:open("vue-poc","/logs/")[1]/entries/entry
|
||||
</data>
|
||||
</entity>
|
||||
BIN
src/vue-poc/data/vue-poc/logs/logs.zip
Normal file
BIN
src/vue-poc/data/vue-poc/logs/logs.zip
Normal file
Binary file not shown.
1
src/vue-poc/data/vue-poc/logs/logs2019-07-31.xml
Normal file
1
src/vue-poc/data/vue-poc/logs/logs2019-07-31.xml
Normal file
File diff suppressed because one or more lines are too long
1
src/vue-poc/data/vue-poc/logs/logs2019-08-11.xml
Normal file
1
src/vue-poc/data/vue-poc/logs/logs2019-08-11.xml
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,12 +0,0 @@
|
|||
<tasks>
|
||||
<task name="xqdoc">
|
||||
<url>tasks/xqdoc</url>
|
||||
<description></description>
|
||||
</task>
|
||||
<task name="vue-compile">
|
||||
<url>tasks/vue-compile</url>
|
||||
</task>
|
||||
<task name="model-compile">
|
||||
<url>tasks/model</url>
|
||||
</task>
|
||||
</tasks>
|
||||
112
src/vue-poc/features/adminlog/logarchive.vue
Normal file
112
src/vue-poc/features/adminlog/logarchive.vue
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
cards for log sources
|
||||
-->
|
||||
<template id="logarchive">
|
||||
<v-container fluid>
|
||||
<v-card>
|
||||
|
||||
<v-toolbar >
|
||||
<v-toolbar-title>
|
||||
<v-breadcrumbs :items="crumbs" >
|
||||
<template slot="item" slot-scope="props">
|
||||
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
|
||||
{{ props.item.text }}
|
||||
</v-breadcrumbs-item>
|
||||
</template>
|
||||
</v-breadcrumbs>
|
||||
</v-toolbar-title>
|
||||
<v-btn @click="load" icon :loading="loading"
|
||||
:disabled="loading"
|
||||
><v-icon>refresh</v-icon></v-btn>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search"
|
||||
hide-details single-line @keyup.enter="setfilter"
|
||||
clearable></v-text-field>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
<vp-entitylink entity="basexlogfile"></vp-entitylink>
|
||||
</v-toolbar>
|
||||
|
||||
<v-card-text>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="items"
|
||||
:loading="loading"
|
||||
hide-default-footer
|
||||
:search="q"
|
||||
class="elevation-1"
|
||||
>
|
||||
|
||||
<template v-slot:item.xmlns="{ item }" >
|
||||
<td ><router-link :to="{path:'namespace/item?xmlns='+ item.xmlns}">
|
||||
{{ item.xmlns }}
|
||||
</router-link></td>
|
||||
</template>
|
||||
|
||||
<template slot="no-results">
|
||||
No matching results.
|
||||
</template>
|
||||
|
||||
<template slot="no-data">
|
||||
No matching items.
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>{
|
||||
data: function(){
|
||||
return {
|
||||
items: [],
|
||||
loading: false,
|
||||
q: "",
|
||||
message: 'bad route!',
|
||||
|
||||
selected:[],
|
||||
headers: [
|
||||
|
||||
{ text: 'xmlns', value: 'xmlns' },
|
||||
|
||||
{ text: 'Description', value: 'description' },
|
||||
{ text: 'Prefix', value: 'prefix' }
|
||||
],
|
||||
crumbs:[{to:"/namespace", text:"namespaces"}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
load(){
|
||||
|
||||
this.loading= true
|
||||
HTTP.get("data/basexlogfile",{params:{q:this.q}})
|
||||
.then(r=>{
|
||||
this.items= r.data.items
|
||||
this.loading= false
|
||||
})
|
||||
|
||||
},
|
||||
setfilter(){
|
||||
console.log("TODO",this.q)
|
||||
this.$router.push({ query: {url:this.url,q:this.q }})
|
||||
},
|
||||
},
|
||||
watch:{
|
||||
$route(vnew,vold){
|
||||
console.log("ROUTE",vnew,vold)
|
||||
var url=this.$route.query.url
|
||||
this.url=url?url:"/";
|
||||
if(vnew.query.url != vold.query.url) this.load()
|
||||
}
|
||||
},
|
||||
|
||||
created:function(){
|
||||
this.q=this.$route.query.q || this.q;
|
||||
this.load();
|
||||
console.log("logarchive")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
147
src/vue-poc/features/adminlog/logdate.vue
Normal file
147
src/vue-poc/features/adminlog/logdate.vue
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
show log file data in vis-time-line
|
||||
-->
|
||||
<template id="logdate">
|
||||
<v-container fluid>
|
||||
<v-card>
|
||||
<v-toolbar class="lime darken-1">
|
||||
<v-card-title >XML Log {{ query.name }}</v-card-title>
|
||||
|
||||
<v-menu
|
||||
ref="menu"
|
||||
v-model="showFrom"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
:return-value.sync="query.from"
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
max-width="290px"
|
||||
min-width="100px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
v-model="query.from"
|
||||
label="Start time"
|
||||
prepend-icon="access_time"
|
||||
readonly
|
||||
v-on="on"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-time-picker
|
||||
v-if="showFrom"
|
||||
v-model="query.from"
|
||||
full-width use-seconds
|
||||
@click:second="$refs.menu.save(query.from)"
|
||||
></v-time-picker>
|
||||
</v-menu>
|
||||
<v-toolbar-items>
|
||||
<v-text-field type="number" v-model.number="query.start" label="start" > </v-text-field>
|
||||
<v-text-field type="number" v-model.number="query.limit" label="limit" > </v-text-field>
|
||||
</v-toolbar-items>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
<v-toolbar-items>
|
||||
<v-btn @click="fit">fit</v-btn>
|
||||
<v-btn @click="getItems">
|
||||
<v-avatar><v-icon>refresh</v-icon></v-avatar>
|
||||
</v-btn>
|
||||
<v-btn @click="pageBack()" :disabled="query.start==1" icon>
|
||||
<v-avatar><v-icon>arrow_back</v-icon> </v-avatar>
|
||||
</v-btn>
|
||||
<v-btn @click="pageNext()" icon>
|
||||
<v-avatar> <v-icon>arrow_forward</v-icon> </v-avatar>
|
||||
</v-btn>
|
||||
</v-toolbar-items>
|
||||
</v-toolbar>
|
||||
|
||||
<v-card-text>
|
||||
<vis-time-line :items="data" :events="Events"
|
||||
:options="options" @select="select"></vis-time-line>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
<v-card>
|
||||
<v-card-text>
|
||||
<pre>{{msg}}</pre>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>{
|
||||
data:function(){
|
||||
return {
|
||||
|
||||
loading: false,
|
||||
options: {editable: false, clickToUse: false,
|
||||
timeAxis: {scale: 'minute', step: 1}
|
||||
},
|
||||
data:[],
|
||||
query:{name: "2019-09-23", start: 1, limit:30, from:"00:00:00", mins:10},
|
||||
Events: new Vue({}),
|
||||
msg:"Select an entry",
|
||||
showFrom: false
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
fit(){
|
||||
this.Events.$emit('fit');
|
||||
},
|
||||
select(sel){
|
||||
|
||||
var hit=this.data.find(item => item.id==sel )
|
||||
var h=JSON.stringify(hit,null,2)
|
||||
this.msg= h
|
||||
},
|
||||
pageNext(){
|
||||
this.query.start+= this.query.limit
|
||||
this.query.from= this.addtime(this.query.from,this.query.mins)
|
||||
this.getItems()
|
||||
},
|
||||
pageBack(){
|
||||
this.query.start-= this.query.limit
|
||||
this.query.from = this.addtime(this.query.from,-this.query.mins)
|
||||
this.getItems()
|
||||
},
|
||||
addtime(time,mins){
|
||||
return moment(time,moment.HTML5_FMT.TIME_SECONDS).add(mins,"m").format(moment.HTML5_FMT.TIME_SECONDS)
|
||||
},
|
||||
getItems(){
|
||||
this.loading=true
|
||||
HTTP.get("logxml", {params:this.query})
|
||||
.then(r=>{
|
||||
this.loading=false
|
||||
|
||||
//var items=r.data.items.filter(item=>{return item.text!="[GET] http://localhost:8984/vue-poc/api/log"})
|
||||
var items=r.data.items
|
||||
//console.log("logxml",items)
|
||||
// {id: 4, content: 'item 4', start: '2014-04-16', end: '2014-04-19', type: 'point'}
|
||||
this.data=items.map(x=>Object.assign({}, x,
|
||||
{ start: x.time,
|
||||
content: x.text.split(";",1)[0],
|
||||
title: x.text,
|
||||
style: x.text.startsWith("[POST] ")?"background-color: red;": "background-color: yellow;",
|
||||
group: x.user}
|
||||
))
|
||||
//console.log("data",this.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
"query":{
|
||||
handler:function(vnew,vold){
|
||||
console.log("watch",vnew,vold)
|
||||
this.$router.push({ query: this.query })
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
created(){
|
||||
console.log("logxml: ",this.$route.query)
|
||||
this.query=Object.assign(this.query,this.$route.query)
|
||||
this.query.start=Number(this.query.start)
|
||||
this.query.limit=Number(this.query.limit)
|
||||
this.getItems();
|
||||
}
|
||||
}</script>
|
||||
|
|
@ -1,10 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
log as data table
|
||||
-->
|
||||
<template id="log">
|
||||
<v-container fluid>
|
||||
<v-card >
|
||||
<v-toolbar >
|
||||
|
||||
|
||||
<v-toolbar-title>Logs
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-text-field
|
||||
prepend-icon="filter_list"
|
||||
label="Filter logs"
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@ module namespace j = 'quodatum.test.logs';
|
|||
import module namespace entity = 'quodatum.models.generated' at "../../models.gen.xqm";
|
||||
import module namespace dice = 'quodatum.web.dice/v4' at "../../lib/dice.xqm";
|
||||
import module namespace web = 'quodatum.web.utils4' at "../../lib/webutils.xqm";
|
||||
|
||||
(:~
|
||||
: job list
|
||||
: show active log
|
||||
:)
|
||||
declare
|
||||
%rest:GET %rest:path("/vue-poc/api/log")
|
||||
|
|
@ -18,6 +19,26 @@ as element(json)
|
|||
return dice:response($items,$entity,web:dice())
|
||||
};
|
||||
|
||||
(:~
|
||||
: show archive log
|
||||
:)
|
||||
declare
|
||||
%rest:GET %rest:path("/vue-poc/api/logxml")
|
||||
%rest:query-param("from", "{ $from }")
|
||||
%rest:query-param("name", "{ $name }")
|
||||
%rest:query-param("mins", "{ $mins }")
|
||||
%output:method("json")
|
||||
function j:archive( $name,$from,$mins)
|
||||
as element(json)
|
||||
{
|
||||
let $_:=trace($from,"from: ")
|
||||
let $entity:=$entity:list("logxml")
|
||||
let $items:=db:open("vue-poc","/logs/")/entries[contains(db:path(.),$name)]/entry
|
||||
(: let $items:= if ($from) then $items[true()] else $items :)
|
||||
return dice:response($items,$entity,web:dice())
|
||||
};
|
||||
|
||||
|
||||
(:~
|
||||
: create a log entry
|
||||
:)
|
||||
|
|
|
|||
29
src/vue-poc/features/adminlog/readme.md
Normal file
29
src/vue-poc/features/adminlog/readme.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# readme
|
||||
|
||||
all abouts logs.
|
||||
|
||||
## vue files
|
||||
### `logs`
|
||||
table
|
||||
- `/log`
|
||||
### `logdate` /ui/logdate
|
||||
Shows timeline, data from
|
||||
`/api/data/logxml?start=1&limit=30&from=02%3A41%3A08`
|
||||
- data/logxml
|
||||
### `logadd`
|
||||
create logentry
|
||||
### `logarchive`
|
||||
cards for log sources
|
||||
|
||||
|
||||
## XQuery
|
||||
### `logs.xqm`
|
||||
|
||||
- `/vue-poc/api/log` Returns "basexlog" entities
|
||||
- `/vue-poc/api/log/add`
|
||||
|
||||
# General
|
||||
|
||||
- `data/basexlogfile` list of archived log file names
|
||||
- `data/basexlog` live logs for last 2 days
|
||||
- `data/logxml`
|
||||
|
|
@ -26,6 +26,9 @@
|
|||
label="Search"
|
||||
></v-text-field>
|
||||
<v-spacer></v-spacer>
|
||||
<router-link :to="{path:'/tasks/xqdoca'}">
|
||||
<v-icon>add_circle</v-icon>
|
||||
</router-link>
|
||||
<v-btn @click="get" icon :loading="loading"
|
||||
:disabled="loading"
|
||||
><v-icon>refresh</v-icon></v-btn>
|
||||
|
|
@ -44,12 +47,17 @@
|
|||
>
|
||||
<v-card :hover="true" >
|
||||
<v-toolbar color="blue lighten-3" dense>
|
||||
<v-card-title >{{ item.name }}</v-card-title>
|
||||
<v-card-title >{{ item.name }}</v-card-title>
|
||||
<v-spacer></v-spacer>
|
||||
<a :href="item.href" target="_new">go</a>
|
||||
</v-toolbar>
|
||||
<v-card-text>{{ item.id }}</v-card-text>
|
||||
<v-card-text>{{ item.created | formatDate }}</v-card-text>
|
||||
<v-card-text>
|
||||
<span :title="item.created">{{ item.created | fromNow }}</span>
|
||||
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<a :href="item.href" target="_new">go</a>
|
||||
<v-btn>Run</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
module namespace j = 'quodatum.test.components';
|
||||
|
||||
(:~
|
||||
: @return sequence of json arrary items for each item
|
||||
: @return sequence of json arary items for each item
|
||||
:)
|
||||
declare function j:tax($items)
|
||||
as element(_)*
|
||||
|
|
@ -27,7 +27,8 @@ return <_ type="object">
|
|||
|
||||
|
||||
(:~
|
||||
: tree
|
||||
: sample tree data as json
|
||||
: source balisage-taxonomy.xml
|
||||
:)
|
||||
declare
|
||||
%rest:GET %rest:path("/vue-poc/api/components/tree")
|
||||
|
|
|
|||
|
|
@ -74,14 +74,14 @@
|
|||
<v-list dense>
|
||||
<v-subheader>Display settings</v-subheader>
|
||||
|
||||
<v-list-item @click="togglefold" avatar >
|
||||
<v-list-item @click="togglefold" >
|
||||
<v-list-item-avatar>
|
||||
<v-icon >vertical_align_center</v-icon>
|
||||
</v-list-item-avatar>
|
||||
<v-list-item-title >Toggle folds</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item @click="wrap=!wrap" avatar >
|
||||
<v-list-item @click="wrap=!wrap" >
|
||||
<v-list-item-avatar>
|
||||
<v-icon >wrap_text</v-icon>
|
||||
</v-list-item-avatar>
|
||||
|
|
@ -89,14 +89,14 @@
|
|||
</v-list-item>
|
||||
<v-divider></v-divider>
|
||||
<v-subheader>Help</v-subheader>
|
||||
<v-list-item @click="acecmd('showSettingsMenu')" avatar >
|
||||
<v-list-item @click="acecmd('showSettingsMenu')" >
|
||||
<v-list-item-avatar>
|
||||
<v-icon >settings</v-icon>
|
||||
</v-list-item-avatar>
|
||||
<v-list-item-title @click="acecmd('showSettingsMenu')" >Show ACE settings</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item @click="acecmd('showKeyboardShortcuts')" avatar>
|
||||
<v-list-item @click="acecmd('showKeyboardShortcuts')">
|
||||
<v-list-item-avatar>
|
||||
<v-icon >keyboard</v-icon>
|
||||
</v-list-item-avatar>
|
||||
|
|
|
|||
|
|
@ -63,14 +63,14 @@
|
|||
<v-list dense>
|
||||
<v-subheader>Display settings</v-subheader>
|
||||
|
||||
<v-list-item @click="togglefold" avatar >
|
||||
<v-list-item @click="togglefold" >
|
||||
<v-list-item-avatar>
|
||||
<v-icon >vertical_align_center</v-icon>
|
||||
</v-list-item-avatar>
|
||||
<v-list-item-title >Toggle folds</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item @click="wrap=!wrap" avatar >
|
||||
<v-list-item @click="wrap=!wrap" >
|
||||
<v-list-item-avatar>
|
||||
<v-icon >wrap_text</v-icon>
|
||||
</v-list-item-avatar>
|
||||
|
|
@ -78,14 +78,14 @@
|
|||
</v-list-item>
|
||||
<v-divider></v-divider>
|
||||
<v-subheader>Help</v-subheader>
|
||||
<v-list-item @click="acecmd('showSettingsMenu')" avatar >
|
||||
<v-list-item @click="acecmd('showSettingsMenu')" >
|
||||
<v-list-item-avatar>
|
||||
<v-icon >settings</v-icon>
|
||||
</v-list-item-avatar>
|
||||
<v-list-item-title @click="acecmd('showSettingsMenu')" >Show ACE settings</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item @click="acecmd('showKeyboardShortcuts')" avatar>
|
||||
<v-list-item @click="acecmd('showKeyboardShortcuts')">
|
||||
<v-list-item-avatar>
|
||||
<v-icon >keyboard</v-icon>
|
||||
</v-list-item-avatar>
|
||||
|
|
|
|||
|
|
@ -60,38 +60,14 @@
|
|||
|
||||
|
||||
</v-toolbar>
|
||||
<v-card-text v-if="done">
|
||||
BEFORE<vp-job :job="job" :result:="result" :query="xq"
|
||||
:job-state="jobState" :elapsed="elapsed" >IN</vp-job>AFTER
|
||||
</v-card-text>
|
||||
<v-card-text >
|
||||
|
||||
<v-flex xs12 style="height:200px" fill-height>
|
||||
<vue-ace :content="xq" mode="xquery" wrap="true"
|
||||
:settings="aceSettings" v-on:change-content="onChange"
|
||||
></vue-ace>
|
||||
</v-flex>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions v-if="showJob" >
|
||||
<v-chip class="primary white--text">{{job.id}}</v-chip>
|
||||
<v-chip class="primary white--text">{{job.job}}</v-chip>
|
||||
|
||||
<v-chip label class="grey white--text">
|
||||
<v-avatar class="red"> <v-icon>lock</v-icon>W</v-avatar>
|
||||
{{ jobState.writes }}</v-chip>
|
||||
|
||||
<v-chip label class="grey white--text">
|
||||
<v-avatar class="amber"> <v-icon>lock</v-icon>R</v-avatar>
|
||||
{{ jobState.reads }}</v-chip>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
<v-progress-circular v-if="waiting" indeterminate class="primary--text"></v-progress-circular>
|
||||
<v-chip>{{ jobState.state }}</v-chip>
|
||||
<v-chip class="primary white--text">
|
||||
<v-avatar > <v-icon>timer</v-icon></v-avatar>
|
||||
{{elapsed}}ms</v-chip>
|
||||
|
||||
</v-card-actions>
|
||||
<vp-job v-if="showJob" :job="job" :waiting="waiting" :job-state="jobState" :elapsed="elapsed"></vp-job>
|
||||
<v-card-text v-if="showError">
|
||||
<v-alert color="error" v-model="showError">Error </v-alert>
|
||||
</v-card-text>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<v-chip v-else color="danger">invalid</v-chip>
|
||||
<v-btn color="primary" @click="$refs.myForm.validate()">validate</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<qd-link href="https://github.com/koumoul-dev/vuetify-jsonschema-form/">vuetify-jsonschema-form@0.24.1</qd-link>
|
||||
<qd-link href="https://github.com/koumoul-dev/vuetify-jsonschema-form/">vuetify-jsonschema-form@0.35.0</qd-link>
|
||||
</v-toolbar>
|
||||
<v-card-actions>
|
||||
<v-layout row wrap>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<v-card-title>File History</v-card-title>
|
||||
<v-card-text>
|
||||
<v-list>
|
||||
<v-list-item v-for="item in items" v-bind:key="item.title" avatar>
|
||||
<v-list-item v-for="item in items" v-bind:key="item.title" >
|
||||
<v-list-item-action>
|
||||
<v-chip v-text="item.protocol">Example Chip</v-chip>
|
||||
</v-list-item-action>
|
||||
|
|
|
|||
|
|
@ -7,14 +7,23 @@
|
|||
:crumbs="[{to: '/entity', text:'Entities'}, {text: entity, disabled: false, menu: 'todo'}]"
|
||||
>crumbs</qd-breadcrumbs>
|
||||
</v-toolbar-title>
|
||||
<v-menu offset-y v-model="showmenu" >
|
||||
<v-menu v-model="showmenu" >
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
dark
|
||||
icon
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon>mdi-dots-vertical</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list dense>
|
||||
<v-subheader >Actions</v-subheader>
|
||||
<v-list-item @click="getxml" >
|
||||
<v-list-item-title >View XML</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item >
|
||||
<v-list-item-title ><a :href="dataurl" target="data">Json</a></v-list-item-title>
|
||||
<v-list-item @click="getxml" >
|
||||
<v-list-item-title >View XML</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item >
|
||||
<v-list-item-title ><a :href="dataurl" target="data">Json</a></v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
|
|
@ -56,9 +65,8 @@
|
|||
|
||||
<v-expansion-panel>
|
||||
<v-expansion-panel-header><v-layout>
|
||||
<v-flex xs12><v-badge >
|
||||
<span slot="badge">{{ item.nfields }}</span>Fields
|
||||
</v-badge>
|
||||
<v-flex xs12>
|
||||
<span >Fields ({{ item.nfields }})</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-expansion-panel-header>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
<v-card>
|
||||
<v-card-title>File transfers</v-card-title>
|
||||
<v-card-text>
|
||||
<qd-fileupload url="upload" @complete="upit">up load</qd-fileupload>
|
||||
<v-file-input v-model="file" label="File input"></v-file-input>
|
||||
<v-btn @click="post()" :disabled="!file">submit</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-container>
|
||||
|
|
@ -14,14 +15,32 @@
|
|||
<script>{
|
||||
data: function(){
|
||||
return {
|
||||
snack: false
|
||||
snack: false,
|
||||
file: null
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
upit:function(s){
|
||||
this.snack=true;
|
||||
},
|
||||
|
||||
post(){
|
||||
let rawData = {
|
||||
name: this.name,
|
||||
gender: this.gender,
|
||||
dob: this.dob
|
||||
}
|
||||
rawData = JSON.stringify(rawData)
|
||||
let formData = new FormData()
|
||||
formData.append('avatar', this.file, this.file.name)
|
||||
formData.append('data', rawData)
|
||||
let response = HTTP.post('upload2', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}).then(r=>{
|
||||
console.log("upload: ",r)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
38
src/vue-poc/features/server/upload.xqm
Normal file
38
src/vue-poc/features/server/upload.xqm
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
xquery version "3.1";
|
||||
(:~
|
||||
: upload test
|
||||
:)
|
||||
module namespace _ = 'quodatum.test.upload';
|
||||
import module namespace Session = 'http://basex.org/modules/session';
|
||||
(:~ DBA directory. :)
|
||||
declare variable $_:DBA-DIRECTORY := (
|
||||
for $dir in db:option('dbpath') || '/.vue-poc'
|
||||
return (
|
||||
if(file:exists($dir)) then () else file:create-dir($dir),
|
||||
file:path-to-native($dir)
|
||||
)
|
||||
);
|
||||
(:~
|
||||
: sample form i/p
|
||||
:)
|
||||
declare %updating
|
||||
%rest:POST %rest:path("/vue-poc/api/upload2")
|
||||
%rest:form-param("data", "{ $data }")
|
||||
%rest:form-param("avatar", "{ $file }")
|
||||
%output:method("text")
|
||||
function _:upload($data, $file)
|
||||
{
|
||||
for $name in map:keys($file)
|
||||
let $content := $file($name)
|
||||
let $path := _:directory() || $name
|
||||
return (
|
||||
file:write-binary($path, $content),
|
||||
update:output(<file name="{ $name }" size="{ file:size($path) }"/>)
|
||||
)
|
||||
};
|
||||
|
||||
declare function _:directory() as xs:string {
|
||||
(: let $dir := Session:get($_:DIRECTORY)
|
||||
return if(exists($dir) and file:exists($dir)) then $dir else :)
|
||||
$_:DBA-DIRECTORY
|
||||
};
|
||||
|
|
@ -9,7 +9,7 @@ import module namespace bf = 'quodatum.tools.buildfields' at "./../../../lib/ent
|
|||
: @default C:/Users/andy/git/vue-poc/src/vue-poc/models/entities
|
||||
:)
|
||||
declare variable $efolder as xs:anyURI external
|
||||
:=xs:anyURI("C:/Users/andy/git/vue-poc/src/vue-poc/models/entities");
|
||||
:=xs:anyURI("C:\Users\andy\git\vue-poc\src\vue-poc\data\vue-poc\entities");
|
||||
|
||||
(:~
|
||||
: Path to xqm file to generate
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ function vue-rest:runtask($task)
|
|||
{ map:keys($params)!<param name="{.}">{map:get($params,.)}</param> }
|
||||
</task>
|
||||
return (
|
||||
query-a:run($url,$params),
|
||||
query-a:run($url, $params, map{}),
|
||||
hlog:save($log)
|
||||
)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,11 +28,7 @@
|
|||
|
||||
<v-card-text>
|
||||
<v-container fluid>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 v-if="!loading">
|
||||
<vp-paramform ref="params" :endpoint="'tasks/'+task"></vp-paramform>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<vp-paramform v-if="!loading" ref="params" :endpoint="'tasks/'+task"></vp-paramform>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-snackbar v-model="snackbar.show"
|
||||
|
|
@ -93,7 +89,7 @@
|
|||
},
|
||||
|
||||
created:function(){
|
||||
this.id=this.$route.query.id
|
||||
if(this.$route.query.id) this.id=this.$route.query.id
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ import module namespace dbtools = 'quodatum.dbtools' at "../../../lib/dbtools.xq
|
|||
declare variable $srcpath as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities";
|
||||
|
||||
(:~ Target BaseX db root path for imported files
|
||||
: @default vuepoc-test
|
||||
: @default vue-poc
|
||||
:)
|
||||
declare variable $targetpath as xs:anyURI external :="/vuepoc-test";
|
||||
declare variable $targetpath as xs:anyURI external :="/entities";
|
||||
|
||||
(:~ unused boolean test
|
||||
: @default true
|
||||
|
|
@ -22,4 +22,4 @@ declare variable $targetpath as xs:anyURI external :="/vuepoc-test";
|
|||
declare variable $boolean as xs:boolean external :=false();
|
||||
|
||||
let $todo:="target"
|
||||
return dbtools:sync-from-path($targetpath, $srcpath)
|
||||
return dbtools:sync-from-path($targetpath, $srcpath,false())
|
||||
|
|
|
|||
24
src/vue-poc/features/tasks/task/tx-dbimport2.xq
Normal file
24
src/vue-poc/features/tasks/task/tx-dbimport2.xq
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
(:~
|
||||
: Import a file or directory into a database
|
||||
: @author andy bunce
|
||||
: @since july 2018
|
||||
:)
|
||||
import module namespace dbtools = 'quodatum.dbtools' at "../../../lib/dbtools.xqm";
|
||||
|
||||
|
||||
(:~ URL of file or folder to import
|
||||
: @default C:/Users/andy/git/vue-poc/src/vue-poc/models/entities
|
||||
:)
|
||||
declare variable $srcpath as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc/models/entities";
|
||||
|
||||
(:~ Target BaseX db root path for imported files
|
||||
: @default /vue-poc/entities
|
||||
:)
|
||||
declare variable $targetpath as xs:anyURI external :="/vuepoc-test";
|
||||
|
||||
(:~ delete from database if not if import files list
|
||||
: @default false
|
||||
:)
|
||||
declare variable $deleteMissing as xs:boolean external :=false();
|
||||
|
||||
dbtools:sync-from-path($targetpath, $srcpath,$deleteMissing )
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
<tasks>
|
||||
<task name="model" url="model.build/tx-model.xq">
|
||||
<title>Generate model.gen.xqm</title>
|
||||
<description>
|
||||
Generate
|
||||
<code>model.gen.xqm</code>
|
||||
<description> Generate <code>model.gen.xqm</code>
|
||||
</description>
|
||||
</task>
|
||||
|
||||
|
|
@ -11,11 +9,13 @@
|
|||
<title>Load files into database</title>
|
||||
<description>Load files into database</description>
|
||||
</task>
|
||||
|
||||
<task name="import2" url="task/tx-dbimport2.xq">
|
||||
<title>Import files into a database</title>
|
||||
<description>Load files into database</description>
|
||||
</task>
|
||||
<task name="xqdoc2" url="xqdoc/tx-xqdoc2.xq">
|
||||
<title>XQdoc 2</title>
|
||||
<description>Generate xquery documentation for folder. Using standard
|
||||
task.</description>
|
||||
<description>Generate xquery documentation for folder. Using standard task.</description>
|
||||
</task>
|
||||
|
||||
<task name="xqdoc-rest2" url="xqdoc/tx-xqrest2.xq">
|
||||
|
|
@ -23,12 +23,11 @@
|
|||
<description>XQdoc.2..</description>
|
||||
</task>
|
||||
|
||||
<task name="xqdoc3" url="xqdoc/tx-xqdoc3.xq">
|
||||
<title>XQdoc to static</title>
|
||||
<description>Generate xquery documentation for folder to static folder
|
||||
</description>
|
||||
</task>
|
||||
|
||||
<task name="xqdoc3" url="xqdoc/tx-xqdoc3.xq">
|
||||
<title>XQdoc to static</title>
|
||||
<description>Generate xquery documentation for folder to static folder </description>
|
||||
</task>
|
||||
|
||||
<task name="vuecompile">
|
||||
<title>vue compile</title>
|
||||
<description>compile</description>
|
||||
|
|
@ -41,4 +40,10 @@
|
|||
<param name="appname">Name for new application</param>
|
||||
</params>
|
||||
</task>
|
||||
</tasks>
|
||||
|
||||
<task name="xqdoca" url="file:///C:/Users/andy/git/xqdoca/src/main/xqdoca.xq">
|
||||
<title>Create xqDoc</title>
|
||||
<description>xquery documentation</description>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
|
|
|||
|
|
@ -56,8 +56,9 @@
|
|||
items: [],
|
||||
loading: false,
|
||||
q: null,
|
||||
headers: [
|
||||
{ text: 'Task', value: 'title' },
|
||||
headers: [
|
||||
{ text: 'Task', value: 'to' },
|
||||
{ text: 'Title', value: 'title' },
|
||||
{ text: 'Description', value: 'description' },
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
|
||||
declare namespace c="http://www.w3.org/ns/xproc-step";
|
||||
|
||||
for $f in //c:file
|
||||
let $ip:= $f/@name/resolve-uri(.,base-uri(.))
|
||||
let $xq:= fetch:text($ip)
|
||||
return xqd:parse($xq)
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
|
||||
declare namespace c="http://www.w3.org/ns/xproc-step";
|
||||
|
||||
for $f in //c:file
|
||||
let $ip:= $f/@name/resolve-uri(.,base-uri(.))
|
||||
return xqd:xqdoc($ip,map{})
|
||||
|
|
@ -1 +0,0 @@
|
|||
<newnode/>
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<ul>
|
||||
<li>
|
||||
<a>/vue-poc</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/collection</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/components/tree</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/data/users</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/data/{$entity}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/edit</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/eval/execute</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/eval/imports</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/eval/invoke</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/eval/plan</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/eval/result/{$id}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/eval/submit</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/get</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/get2</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/history</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/images/datetaken</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/images/keywords2</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/images/list</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/images/list/{ $id }/image</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/images/list/{ $id }/meta</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/images/list/{$id}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/images/report</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/job</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/job/{$job}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/log</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/log/add</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/login-check</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/logout</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/ping</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/repo</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/search</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/start</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/status</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/tasks</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/tasks/model</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/tasks/task</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/tasks/vue-compile</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/tasks/xqdoc</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/tasks/{$task}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/test-select</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/thumbnail</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/thumbnail/images</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/thumbnail/validate</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/user</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/validate</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/xqdoc</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/api/xslt</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/ui</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>/vue-poc/ui/{$file=.+}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>vue-poc/api/data/entity</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>vue-poc/api/data/entity/{$entity}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>vue-poc/api/data/entity/{$entity}/field</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
(:~
|
||||
: Generate html for for XQuery sources
|
||||
:)
|
||||
module namespace vue-api = 'quodatum:vue.api';
|
||||
|
||||
import module namespace query-a = 'vue-poc/query-a' at "../../../lib/query-a.xqm";
|
||||
import module namespace hlog = 'quodatum.data.history' at '../../../lib/history.xqm';
|
||||
|
||||
declare variable $vue-api:query as xs:anyURI :=resolve-uri("tx-xqdoc.xq");
|
||||
|
||||
|
||||
(:~
|
||||
: run xqdoc task.
|
||||
:)
|
||||
declare
|
||||
%rest:POST %rest:path("/vue-poc/api/tasks/xqdoc")
|
||||
%rest:produces("application/json")
|
||||
%output:method("json")
|
||||
%updating
|
||||
function vue-api:model()
|
||||
{
|
||||
let $params:=query-a:params($vue-api:query)
|
||||
let $log:=<task task="xqdoc" url="url?">
|
||||
todo
|
||||
</task>
|
||||
return (query-a:update($vue-api:query,$params),
|
||||
hlog:save($log)
|
||||
)
|
||||
};
|
||||
|
||||
(:~
|
||||
: get xqdoc settings.
|
||||
:)
|
||||
declare
|
||||
%rest:GET %rest:path("/vue-poc/api/tasks/xqdoc")
|
||||
%rest:produces("application/json")
|
||||
%output:method("json")
|
||||
function vue-api:settings()
|
||||
{
|
||||
let $xq:=resolve-uri($vue-api:query)
|
||||
return query-a:inspect($xq)
|
||||
};
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
(:~
|
||||
: Generate html for for XQuery sources
|
||||
: @return info about the run (json format)
|
||||
:)
|
||||
import module namespace fw="quodatum:file.walker";
|
||||
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
|
||||
declare namespace c="http://www.w3.org/ns/xproc-step";
|
||||
|
||||
(:~ URL of the root folder to document
|
||||
: @default C:/Users/andy/git/vue-poc/src/vue-poc
|
||||
:)
|
||||
declare variable $efolder as xs:anyURI external :=
|
||||
xs:anyURI("C:/Users/andy/git/vue-poc/src/vue-poc");
|
||||
|
||||
(:~ file URL root folder for saving results
|
||||
: @default C:/tmp/xqdoc/
|
||||
:)
|
||||
declare variable $target as xs:anyURI external :=
|
||||
xs:anyURI("C:/tmp/xqdoc/");
|
||||
|
||||
declare variable $state as element(state):=db:open("vue-poc","/state.xml")/state;
|
||||
|
||||
let $project:=tokenize($efolder,"[/\\]")[last()]=>trace("xqdoc: ")
|
||||
let $files:= fw:directory-list($efolder,map{"include-filter":".*\.xqm"})
|
||||
let $id:=$state/last-id
|
||||
let $opts:=map{
|
||||
"src-folder": $efolder,
|
||||
"project": $project,
|
||||
"ext-id": $id/string()
|
||||
}
|
||||
let $op:=xqd:save-xq($files,$target,$opts)
|
||||
let $result:=<json type="object">
|
||||
<extra>hello2</extra>
|
||||
<msg> {$target}, {count($files//c:file)} files processed.</msg>
|
||||
<id>{$id/string()}</id>
|
||||
</json>
|
||||
return (
|
||||
update:output($result),
|
||||
replace value of node $id with 1+$state/last-id
|
||||
)
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
(:~
|
||||
: Generate html for for XQuery sources
|
||||
: @return info about the run (json format)
|
||||
:)
|
||||
|
||||
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";
|
||||
|
||||
|
||||
|
||||
(:~ URL of the root folder to document
|
||||
: @default C:/Users/andy/git/vue-poc/src/vue-poc
|
||||
:)
|
||||
declare variable $efolder as xs:anyURI external := xs:anyURI("C:/Users/andy/git/vue-poc/src/vue-poc");
|
||||
|
||||
declare variable $id as element(last-id):=db:open("vue-poc","/state.xml")/state/last-id;
|
||||
let $path:="static/xqdoc/" || "33" || "/"
|
||||
let $root:=db:option("webpath")=>file:path-to-uri()
|
||||
let $target:=resolve-uri($path,$root)
|
||||
|
||||
|
||||
let $state:=xqd:read($efolder)=>trace("READ: ")
|
||||
let $opts:=map{
|
||||
"src-folder": $efolder,
|
||||
"project": $state?project,
|
||||
"ext-id": $id/string(),
|
||||
"resources": "resources/"
|
||||
}
|
||||
|
||||
(: generate o/ps per source file :)
|
||||
let $modmap:=for $file at $pos in $state?files
|
||||
let $params:=map:merge((map{
|
||||
"source": $file?xqparse/string(),
|
||||
"filename": $file?path,
|
||||
"cache": $xqd:cache,
|
||||
"show-private": true(),
|
||||
"root": "../../",
|
||||
"resources": "resources/"},
|
||||
$opts))
|
||||
return (
|
||||
map{
|
||||
"document": $file?xqdoc,
|
||||
"uri": $file?href || "/xqdoc.xml", "opts": $xqd:XML
|
||||
},
|
||||
map{
|
||||
"document": $file?xqparse,
|
||||
"uri": $file?href || "xqparse.xml", "opts": $xqd:XML
|
||||
},
|
||||
map{
|
||||
"document": xqd:xqdoc-html($file?xqdoc,$params),
|
||||
"uri": $file?href || "index.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(($index,$restxq,$imports,$modmap),$target),
|
||||
xqd:export-resources2($target),
|
||||
replace value of node $id with 1+$id,
|
||||
update:output(
|
||||
<json type="object">
|
||||
<extra>XQdoc generated</extra>
|
||||
<msg> {$target}, {count($state?files)} files processed.</msg>
|
||||
<id>{$id/string()}</id>
|
||||
</json>
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
(:~
|
||||
: XQDoc: generate restxq.html from resources located at $target
|
||||
:)
|
||||
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";
|
||||
import module namespace tree = 'quodatum.data.tree' at "../../../lib/tree.xqm";
|
||||
|
||||
declare namespace c="http://www.w3.org/ns/xproc-step";
|
||||
declare namespace xqdoc="http://www.xqdoc.org/1.0";
|
||||
|
||||
|
||||
(:~ URL of the doc source
|
||||
: @default file:///C:/tmp/xqdoc/
|
||||
:)
|
||||
declare variable $target as xs:anyURI external :=
|
||||
"file:///C:/tmp/xqdoc/" cast as xs:anyURI;
|
||||
|
||||
|
||||
(:~ sequence of maps for each restxq:path
|
||||
: @param
|
||||
:)
|
||||
declare function local:import($path,
|
||||
$id as item(),
|
||||
$folder)
|
||||
as map(*)*
|
||||
{
|
||||
let $uri:=``[modules/F`{ string($id) }`/]``
|
||||
let $doc:=doc(resolve-uri($uri || "xqdoc.xml",$folder))
|
||||
let $annots:=xqd:annotations($doc/*, $xqd:nsRESTXQ,"path")
|
||||
return $annots!map{
|
||||
"id": $id,
|
||||
"uri": $uri,
|
||||
"path": $path,
|
||||
"annot": .,
|
||||
"function": ./../../(xqdoc:name/string(),@arity/string()),
|
||||
"description": ./../../xqdoc:comment/xqdoc:description/node()
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
(:~
|
||||
: html for page.
|
||||
:)
|
||||
declare function local:page($reps as map(*)*)
|
||||
{
|
||||
let $tree:=trace($reps?uri)
|
||||
let $tree:=tree:build($tree)=>trace("TRRES")
|
||||
let $op:= <div>
|
||||
<nav id="toc">
|
||||
<div>
|
||||
<a href="index.html">
|
||||
Index
|
||||
</a>
|
||||
</div>
|
||||
<h2>
|
||||
<a id="contents"></a>
|
||||
<span >
|
||||
RestXQ
|
||||
</span>
|
||||
</h2>
|
||||
<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/*/*!local:tree-list(.,2) } </ol>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<a href="index.html">index: </a>
|
||||
|
||||
<ul>{$reps!local:path-to-html(.)}</ul>
|
||||
</div>
|
||||
return xqhtml:page($op,map{"resources": "resources/"})
|
||||
};
|
||||
|
||||
(:~ tree to list :)
|
||||
declare function local: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/*!local: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 a path :)
|
||||
declare function local: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>
|
||||
};
|
||||
|
||||
|
||||
(:sequence of maps :map{id:,path:,annot:} :)
|
||||
let $reports:= doc(resolve-uri("files.xml",$target))
|
||||
//c:file!local:import(string-join(ancestor-or-self::*/@name,"/"),position(),$target)
|
||||
|
||||
(: 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)
|
||||
return if(empty($hit)) then () else 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))
|
||||
let $result:=<json type="object">
|
||||
<extra>hello2</extra>
|
||||
<msg> {$target}, {count($data)} uris processed.</msg>
|
||||
<id>xqrest2 ID??</id>
|
||||
</json>
|
||||
return
|
||||
(
|
||||
local:page( $data?($uris))
|
||||
=>xqd:store2("restxq.html",$xqd:HTML5)
|
||||
=>store:store($target),
|
||||
update:output($result)
|
||||
)
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<pipeline name='XQDoc generator' xmlns='http://quodatum.com/ns/pipeline'>>
|
||||
<xquery href="tx-xqdoc2.xq">
|
||||
<with-param name="efolder">C:/Users/andy/git/vue-poc/src/vue-poc</with-param>
|
||||
<with-param name="target">C:/tmp/xqdoc/pipe/</with-param>
|
||||
</xquery>
|
||||
<xquery href="tx-xqrest2.xq">
|
||||
<with-param name="target">file:///C:/tmp/xqdoc/pipe/</with-param>
|
||||
</xquery>
|
||||
</pipeline>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-model href="../schema/pipeline.rnc" type="application/relax-ng-compact-syntax"?>
|
||||
<pipeline name='XQDoc generator' xmlns='http://quodatum.com/ns/pipeline'>
|
||||
|
||||
<directory-list href="C:\Users\andy\git\vue-poc\src\vue-poc\"
|
||||
include-filter=".*\.xqm" />
|
||||
<store base="C:/tmp/pipes/" fileExpression="'files.xml'" dated="true" />
|
||||
<pipeline>
|
||||
<xslt href="C:\Users\andy\git\vue-poc\src\vue-poc\lib\xqdoc\html-index.xsl">
|
||||
<param/>
|
||||
</xslt>
|
||||
<store base="C:/tmp/pipes/" fileExpression="'index.html'" dated="true" output="html5"/>
|
||||
</pipeline>
|
||||
<pipeline>
|
||||
<xquery href="getxqdoc.xq"/>
|
||||
<store base="C:/tmp/pipes/" fileExpression="'F' || $position || '/xqdoc.xml'" dated="true"/>
|
||||
<identity/>
|
||||
<!--
|
||||
<xslt href="C:\Users\andy\git\vue-poc\src\vue-poc\lib\xqdoc\html-module.xsl"/>
|
||||
-->
|
||||
<store base="C:/tmp/pipes/" fileExpression="'F' || $position || '/index.html'" dated="true" output="html5"/>
|
||||
|
||||
</pipeline>
|
||||
<pipeline>
|
||||
<xquery href="getxparse.xq"/>
|
||||
<store base="C:/tmp/pipes/" fileExpression="'F' || $position || '/xparse.xml'" dated="true"/>
|
||||
</pipeline>
|
||||
|
||||
</pipeline>
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<template id="xqdoc">
|
||||
<v-container fluid>
|
||||
<v-card >
|
||||
<v-toolbar class="orange darken-1">
|
||||
<v-btn icon to="/tasks"><v-icon>arrow_back</v-icon></v-btn>
|
||||
<v-card-title >
|
||||
<span class="white--text">Task: Generate <code>xqdoc</code></span>
|
||||
</v-card-title>
|
||||
<a>{{ id }}</a>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" @click="submit()" :loading="waiting"
|
||||
:disabled="waiting">
|
||||
<v-icon>play_circle_outline</v-icon>
|
||||
Run</v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text>
|
||||
<v-container fluid>
|
||||
<v-layout row wrap>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="params.efolder"
|
||||
label="Root Folder containing xq files"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="params.target"
|
||||
label="Path for xqdoc files"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
|
||||
|
||||
<v-alert color="success" v-model="alert.success">
|
||||
{{alert.timestamp}}:{{alert.msg}}
|
||||
</v-alert>
|
||||
<v-alert color="error" v-model="alert.error">
|
||||
{{alert.timestamp}}:<code>{{alert.msg}}</code>
|
||||
</v-alert>
|
||||
</v-card>
|
||||
<code>{{code}}</code>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>{
|
||||
data: function(){
|
||||
return {
|
||||
params:{
|
||||
efolder:"C:/Users/andy/git/vue-poc/src/vue-poc",
|
||||
target:"C:/tmp/xqdoc/"
|
||||
},
|
||||
waiting:false,
|
||||
alert:{msg:"",success:false,error:false},
|
||||
id: null
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
submit(){
|
||||
this.waiting=true
|
||||
this.alert={msg:"Loading..",success:false,error:false}
|
||||
HTTP.post("tasks/xqdoc",Qs.stringify(this.params))
|
||||
.then(r=>{
|
||||
this.waiting=false;
|
||||
this.id= r.data.id;
|
||||
this.alert={msg:r.data.msg,success:true,error:false}
|
||||
console.log(r.data)
|
||||
Settings.setItem('tasks/xqdoc',this.params)
|
||||
})
|
||||
.catch(error=>{
|
||||
this.waiting=false
|
||||
this.alert={msg:error.response.data,success:false,error:true}
|
||||
console.log(error);
|
||||
alert("bad")
|
||||
});
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
Settings.getItem('tasks/xqdoc')
|
||||
.then((v)=>{
|
||||
if(v)this.params=v
|
||||
})
|
||||
},
|
||||
|
||||
computed:{
|
||||
code(){return 'generate xqdoc'}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<template id="xqdoc2">
|
||||
<v-container fluid v-resize="onResize">
|
||||
<v-card>
|
||||
<v-toolbar class="orange">
|
||||
<v-btn @click="validate" :loading="loading"
|
||||
:disabled="loading"
|
||||
><v-icon>play_circle_outline</v-icon>xqdoc</v-btn>
|
||||
<span v-text="elapsed"></span>ms. Height:
|
||||
<span v-text="height"></span>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-menu offset-y left>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn icon dark v-on="on"><v-icon>settings</v-icon></v-btn>
|
||||
</template>
|
||||
<v-card >
|
||||
<v-toolbar class="green">
|
||||
<v-card-title >Settings................</v-card-title>
|
||||
</v-toolbar>
|
||||
<v-card-text>
|
||||
stuff
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-menu>
|
||||
</v-toolbar>
|
||||
<v-card-text >
|
||||
here
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>{
|
||||
data: function(){
|
||||
return {
|
||||
loading: false,
|
||||
elapsed: null,
|
||||
height: null,
|
||||
result: null,
|
||||
doc: "c:/test.xml",
|
||||
schema: "c:/schema.xsd"
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
onResize(){
|
||||
this.height = window.innerHeight
|
||||
},
|
||||
validate(){
|
||||
|
||||
this.loading=true
|
||||
this.start = performance.now();
|
||||
HTTPNE.get("validate",Qs.stringify({doc: this.doc, schema: this.schema}))
|
||||
.then(r=>{
|
||||
console.log(r)
|
||||
this.elapsed=Math.floor(performance.now() - this.start);
|
||||
this.loading=false
|
||||
if(r.data.rc==0){
|
||||
this.result=r.data.result
|
||||
}else{
|
||||
this.result=r.data.info
|
||||
}
|
||||
})
|
||||
.catch(r=> {
|
||||
console.log("error",r)
|
||||
this.result=r.message + ": "+ r.config.url + "\n"+ r.response.data
|
||||
this.loading=false
|
||||
});
|
||||
},
|
||||
},
|
||||
created:function(){
|
||||
console.log("notfound",this.$route.query.q)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -36,12 +36,16 @@ return $zip
|
|||
:)
|
||||
declare %updating function dbtools:sync-from-path(
|
||||
$dbname as xs:string,
|
||||
$path as xs:string)
|
||||
$path as xs:string,
|
||||
$delete-missing as xs:boolean
|
||||
)
|
||||
{
|
||||
dbtools:sync-from-files($dbname,
|
||||
$path,
|
||||
file:list($path,fn:true()),
|
||||
hof:id#1)
|
||||
hof:id#1,
|
||||
$delete-missing
|
||||
)
|
||||
};
|
||||
|
||||
(:~
|
||||
|
|
@ -53,18 +57,22 @@ declare %updating function dbtools:sync-from-path(
|
|||
: @param $ingest function to apply f(fullsrcpath)->anotherpath or xml nodes
|
||||
:)
|
||||
declare %updating
|
||||
function dbtools:sync-from-files($dbname as xs:string,
|
||||
function dbtools:sync-from-files($dbpath as xs:string,
|
||||
$path as xs:string,
|
||||
$files as xs:string*,
|
||||
$ingest as function(*))
|
||||
$ingest as function(*),
|
||||
$delete-missing as xs:boolean
|
||||
)
|
||||
{
|
||||
let $path:=$path ||"/"
|
||||
let $files:=$files!fn:translate(.,"\","/")
|
||||
let $files:=fn:filter($files,function($f){file:is-file(fn:concat($path,$f))})
|
||||
let $dbpath:=tokenize($dbpath,"/")[.]
|
||||
let $dbname:= head($dbpath)
|
||||
return if(db:exists($dbname)) then
|
||||
(
|
||||
for $d in db:list($dbname)
|
||||
where fn:not($d=$files)
|
||||
where $delete-missing and fn:not($d=$files)
|
||||
return db:delete($dbname,$d),
|
||||
|
||||
for $f in $files
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
(:~
|
||||
: evaluTE query library
|
||||
: XQuery evalution helpers library
|
||||
: query-a:inspect($mod as xs:anyURI) return {description:.., updating:.., url:.., fields:[{model:..,label:..,type:..}]}
|
||||
: query-a:params($mod as xs:anyURI)
|
||||
: query-a:run($query as xs:anyURI,$params as map(*))
|
||||
:
|
||||
: @author Andy Bunce, 2018
|
||||
:)
|
||||
|
|
@ -12,9 +15,10 @@ import module namespace request = "http://exquery.org/ns/request";
|
|||
: attributes of a stored query including parameters and updating status.
|
||||
: @return json format
|
||||
:)
|
||||
declare function query-a:inspect($mod as xs:anyURI)
|
||||
declare function query-a:inspect($mod as xs:string)
|
||||
as element(json)
|
||||
{
|
||||
let $mod:= xs:anyURI($mod)
|
||||
let $updating:=xquery:parse-uri($mod)/@updating/string()
|
||||
let $d:=inspect:module($mod)
|
||||
let $vars:=$d/variable[@external="true"]
|
||||
|
|
@ -63,16 +67,23 @@ as map(*)
|
|||
)
|
||||
};
|
||||
|
||||
(:~
|
||||
:
|
||||
:)
|
||||
declare
|
||||
%updating
|
||||
function query-a:run($query as xs:anyURI,$params as map(*))
|
||||
{
|
||||
function query-a:run($query as xs:string,
|
||||
$bindings as map(*),
|
||||
$options as map(*)
|
||||
)
|
||||
{
|
||||
let $query := xs:anyURI($query)
|
||||
let $updating:=xquery:parse-uri($query)/@updating/boolean(.)
|
||||
return if($updating) then
|
||||
xquery:invoke-update($query,$params)
|
||||
xquery:eval-update($query, $bindings, $options)
|
||||
else
|
||||
<json type="object">
|
||||
<res>{ xquery:invoke($query,$params)}</res>
|
||||
<res>{ xquery:invoke($query, $bindings, $options)}</res>
|
||||
<params>todo</params>
|
||||
</json>=>update:output()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,10 +9,14 @@ declare default function namespace 'quodatum.web.utils4';
|
|||
import module namespace request = "http://exquery.org/ns/request";
|
||||
declare namespace rest = 'http://exquery.org/ns/restxq';
|
||||
|
||||
(:~ map of available dice parameters :)
|
||||
declare function dice(){
|
||||
(:~ map of dice parameters taken from current http request
|
||||
: "start","limit","sort","fields"
|
||||
:)
|
||||
declare function dice()
|
||||
as map(xs:string,item()*)
|
||||
{
|
||||
let $fld:=function($n){
|
||||
request:parameter($n)!map:entry($n,request:parameter($n))
|
||||
request:parameter($n)!map:entry($n,.)
|
||||
}
|
||||
return map:merge(("start","limit","sort","fields")!$fld(.))
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,127 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generates html index page. Project: xqdoc Author: Andy Bunce Date: 20170101
|
||||
Version: 0.1 Comments: I/p is files e.g <c:directory name="adminlog" xml:base="file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/adminlog/">
|
||||
<c:file name="logs.xqm"/> -->
|
||||
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:doc="http://www.xqdoc.org/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
|
||||
xmlns:qd="http://www.quodatum.com/ns/xsl" exclude-result-prefixes="xs doc fn"
|
||||
xmlns:c="http://www.w3.org/ns/xproc-step" version="3.0">
|
||||
<xsl:import href="xqdoc.xsl"/>
|
||||
|
||||
<!-- build project index" -->
|
||||
<xsl:param name="project" as="xs:string" >?</xsl:param>
|
||||
<xsl:param name="ext-id" as="xs:string" >?</xsl:param>
|
||||
<xsl:param name="src-folder" as="xs:string" >c:/</xsl:param>
|
||||
<!-- relative path to resource files -->
|
||||
<xsl:param name="resources" as="xs:string" select="'resources/'" />
|
||||
|
||||
<xsl:variable name="css" select="concat($resources,'base.css')" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Generator"
|
||||
content="xqdoc-r - https://github.com/quodatum/xqdoc-r" />
|
||||
|
||||
<title>
|
||||
<xsl:value-of select="'Index'" /> <xsl:value-of select="$ext-id" />
|
||||
|
||||
* xqDoc
|
||||
</title>
|
||||
<xsl:call-template name="resources">
|
||||
<xsl:with-param name="path" select="$resources"/>
|
||||
</xsl:call-template>
|
||||
</head>
|
||||
|
||||
<body class="home" id="top">
|
||||
<div id="main">
|
||||
<h1>
|
||||
<span class="tag tag-success">
|
||||
<xsl:value-of select="$project" />
|
||||
</span>
|
||||
XQDoc ,id: <xsl:value-of select="$ext-id" />
|
||||
</h1>
|
||||
<xsl:call-template name="toc" />
|
||||
<a href="restxq.html">RestXQ</a>
|
||||
<div>src: <xsl:value-of select="$src-folder" /></div>
|
||||
<div id="file">
|
||||
<h1>Files</h1>
|
||||
<ul>
|
||||
<xsl:apply-templates select=".//c:file" />
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="ns">
|
||||
<h1>Namespace</h1>
|
||||
<ul>
|
||||
<xsl:for-each select=".//c:file">
|
||||
<xsl:variable name="path" select="resolve-uri(@name,$src-folder)"/>
|
||||
<xsl:variable name="doc" select="doc($path)"/>
|
||||
<li>
|
||||
<xsl:value-of select="position()"/>
|
||||
<xsl:value-of select="$path"/>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p style="text-align:right">
|
||||
|
|
||||
generated at
|
||||
<xsl:value-of select="current-dateTime()" />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="c:file">
|
||||
<xsl:variable name="path" select="string-join(ancestor-or-self::*/@name,'/')"/>
|
||||
<li>
|
||||
<a href="modules/F{position()}/index.html">
|
||||
<xsl:value-of select="qd:path(@name)" />
|
||||
</a>
|
||||
|
||||
<xsl:value-of select="position()" />
|
||||
<xsl:value-of select="$path" />
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="toc">
|
||||
<nav id="toc">
|
||||
<h2>
|
||||
<a id="contents"></a>
|
||||
<span class="tag tag-success">
|
||||
<xsl:value-of select="$project" />
|
||||
</span>
|
||||
</h2>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#main">
|
||||
<span class="secno">1 </span>
|
||||
<span class="content">Introduction</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#ns">
|
||||
<span class="secno">2 </span>
|
||||
<span class="content">Namespaces</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#file">
|
||||
<span class="secno">3 </span>
|
||||
<span class="content">Files</span>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -1,674 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:doc="http://www.xqdoc.org/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
|
||||
xmlns:qd="http://www.quodatum.com/ns/xsl" exclude-result-prefixes="xs doc fn"
|
||||
version="3.0">
|
||||
<xsl:import href="xqdoc.xsl" />
|
||||
<!-- Standalone xqdoc:xqdoc transform mode"restxq" -->
|
||||
<xsl:param name="project" as="xs:string" select="'unknown'" />
|
||||
<xsl:param name="source" as="xs:string">
|
||||
Source not available
|
||||
</xsl:param>
|
||||
<xsl:param name="filename" as="xs:string" select="'?file'" />
|
||||
|
||||
<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="'../../'" />
|
||||
<xsl:variable name="index" select="concat($root,'index.html')" />
|
||||
<xsl:variable name="vars"
|
||||
select="//doc:variable[$show-private or not(doc:annotations/doc:annotation/@name='private')]" />
|
||||
<xsl:variable name="funs"
|
||||
select="//doc:function[$show-private or not(doc:annotations/doc:annotation/@name='private')]" />
|
||||
<xsl:variable name="docuri"
|
||||
select="//doc:xqdoc/doc:module/doc:uri/string()" />
|
||||
<!-- prefixes used for RESTXQ namespace -->
|
||||
<xsl:variable name="restxq"
|
||||
select="//doc:namespace[@uri='http://exquery.org/ns/restxq']/@prefix/string()" />
|
||||
<!-- generate module html // -->
|
||||
<xsl:template match="//doc:xqdoc">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Generator"
|
||||
content="xqdoc-r - https://github.com/quodatum/xqdoc-r 2018-11-02" />
|
||||
|
||||
<title>
|
||||
<xsl:value-of select="$docuri" />
|
||||
- xqDoc
|
||||
</title>
|
||||
<xsl:call-template name="resources">
|
||||
<xsl:with-param name="path" select="concat($root,$resources)" />
|
||||
</xsl:call-template>
|
||||
</head>
|
||||
<body class="home" id="top">
|
||||
<div id="main">
|
||||
<xsl:apply-templates select="doc:module" />
|
||||
|
||||
<xsl:call-template name="toc" />
|
||||
<xsl:apply-templates select="doc:imports" />
|
||||
<xsl:apply-templates select="doc:variables" />
|
||||
<xsl:apply-templates select="doc:functions" />
|
||||
|
||||
<xsl:apply-templates select="doc:namespaces" />
|
||||
<xsl:apply-templates select="doc:functions"
|
||||
mode="restxq" />
|
||||
<div>
|
||||
<h3 id="source">Original Source Code</h3>
|
||||
<pre><code class="language-xquery"><xsl:value-of select="$source" /></code></pre>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class="footer">
|
||||
<p style="text-align:right">
|
||||
<i>
|
||||
<xsl:value-of select="$filename" />
|
||||
<a href="xqdoc.xml" target="xqdoc">
|
||||
xqdoc
|
||||
</a>,
|
||||
<a href="xqparse.xml" target="xqparse">
|
||||
xqparse
|
||||
</a>
|
||||
</i>
|
||||
|
|
||||
generated at
|
||||
<xsl:value-of select="current-dateTime()" />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:module">
|
||||
<h1>
|
||||
<span class="tag tag-success">
|
||||
<xsl:value-of select="doc:uri" />
|
||||
</span>
|
||||
<small>
|
||||
 
|
||||
<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: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">
|
||||
<details>
|
||||
<summary><a href="#imports">Imports</a></summary>
|
||||
<table class="data" style="float:none">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Uri</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:for-each select="doc:import">
|
||||
<xsl:sort select="lower-case(doc:uri)" />
|
||||
<tr>
|
||||
<td>
|
||||
<xsl:value-of select="string(@type)" />
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="string(doc:uri)" />
|
||||
<xsl:sequence select="qd:nslink(doc:uri)"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:namespaces[doc:namespace]">
|
||||
<div id="namespaces">
|
||||
<h3>
|
||||
<a href="#namespaces">Namespaces</a>
|
||||
</h3>
|
||||
<p>The following namespaces are defined:</p>
|
||||
<table class="data" style="float:none">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Prefix</th>
|
||||
<th>Uri</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:for-each select="doc:namespace">
|
||||
<xsl:sort select="lower-case(@prefix)" />
|
||||
<tr>
|
||||
<td>
|
||||
<xsl:value-of select="string(@prefix)" />
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="string(@uri)" />
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:variables[doc:variable]">
|
||||
<div id="variables">
|
||||
<h3>
|
||||
<a href="#variables">Variables</a>
|
||||
</h3>
|
||||
<xsl:for-each select="$vars">
|
||||
<xsl:sort select="lower-case(doc:name)" />
|
||||
<xsl:apply-templates select="." />
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="doc:variable">
|
||||
<xsl:variable name="id" select="concat('$',doc:name)" />
|
||||
<div id="{ $id }">
|
||||
<h4>
|
||||
<a href="#{$id}">
|
||||
<xsl:value-of select="$id" />
|
||||
</a>
|
||||
</h4>
|
||||
<dl>
|
||||
<xsl:apply-templates select="doc:comment/doc:description" />
|
||||
<dt class="label">Type</dt>
|
||||
<dd>
|
||||
<xsl:value-of select="doc:type" />
|
||||
<xsl:value-of select="doc:type/@occurrence" />
|
||||
</dd>
|
||||
</dl>
|
||||
<xsl:apply-templates select="doc:annotations" />
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:uri">
|
||||
<xsl:value-of select="." />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:functions[doc:function]">
|
||||
<div id="functions">
|
||||
<h3>
|
||||
<a href="#functions">Functions</a>
|
||||
</h3>
|
||||
<xsl:for-each-group select="$funs" group-by="doc:name">
|
||||
<xsl:sort select="lower-case(doc:name)" />
|
||||
|
||||
<xsl:call-template name="function">
|
||||
<xsl:with-param name="fun" select="current-group()" />
|
||||
</xsl:call-template>
|
||||
|
||||
</xsl:for-each-group>
|
||||
<!-- <xsl:apply-templates select="doc:function" /> -->
|
||||
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<!-- o/p details for function $fun has all defined arities -->
|
||||
<xsl:template name="function">
|
||||
<xsl:param name="fun" as="element(doc:function)*" />
|
||||
<xsl:variable name="id" select="$fun[1]/doc:name" />
|
||||
<xsl:variable name="funs">
|
||||
<xsl:for-each select="fun">
|
||||
<xsl:sort select="@arity" data-type="number" />
|
||||
<xsl:copy-of select="." />
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<div id="{$id}">
|
||||
<h4>
|
||||
<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]" />
|
||||
<dt class="label">Signature</dt>
|
||||
<dd>
|
||||
<xsl:apply-templates select="$fun" mode="signature" />
|
||||
</dd>
|
||||
<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>
|
||||
|
||||
<xsl:template match="doc:function" mode="signature">
|
||||
<div class="proto">
|
||||
<code class="function">
|
||||
<xsl:value-of select="doc:name" />
|
||||
</code>
|
||||
<xsl:text>( </xsl:text>
|
||||
<xsl:for-each select="doc:parameters/doc:parameter">
|
||||
<code class="arg">
|
||||
<xsl:value-of select="doc:name" />
|
||||
</code>
|
||||
<code class="as"> as </code>
|
||||
<code class="type">
|
||||
<xsl:value-of select="doc:type" />
|
||||
<xsl:value-of select="doc:type/@occurrence/string()" />
|
||||
</code>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:text> )</xsl:text>
|
||||
<code class="as"> as </code>
|
||||
<code class="return-type">
|
||||
<xsl:value-of select="doc:return/doc:type" />
|
||||
<xsl:value-of select="doc:return/doc:type/@occurrence/string()" />
|
||||
</code>
|
||||
</div>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:functions[doc:function]" mode="restxq">
|
||||
<div id="restxq">
|
||||
<h3>
|
||||
<a href="#restxq">RestXQ</a>
|
||||
</h3>
|
||||
<xsl:for-each-group select="qd:restxq($funs)"
|
||||
group-by="doc:literal/string()">
|
||||
<xsl:sort select="current-grouping-key()" />
|
||||
<xsl:variable name="id" select="current-grouping-key()" />
|
||||
<div id="{$id}">
|
||||
<h4>
|
||||
<a href="#{ $id }">
|
||||
<xsl:value-of select="$id" />
|
||||
</a>
|
||||
</h4>
|
||||
<ul>
|
||||
<xsl:for-each select="current-group()/../..">
|
||||
<li>
|
||||
<a href="#{ doc:name }">
|
||||
<xsl:value-of select="doc:name" />
|
||||
</a>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</xsl:for-each-group>
|
||||
<!-- <xsl:apply-templates select="doc:function" /> -->
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:parameters">
|
||||
<dt class="label">Parameters</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<xsl:apply-templates select="doc:parameter" />
|
||||
</ul>
|
||||
</dd>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:parameter">
|
||||
<li>
|
||||
<xsl:value-of select="doc:name" />
|
||||
<code class="as"> as </code>
|
||||
<code class="return-type">
|
||||
<xsl:value-of select="doc:type" />
|
||||
<xsl:value-of select="doc:type/@occurrence" />
|
||||
</code>
|
||||
<xsl:variable name="name" select="string(doc:name)" />
|
||||
<xsl:for-each
|
||||
select="../../doc:comment/doc:param[starts-with(normalize-space(.), $name) or starts-with(normalize-space(.), concat('$',$name))]">
|
||||
<xsl:value-of select="substring-after(normalize-space(.), $name)" />
|
||||
</xsl:for-each>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:return">
|
||||
<dt class="label">Return</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>
|
||||
<code class="return-type">
|
||||
<xsl:value-of select="doc:type" />
|
||||
<xsl:value-of select="doc:type/@occurrence" />
|
||||
</code>
|
||||
<xsl:for-each select="../doc:comment/doc:return">
|
||||
<xsl:text>: </xsl:text>
|
||||
<xsl:copy-of select="node()|text()" />
|
||||
</xsl:for-each>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<xsl:template match="doc:error">
|
||||
<dt class="label">Error</dt>
|
||||
<dd>
|
||||
<xsl:copy-of select="node()|text()" />
|
||||
</dd>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:annotations">
|
||||
<details>
|
||||
<summary>Annotations</summary>
|
||||
<table class="data">
|
||||
<tbody>
|
||||
<xsl:for-each select="doc:annotation">
|
||||
<tr>
|
||||
<td>
|
||||
<code class="function">
|
||||
<xsl:text>%</xsl:text>
|
||||
<xsl:value-of select="@name" />
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<code class="arg">
|
||||
<xsl:value-of select="doc:literal" />
|
||||
</code>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:comment">
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:description">
|
||||
<dt class="label">Summary</dt>
|
||||
<dd>
|
||||
<xsl:copy-of select="node()|text()" />
|
||||
</dd>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:author">
|
||||
<p>
|
||||
Author:
|
||||
<xsl:value-of select="." />
|
||||
</p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:version">
|
||||
<p>
|
||||
Version:
|
||||
<xsl:value-of select="." />
|
||||
</p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:custom">
|
||||
<p>
|
||||
<xsl:value-of select="@tag" />
|
||||
:
|
||||
<xsl:value-of select="." />
|
||||
</p>
|
||||
</xsl:template>
|
||||
<xsl:template match="doc:see">
|
||||
See also:
|
||||
<xsl:for-each select="tokenize(.,'[ \t\r\n,]+')[. ne '']">
|
||||
<xsl:if test="position() ne 1">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(.,'#')">
|
||||
<a
|
||||
href="#{ concat('func_', replace(substring-before(.,'#'), ':', '_'),
|
||||
'_', substring-after(.,'#')) }">
|
||||
<xsl:value-of select="." />
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with(.,'$')">
|
||||
<a href="#{ concat('var_', replace(substring-after(.,'$'), ':', '_')) }">
|
||||
<xsl:value-of select="." />
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="." />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="doc:control" />
|
||||
|
||||
<xsl:template match="text()" mode="custom #default">
|
||||
<xsl:value-of select="normalize-space(.)" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="toc">
|
||||
<nav id="toc">
|
||||
<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>
|
||||
</h3>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#main">
|
||||
<span class="secno">1 </span>
|
||||
<span class="content">Introduction</span>
|
||||
</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">3 </span>
|
||||
<span class="content">Variables</span>
|
||||
</a>
|
||||
<ol class="toc">
|
||||
<xsl:for-each select="$vars">
|
||||
<xsl:sort select="doc:name" />
|
||||
<xsl:variable name="id" select="concat('$',doc:name)" />
|
||||
<li>
|
||||
<a href="#{$id}">
|
||||
<span class="secno">
|
||||
<xsl:value-of select="concat('2.',position())" />
|
||||
</span>
|
||||
<span class="content">
|
||||
<xsl:value-of select="$id" />
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#functions">
|
||||
<span class="secno">4 </span>
|
||||
<span class="content">Functions</span>
|
||||
</a>
|
||||
<ol class="toc">
|
||||
<xsl:for-each-group select="$funs" group-by="doc:name">
|
||||
<xsl:sort select="lower-case(doc:name)" />
|
||||
<xsl:variable name="id" select="current-grouping-key()" />
|
||||
<li>
|
||||
<a href="#{$id}">
|
||||
<span class="secno">
|
||||
<xsl:value-of select="concat('3.',position())" />
|
||||
</span>
|
||||
<span class="content"
|
||||
title="{string((current-group()//doc:description)[1])}">
|
||||
<xsl:value-of select="$id" />
|
||||
<xsl:if test="qd:restxq(current-group())">
|
||||
<div class="tag tag-success" style="float:right"
|
||||
title="RESTXQ: { qd:restxq(current-group())/doc:literal/string() }">R
|
||||
</div>
|
||||
</xsl:if>
|
||||
<xsl:if test="qd:is-updating(current-group())">
|
||||
<div class="tag tag-danger" title="Updating" style="float:right">U
|
||||
</div>
|
||||
</xsl:if>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</xsl:for-each-group>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="#namespaces">
|
||||
<span class="secno">5 </span>
|
||||
<span class="content">Namespaces</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#restxq">
|
||||
<span class="secno">6 </span>
|
||||
<span class="content">Restxq</span>
|
||||
</a>
|
||||
<ol class="toc">
|
||||
<xsl:for-each-group select="qd:restxq($funs)"
|
||||
group-by="doc:literal/string()">
|
||||
<xsl:sort select="current-grouping-key()" />
|
||||
<xsl:variable name="id" select="current-grouping-key()" />
|
||||
<li>
|
||||
<a href="#{ current-grouping-key() }">
|
||||
<span class="secno">
|
||||
<xsl:value-of select="concat('5.',position())" />
|
||||
</span>
|
||||
<span class="content">
|
||||
<xsl:value-of select="current-grouping-key()" />
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</xsl:for-each-group>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="#source">
|
||||
<span class="secno">7 </span>
|
||||
<span class="content">Source</span>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</xsl:template>
|
||||
|
||||
<!-- annotation analysis -->
|
||||
<xsl:function name="qd:restxq" as="element(doc:annotation)*">
|
||||
<xsl:param name="fun" as="element(doc:function)*" />
|
||||
<xsl:variable name="found"
|
||||
select="$fun/doc:annotations/doc:annotation[@name=(for $p in $restxq return concat($p,':path'))]" />
|
||||
<xsl:message>
|
||||
<xsl:copy-of select="$found" />
|
||||
</xsl:message>
|
||||
<xsl:sequence select="$found"></xsl:sequence>
|
||||
</xsl:function>
|
||||
|
||||
<xsl:function name="qd:is-updating" as="xs:boolean">
|
||||
<xsl:param name="fun" as="element(doc:function)*" />
|
||||
<xsl:variable name="found"
|
||||
select="$fun/doc:annotations/doc:annotation[@name='updating']" />
|
||||
<xsl:sequence select="not(empty($found))" />
|
||||
</xsl:function>
|
||||
|
||||
<!-- generate span with method name eg GET -->
|
||||
<xsl:template match="method" mode="name">
|
||||
<xsl:variable name="name" select="string(@name)" />
|
||||
<span>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>wadl-method label </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$name='GET'">
|
||||
<xsl:text>label-primary</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$name='POST'">
|
||||
<xsl:text>label-success</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$name='DELETE'">
|
||||
<xsl:text>label-danger</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>label-warning</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="if($name = '')then '(ALL)' else $name" />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="representation" mode="mediaType">
|
||||
<xsl:variable name="mediaType" select="@mediaType" />
|
||||
<span class="label label-default label-pill pull-xs-right" title="{$mediaType}">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mediaType='text/html'">
|
||||
<xsl:text>H</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$mediaType='application/octet-stream'">
|
||||
<xsl:text>B</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$mediaType='application/xml'">
|
||||
<xsl:text>X</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$mediaType='text/plain'">
|
||||
<xsl:text>T</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$mediaType='application/json'">
|
||||
<xsl:text>J</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$mediaType='image/svg+xml'">
|
||||
<xsl:text>S</xsl:text>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
?
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
declare variable $xp:=doc("C:\tmp\xqdoc\classify.xqm\xparse.xml")/*;
|
||||
|
||||
declare function local:imports($xp as element(XQuery)) as xs:string*
|
||||
{
|
||||
$xp/LibraryModule/Prolog/ModuleImport
|
||||
};
|
||||
declare function local:variables($xp as element(XQuery)){
|
||||
$xp/LibraryModule/Prolog/AnnotatedDecl/VarDecl
|
||||
};
|
||||
declare function local:functions($xp as element(XQuery)){
|
||||
$xp/LibraryModule/Prolog/AnnotatedDecl/FunctionDecl
|
||||
};
|
||||
local:functions( $xp)/string()
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
|
@ -1,82 +0,0 @@
|
|||
body {
|
||||
font-family: Helvetica;
|
||||
padding: 0.5em 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: Inconsolata, Consolas, monospace;
|
||||
}
|
||||
|
||||
ol.results {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: right;
|
||||
border-top: solid 4px;
|
||||
padding: 0.25em 0.5em;
|
||||
font-size: 85%;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
li.result {
|
||||
list-style-position: inside;
|
||||
list-style: none;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h2 a, .result h3 a {
|
||||
text-decoration: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 140%;
|
||||
background-color: #aaa;
|
||||
border-bottom: 1px solid #000;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 100%;
|
||||
background-color: #ddd;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace:before {
|
||||
content: "{";
|
||||
}
|
||||
|
||||
.namespace:after {
|
||||
content: "}";
|
||||
}
|
||||
.tag-success {
|
||||
background-color: #5cb85c;
|
||||
}
|
||||
.tag-danger {
|
||||
background-color: #d9534f;
|
||||
}
|
||||
.tag {
|
||||
display: inline;
|
||||
padding: .2em .6em .3em;
|
||||
font-size: 75%;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25em;
|
||||
}
|
||||
td {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+xquery */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection, code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre) > code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre) > code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #9a6e3a;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
|
|
@ -1,938 +0,0 @@
|
|||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+xquery */
|
||||
var _self = (typeof window !== 'undefined')
|
||||
? window // if in browser
|
||||
: (
|
||||
(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
|
||||
? self // if in worker
|
||||
: {} // if in node js
|
||||
);
|
||||
|
||||
/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
* MIT license http://www.opensource.org/licenses/mit-license.php/
|
||||
* @author Lea Verou http://lea.verou.me
|
||||
*/
|
||||
|
||||
var Prism = (function(){
|
||||
|
||||
// Private helper vars
|
||||
var lang = /\blang(?:uage)?-([\w-]+)\b/i;
|
||||
var uniqueId = 0;
|
||||
|
||||
var _ = _self.Prism = {
|
||||
manual: _self.Prism && _self.Prism.manual,
|
||||
disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
|
||||
util: {
|
||||
encode: function (tokens) {
|
||||
if (tokens instanceof Token) {
|
||||
return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
|
||||
} else if (_.util.type(tokens) === 'Array') {
|
||||
return tokens.map(_.util.encode);
|
||||
} else {
|
||||
return tokens.replace(/&/g, '&').replace(/</g, '<').replace(/\u00a0/g, ' ');
|
||||
}
|
||||
},
|
||||
|
||||
type: function (o) {
|
||||
return Object.prototype.toString.call(o).match(/\[object (\w+)\]/)[1];
|
||||
},
|
||||
|
||||
objId: function (obj) {
|
||||
if (!obj['__id']) {
|
||||
Object.defineProperty(obj, '__id', { value: ++uniqueId });
|
||||
}
|
||||
return obj['__id'];
|
||||
},
|
||||
|
||||
// Deep clone a language definition (e.g. to extend it)
|
||||
clone: function (o, visited) {
|
||||
var type = _.util.type(o);
|
||||
visited = visited || {};
|
||||
|
||||
switch (type) {
|
||||
case 'Object':
|
||||
if (visited[_.util.objId(o)]) {
|
||||
return visited[_.util.objId(o)];
|
||||
}
|
||||
var clone = {};
|
||||
visited[_.util.objId(o)] = clone;
|
||||
|
||||
for (var key in o) {
|
||||
if (o.hasOwnProperty(key)) {
|
||||
clone[key] = _.util.clone(o[key], visited);
|
||||
}
|
||||
}
|
||||
|
||||
return clone;
|
||||
|
||||
case 'Array':
|
||||
if (visited[_.util.objId(o)]) {
|
||||
return visited[_.util.objId(o)];
|
||||
}
|
||||
var clone = [];
|
||||
visited[_.util.objId(o)] = clone;
|
||||
|
||||
o.forEach(function (v, i) {
|
||||
clone[i] = _.util.clone(v, visited);
|
||||
});
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
},
|
||||
|
||||
languages: {
|
||||
extend: function (id, redef) {
|
||||
var lang = _.util.clone(_.languages[id]);
|
||||
|
||||
for (var key in redef) {
|
||||
lang[key] = redef[key];
|
||||
}
|
||||
|
||||
return lang;
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert a token before another token in a language literal
|
||||
* As this needs to recreate the object (we cannot actually insert before keys in object literals),
|
||||
* we cannot just provide an object, we need anobject and a key.
|
||||
* @param inside The key (or language id) of the parent
|
||||
* @param before The key to insert before. If not provided, the function appends instead.
|
||||
* @param insert Object with the key/value pairs to insert
|
||||
* @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.
|
||||
*/
|
||||
insertBefore: function (inside, before, insert, root) {
|
||||
root = root || _.languages;
|
||||
var grammar = root[inside];
|
||||
|
||||
if (arguments.length == 2) {
|
||||
insert = arguments[1];
|
||||
|
||||
for (var newToken in insert) {
|
||||
if (insert.hasOwnProperty(newToken)) {
|
||||
grammar[newToken] = insert[newToken];
|
||||
}
|
||||
}
|
||||
|
||||
return grammar;
|
||||
}
|
||||
|
||||
var ret = {};
|
||||
|
||||
for (var token in grammar) {
|
||||
|
||||
if (grammar.hasOwnProperty(token)) {
|
||||
|
||||
if (token == before) {
|
||||
|
||||
for (var newToken in insert) {
|
||||
|
||||
if (insert.hasOwnProperty(newToken)) {
|
||||
ret[newToken] = insert[newToken];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ret[token] = grammar[token];
|
||||
}
|
||||
}
|
||||
|
||||
var old = root[inside];
|
||||
root[inside] = ret;
|
||||
|
||||
// Update references in other language definitions
|
||||
_.languages.DFS(_.languages, function(key, value) {
|
||||
if (value === old && key != inside) {
|
||||
this[key] = ret;
|
||||
}
|
||||
});
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
// Traverse a language definition with Depth First Search
|
||||
DFS: function(o, callback, type, visited) {
|
||||
visited = visited || {};
|
||||
for (var i in o) {
|
||||
if (o.hasOwnProperty(i)) {
|
||||
callback.call(o, i, o[i], type || i);
|
||||
|
||||
if (_.util.type(o[i]) === 'Object' && !visited[_.util.objId(o[i])]) {
|
||||
visited[_.util.objId(o[i])] = true;
|
||||
_.languages.DFS(o[i], callback, null, visited);
|
||||
}
|
||||
else if (_.util.type(o[i]) === 'Array' && !visited[_.util.objId(o[i])]) {
|
||||
visited[_.util.objId(o[i])] = true;
|
||||
_.languages.DFS(o[i], callback, i, visited);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: {},
|
||||
|
||||
highlightAll: function(async, callback) {
|
||||
_.highlightAllUnder(document, async, callback);
|
||||
},
|
||||
|
||||
highlightAllUnder: function(container, async, callback) {
|
||||
var env = {
|
||||
callback: callback,
|
||||
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
||||
};
|
||||
|
||||
_.hooks.run("before-highlightall", env);
|
||||
|
||||
var elements = env.elements || container.querySelectorAll(env.selector);
|
||||
|
||||
for (var i=0, element; element = elements[i++];) {
|
||||
_.highlightElement(element, async === true, env.callback);
|
||||
}
|
||||
},
|
||||
|
||||
highlightElement: function(element, async, callback) {
|
||||
// Find language
|
||||
var language, grammar, parent = element;
|
||||
|
||||
while (parent && !lang.test(parent.className)) {
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
|
||||
if (parent) {
|
||||
language = (parent.className.match(lang) || [,''])[1].toLowerCase();
|
||||
grammar = _.languages[language];
|
||||
}
|
||||
|
||||
// Set language on the element, if not present
|
||||
element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
|
||||
|
||||
if (element.parentNode) {
|
||||
// Set language on the parent, for styling
|
||||
parent = element.parentNode;
|
||||
|
||||
if (/pre/i.test(parent.nodeName)) {
|
||||
parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
|
||||
}
|
||||
}
|
||||
|
||||
var code = element.textContent;
|
||||
|
||||
var env = {
|
||||
element: element,
|
||||
language: language,
|
||||
grammar: grammar,
|
||||
code: code
|
||||
};
|
||||
|
||||
_.hooks.run('before-sanity-check', env);
|
||||
|
||||
if (!env.code || !env.grammar) {
|
||||
if (env.code) {
|
||||
_.hooks.run('before-highlight', env);
|
||||
env.element.textContent = env.code;
|
||||
_.hooks.run('after-highlight', env);
|
||||
}
|
||||
_.hooks.run('complete', env);
|
||||
return;
|
||||
}
|
||||
|
||||
_.hooks.run('before-highlight', env);
|
||||
|
||||
if (async && _self.Worker) {
|
||||
var worker = new Worker(_.filename);
|
||||
|
||||
worker.onmessage = function(evt) {
|
||||
env.highlightedCode = evt.data;
|
||||
|
||||
_.hooks.run('before-insert', env);
|
||||
|
||||
env.element.innerHTML = env.highlightedCode;
|
||||
|
||||
callback && callback.call(env.element);
|
||||
_.hooks.run('after-highlight', env);
|
||||
_.hooks.run('complete', env);
|
||||
};
|
||||
|
||||
worker.postMessage(JSON.stringify({
|
||||
language: env.language,
|
||||
code: env.code,
|
||||
immediateClose: true
|
||||
}));
|
||||
}
|
||||
else {
|
||||
env.highlightedCode = _.highlight(env.code, env.grammar, env.language);
|
||||
|
||||
_.hooks.run('before-insert', env);
|
||||
|
||||
env.element.innerHTML = env.highlightedCode;
|
||||
|
||||
callback && callback.call(element);
|
||||
|
||||
_.hooks.run('after-highlight', env);
|
||||
_.hooks.run('complete', env);
|
||||
}
|
||||
},
|
||||
|
||||
highlight: function (text, grammar, language) {
|
||||
var env = {
|
||||
code: text,
|
||||
grammar: grammar,
|
||||
language: language
|
||||
};
|
||||
_.hooks.run('before-tokenize', env);
|
||||
env.tokens = _.tokenize(env.code, env.grammar);
|
||||
_.hooks.run('after-tokenize', env);
|
||||
return Token.stringify(_.util.encode(env.tokens), env.language);
|
||||
},
|
||||
|
||||
matchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) {
|
||||
var Token = _.Token;
|
||||
|
||||
for (var token in grammar) {
|
||||
if(!grammar.hasOwnProperty(token) || !grammar[token]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (token == target) {
|
||||
return;
|
||||
}
|
||||
|
||||
var patterns = grammar[token];
|
||||
patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns];
|
||||
|
||||
for (var j = 0; j < patterns.length; ++j) {
|
||||
var pattern = patterns[j],
|
||||
inside = pattern.inside,
|
||||
lookbehind = !!pattern.lookbehind,
|
||||
greedy = !!pattern.greedy,
|
||||
lookbehindLength = 0,
|
||||
alias = pattern.alias;
|
||||
|
||||
if (greedy && !pattern.pattern.global) {
|
||||
// Without the global flag, lastIndex won't work
|
||||
var flags = pattern.pattern.toString().match(/[imuy]*$/)[0];
|
||||
pattern.pattern = RegExp(pattern.pattern.source, flags + "g");
|
||||
}
|
||||
|
||||
pattern = pattern.pattern || pattern;
|
||||
|
||||
// Don’t cache length as it changes during the loop
|
||||
for (var i = index, pos = startPos; i < strarr.length; pos += strarr[i].length, ++i) {
|
||||
|
||||
var str = strarr[i];
|
||||
|
||||
if (strarr.length > text.length) {
|
||||
// Something went terribly wrong, ABORT, ABORT!
|
||||
return;
|
||||
}
|
||||
|
||||
if (str instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (greedy && i != strarr.length - 1) {
|
||||
pattern.lastIndex = pos;
|
||||
var match = pattern.exec(text);
|
||||
if (!match) {
|
||||
break;
|
||||
}
|
||||
|
||||
var from = match.index + (lookbehind ? match[1].length : 0),
|
||||
to = match.index + match[0].length,
|
||||
k = i,
|
||||
p = pos;
|
||||
|
||||
for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) {
|
||||
p += strarr[k].length;
|
||||
// Move the index i to the element in strarr that is closest to from
|
||||
if (from >= p) {
|
||||
++i;
|
||||
pos = p;
|
||||
}
|
||||
}
|
||||
|
||||
// If strarr[i] is a Token, then the match starts inside another Token, which is invalid
|
||||
if (strarr[i] instanceof Token) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Number of tokens to delete and replace with the new match
|
||||
delNum = k - i;
|
||||
str = text.slice(pos, p);
|
||||
match.index -= pos;
|
||||
} else {
|
||||
pattern.lastIndex = 0;
|
||||
|
||||
var match = pattern.exec(str),
|
||||
delNum = 1;
|
||||
}
|
||||
|
||||
if (!match) {
|
||||
if (oneshot) {
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lookbehind) {
|
||||
lookbehindLength = match[1] ? match[1].length : 0;
|
||||
}
|
||||
|
||||
var from = match.index + lookbehindLength,
|
||||
match = match[0].slice(lookbehindLength),
|
||||
to = from + match.length,
|
||||
before = str.slice(0, from),
|
||||
after = str.slice(to);
|
||||
|
||||
var args = [i, delNum];
|
||||
|
||||
if (before) {
|
||||
++i;
|
||||
pos += before.length;
|
||||
args.push(before);
|
||||
}
|
||||
|
||||
var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);
|
||||
|
||||
args.push(wrapped);
|
||||
|
||||
if (after) {
|
||||
args.push(after);
|
||||
}
|
||||
|
||||
Array.prototype.splice.apply(strarr, args);
|
||||
|
||||
if (delNum != 1)
|
||||
_.matchGrammar(text, strarr, grammar, i, pos, true, token);
|
||||
|
||||
if (oneshot)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
tokenize: function(text, grammar, language) {
|
||||
var strarr = [text];
|
||||
|
||||
var rest = grammar.rest;
|
||||
|
||||
if (rest) {
|
||||
for (var token in rest) {
|
||||
grammar[token] = rest[token];
|
||||
}
|
||||
|
||||
delete grammar.rest;
|
||||
}
|
||||
|
||||
_.matchGrammar(text, strarr, grammar, 0, 0, false);
|
||||
|
||||
return strarr;
|
||||
},
|
||||
|
||||
hooks: {
|
||||
all: {},
|
||||
|
||||
add: function (name, callback) {
|
||||
var hooks = _.hooks.all;
|
||||
|
||||
hooks[name] = hooks[name] || [];
|
||||
|
||||
hooks[name].push(callback);
|
||||
},
|
||||
|
||||
run: function (name, env) {
|
||||
var callbacks = _.hooks.all[name];
|
||||
|
||||
if (!callbacks || !callbacks.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i=0, callback; callback = callbacks[i++];) {
|
||||
callback(env);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var Token = _.Token = function(type, content, alias, matchedStr, greedy) {
|
||||
this.type = type;
|
||||
this.content = content;
|
||||
this.alias = alias;
|
||||
// Copy of the full string this token was created from
|
||||
this.length = (matchedStr || "").length|0;
|
||||
this.greedy = !!greedy;
|
||||
};
|
||||
|
||||
Token.stringify = function(o, language, parent) {
|
||||
if (typeof o == 'string') {
|
||||
return o;
|
||||
}
|
||||
|
||||
if (_.util.type(o) === 'Array') {
|
||||
return o.map(function(element) {
|
||||
return Token.stringify(element, language, o);
|
||||
}).join('');
|
||||
}
|
||||
|
||||
var env = {
|
||||
type: o.type,
|
||||
content: Token.stringify(o.content, language, parent),
|
||||
tag: 'span',
|
||||
classes: ['token', o.type],
|
||||
attributes: {},
|
||||
language: language,
|
||||
parent: parent
|
||||
};
|
||||
|
||||
if (o.alias) {
|
||||
var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias];
|
||||
Array.prototype.push.apply(env.classes, aliases);
|
||||
}
|
||||
|
||||
_.hooks.run('wrap', env);
|
||||
|
||||
var attributes = Object.keys(env.attributes).map(function(name) {
|
||||
return name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"';
|
||||
}).join(' ');
|
||||
|
||||
return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '</' + env.tag + '>';
|
||||
|
||||
};
|
||||
|
||||
if (!_self.document) {
|
||||
if (!_self.addEventListener) {
|
||||
// in Node.js
|
||||
return _self.Prism;
|
||||
}
|
||||
|
||||
if (!_.disableWorkerMessageHandler) {
|
||||
// In worker
|
||||
_self.addEventListener('message', function (evt) {
|
||||
var message = JSON.parse(evt.data),
|
||||
lang = message.language,
|
||||
code = message.code,
|
||||
immediateClose = message.immediateClose;
|
||||
|
||||
_self.postMessage(_.highlight(code, _.languages[lang], lang));
|
||||
if (immediateClose) {
|
||||
_self.close();
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
return _self.Prism;
|
||||
}
|
||||
|
||||
//Get current script and highlight
|
||||
var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();
|
||||
|
||||
if (script) {
|
||||
_.filename = script.src;
|
||||
|
||||
if (!_.manual && !script.hasAttribute('data-manual')) {
|
||||
if(document.readyState !== "loading") {
|
||||
if (window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame(_.highlightAll);
|
||||
} else {
|
||||
window.setTimeout(_.highlightAll, 16);
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.addEventListener('DOMContentLoaded', _.highlightAll);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _self.Prism;
|
||||
|
||||
})();
|
||||
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = Prism;
|
||||
}
|
||||
|
||||
// hack for components to work correctly in node.js
|
||||
if (typeof global !== 'undefined') {
|
||||
global.Prism = Prism;
|
||||
}
|
||||
;
|
||||
Prism.languages.markup = {
|
||||
'comment': /<!--[\s\S]*?-->/,
|
||||
'prolog': /<\?[\s\S]+?\?>/,
|
||||
'doctype': /<!DOCTYPE[\s\S]+?>/i,
|
||||
'cdata': /<!\[CDATA\[[\s\S]*?]]>/i,
|
||||
'tag': {
|
||||
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,
|
||||
greedy: true,
|
||||
inside: {
|
||||
'tag': {
|
||||
pattern: /^<\/?[^\s>\/]+/i,
|
||||
inside: {
|
||||
'punctuation': /^<\/?/,
|
||||
'namespace': /^[^\s>\/:]+:/
|
||||
}
|
||||
},
|
||||
'attr-value': {
|
||||
pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,
|
||||
inside: {
|
||||
'punctuation': [
|
||||
/^=/,
|
||||
{
|
||||
pattern: /(^|[^\\])["']/,
|
||||
lookbehind: true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
'punctuation': /\/?>/,
|
||||
'attr-name': {
|
||||
pattern: /[^\s>\/]+/,
|
||||
inside: {
|
||||
'namespace': /^[^\s>\/:]+:/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
'entity': /&#?[\da-z]{1,8};/i
|
||||
};
|
||||
|
||||
Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
|
||||
Prism.languages.markup['entity'];
|
||||
|
||||
// Plugin to make entity title show the real entity, idea by Roman Komarov
|
||||
Prism.hooks.add('wrap', function(env) {
|
||||
|
||||
if (env.type === 'entity') {
|
||||
env.attributes['title'] = env.content.replace(/&/, '&');
|
||||
}
|
||||
});
|
||||
|
||||
Prism.languages.xml = Prism.languages.markup;
|
||||
Prism.languages.html = Prism.languages.markup;
|
||||
Prism.languages.mathml = Prism.languages.markup;
|
||||
Prism.languages.svg = Prism.languages.markup;
|
||||
|
||||
Prism.languages.css = {
|
||||
'comment': /\/\*[\s\S]*?\*\//,
|
||||
'atrule': {
|
||||
pattern: /@[\w-]+?.*?(?:;|(?=\s*\{))/i,
|
||||
inside: {
|
||||
'rule': /@[\w-]+/
|
||||
// See rest below
|
||||
}
|
||||
},
|
||||
'url': /url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
|
||||
'selector': /[^{}\s][^{};]*?(?=\s*\{)/,
|
||||
'string': {
|
||||
pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
||||
greedy: true
|
||||
},
|
||||
'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
|
||||
'important': /\B!important\b/i,
|
||||
'function': /[-a-z0-9]+(?=\()/i,
|
||||
'punctuation': /[(){};:]/
|
||||
};
|
||||
|
||||
Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
|
||||
|
||||
if (Prism.languages.markup) {
|
||||
Prism.languages.insertBefore('markup', 'tag', {
|
||||
'style': {
|
||||
pattern: /(<style[\s\S]*?>)[\s\S]*?(?=<\/style>)/i,
|
||||
lookbehind: true,
|
||||
inside: Prism.languages.css,
|
||||
alias: 'language-css',
|
||||
greedy: true
|
||||
}
|
||||
});
|
||||
|
||||
Prism.languages.insertBefore('inside', 'attr-value', {
|
||||
'style-attr': {
|
||||
pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,
|
||||
inside: {
|
||||
'attr-name': {
|
||||
pattern: /^\s*style/i,
|
||||
inside: Prism.languages.markup.tag.inside
|
||||
},
|
||||
'punctuation': /^\s*=\s*['"]|['"]\s*$/,
|
||||
'attr-value': {
|
||||
pattern: /.+/i,
|
||||
inside: Prism.languages.css
|
||||
}
|
||||
},
|
||||
alias: 'language-css'
|
||||
}
|
||||
}, Prism.languages.markup.tag);
|
||||
};
|
||||
Prism.languages.clike = {
|
||||
'comment': [
|
||||
{
|
||||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^\\:])\/\/.*/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
'string': {
|
||||
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
||||
greedy: true
|
||||
},
|
||||
'class-name': {
|
||||
pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /[.\\]/
|
||||
}
|
||||
},
|
||||
'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
|
||||
'boolean': /\b(?:true|false)\b/,
|
||||
'function': /\w+(?=\()/,
|
||||
'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,
|
||||
'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
|
||||
'punctuation': /[{}[\];(),.:]/
|
||||
};
|
||||
|
||||
Prism.languages.javascript = Prism.languages.extend('clike', {
|
||||
'class-name': [
|
||||
Prism.languages.clike['class-name'],
|
||||
{
|
||||
pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
'keyword': [
|
||||
{
|
||||
pattern: /((?:^|})\s*)(?:catch|finally)\b/,
|
||||
lookbehind: true
|
||||
},
|
||||
/\b(?:as|async|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/
|
||||
],
|
||||
'number': /\b(?:(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+)n?|\d+n|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,
|
||||
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
||||
'function': /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\(|\.(?:apply|bind|call)\()/,
|
||||
'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/
|
||||
});
|
||||
|
||||
Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/
|
||||
|
||||
Prism.languages.insertBefore('javascript', 'keyword', {
|
||||
'regex': {
|
||||
pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
// This must be declared before keyword because we use "function" inside the look-forward
|
||||
'function-variable': {
|
||||
pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,
|
||||
alias: 'function'
|
||||
},
|
||||
'constant': /\b[A-Z][A-Z\d_]*\b/
|
||||
});
|
||||
|
||||
Prism.languages.insertBefore('javascript', 'string', {
|
||||
'template-string': {
|
||||
pattern: /`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,
|
||||
greedy: true,
|
||||
inside: {
|
||||
'interpolation': {
|
||||
pattern: /\${[^}]+}/,
|
||||
inside: {
|
||||
'interpolation-punctuation': {
|
||||
pattern: /^\${|}$/,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
rest: Prism.languages.javascript
|
||||
}
|
||||
},
|
||||
'string': /[\s\S]+/
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (Prism.languages.markup) {
|
||||
Prism.languages.insertBefore('markup', 'tag', {
|
||||
'script': {
|
||||
pattern: /(<script[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,
|
||||
lookbehind: true,
|
||||
inside: Prism.languages.javascript,
|
||||
alias: 'language-javascript',
|
||||
greedy: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Prism.languages.js = Prism.languages.javascript;
|
||||
|
||||
(function (Prism) {
|
||||
|
||||
Prism.languages.xquery = Prism.languages.extend('markup', {
|
||||
'xquery-comment': {
|
||||
pattern: /\(:[\s\S]*?:\)/,
|
||||
greedy: true,
|
||||
alias: "comment"
|
||||
},
|
||||
'string': {
|
||||
pattern: /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
|
||||
greedy: true
|
||||
},
|
||||
'extension': {
|
||||
pattern: /\(#.+?#\)/,
|
||||
alias: 'symbol'
|
||||
},
|
||||
'variable': /\$[\w-:]+/,
|
||||
'axis': {
|
||||
pattern: /(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,
|
||||
lookbehind: true,
|
||||
alias: 'operator'
|
||||
},
|
||||
'keyword-operator': {
|
||||
pattern: /(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,
|
||||
lookbehind: true,
|
||||
alias: 'operator'
|
||||
},
|
||||
'keyword': {
|
||||
pattern: /(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,
|
||||
lookbehind: true
|
||||
},
|
||||
'function': /[\w-]+(?::[\w-]+)*(?=\s*\()/,
|
||||
'xquery-element': {
|
||||
pattern: /(element\s+)[\w-]+(?::[\w-]+)*/,
|
||||
lookbehind: true,
|
||||
alias: 'tag'
|
||||
},
|
||||
'xquery-attribute': {
|
||||
pattern: /(attribute\s+)[\w-]+(?::[\w-]+)*/,
|
||||
lookbehind: true,
|
||||
alias: 'attr-name'
|
||||
},
|
||||
'builtin': {
|
||||
pattern: /(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|ENTITIES|ENTITY|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|ID|IDREFS?|int|integer|language|long|Name|NCName|negativeInteger|NMTOKENS?|nonNegativeInteger|nonPositiveInteger|normalizedString|NOTATION|positiveInteger|QName|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,
|
||||
lookbehind: true
|
||||
},
|
||||
'number': /\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,
|
||||
'operator': [
|
||||
/[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,
|
||||
{
|
||||
pattern: /(\s)-(?=\s)/,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
'punctuation': /[[\](){},;:/]/
|
||||
});
|
||||
|
||||
Prism.languages.xquery.tag.pattern = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i;
|
||||
Prism.languages.xquery['tag'].inside['attr-value'].pattern = /=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}|(?!\1)[^\\])*\1|[^\s'">=]+)/i;
|
||||
Prism.languages.xquery['tag'].inside['attr-value'].inside['punctuation'] = /^="|"$/;
|
||||
Prism.languages.xquery['tag'].inside['attr-value'].inside['expression'] = {
|
||||
// Allow for two levels of nesting
|
||||
pattern: /{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}/,
|
||||
inside: {
|
||||
rest: Prism.languages.xquery
|
||||
},
|
||||
'alias': 'language-xquery'
|
||||
};
|
||||
|
||||
// The following will handle plain text inside tags
|
||||
var stringifyToken = function (token) {
|
||||
if (typeof token === 'string') {
|
||||
return token;
|
||||
}
|
||||
if (typeof token.content === 'string') {
|
||||
return token.content;
|
||||
}
|
||||
return token.content.map(stringifyToken).join('');
|
||||
};
|
||||
|
||||
var walkTokens = function (tokens) {
|
||||
var openedTags = [];
|
||||
for (var i = 0; i < tokens.length; i++) {
|
||||
var token = tokens[i];
|
||||
var notTagNorBrace = false;
|
||||
|
||||
if (typeof token !== 'string') {
|
||||
if (token.type === 'tag' && token.content[0] && token.content[0].type === 'tag') {
|
||||
// We found a tag, now find its kind
|
||||
|
||||
if (token.content[0].content[0].content === '</') {
|
||||
// Closing tag
|
||||
if (openedTags.length > 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) {
|
||||
// Pop matching opening tag
|
||||
openedTags.pop();
|
||||
}
|
||||
} else {
|
||||
if (token.content[token.content.length - 1].content === '/>') {
|
||||
// Autoclosed tag, ignore
|
||||
} else {
|
||||
// Opening tag
|
||||
openedTags.push({
|
||||
tagName: stringifyToken(token.content[0].content[1]),
|
||||
openedBraces: 0
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
openedTags.length > 0 && token.type === 'punctuation' && token.content === '{' &&
|
||||
// Ignore `{{`
|
||||
(!tokens[i + 1] || tokens[i + 1].type !== 'punctuation' || tokens[i + 1].content !== '{') &&
|
||||
(!tokens[i - 1] || tokens[i - 1].type !== 'plain-text' || tokens[i - 1].content !== '{')
|
||||
) {
|
||||
// Here we might have entered an XQuery expression inside a tag
|
||||
openedTags[openedTags.length - 1].openedBraces++;
|
||||
|
||||
} else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === 'punctuation' && token.content === '}') {
|
||||
|
||||
// Here we might have left an XQuery expression inside a tag
|
||||
openedTags[openedTags.length - 1].openedBraces--;
|
||||
|
||||
} else if (token.type !== 'comment') {
|
||||
notTagNorBrace = true
|
||||
}
|
||||
}
|
||||
if (notTagNorBrace || typeof token === 'string') {
|
||||
if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) {
|
||||
// Here we are inside a tag, and not inside an XQuery expression.
|
||||
// That's plain text: drop any tokens matched.
|
||||
var plainText = stringifyToken(token);
|
||||
|
||||
// And merge text with adjacent text
|
||||
if (i < tokens.length - 1 && (typeof tokens[i + 1] === 'string' || tokens[i + 1].type === 'plain-text')) {
|
||||
plainText += stringifyToken(tokens[i + 1]);
|
||||
tokens.splice(i + 1, 1);
|
||||
}
|
||||
if (i > 0 && (typeof tokens[i - 1] === 'string' || tokens[i - 1].type === 'plain-text')) {
|
||||
plainText = stringifyToken(tokens[i - 1]) + plainText;
|
||||
tokens.splice(i - 1, 1);
|
||||
i--;
|
||||
}
|
||||
|
||||
if (/^\s+$/.test(plainText)) {
|
||||
tokens[i] = plainText;
|
||||
} else {
|
||||
tokens[i] = new Prism.Token('plain-text', plainText, null, plainText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (token.content && typeof token.content !== 'string') {
|
||||
walkTokens(token.content);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Prism.hooks.add('after-tokenize', function (env) {
|
||||
if (env.language !== 'xquery') {
|
||||
return;
|
||||
}
|
||||
walkTokens(env.tokens);
|
||||
});
|
||||
|
||||
}(Prism));
|
||||
|
|
@ -1,255 +0,0 @@
|
|||
/* from xsl:query.xsl (D) from
|
||||
https://www.w3.org/TR/xpath-functions-31*/
|
||||
div.exampleInner pre {
|
||||
margin-left: 1em;
|
||||
margin-top: 0em;
|
||||
margin-bottom: 0em
|
||||
}
|
||||
|
||||
pre.small {
|
||||
font-size: small
|
||||
}
|
||||
|
||||
div.exampleOuter {
|
||||
border: 4px double gray;
|
||||
margin: 0em;
|
||||
padding: 0em
|
||||
}
|
||||
|
||||
div.exampleInner {
|
||||
background-color: #d5dee3;
|
||||
padding: 4px;
|
||||
margin: 0em
|
||||
}
|
||||
|
||||
div.exampleInner table {
|
||||
border: 0;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
div.exampleInner td {
|
||||
vertical-align: baseline;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.exampleWrapper {
|
||||
margin: 4px
|
||||
}
|
||||
|
||||
div.exampleHeader {
|
||||
font-weight: bold;
|
||||
margin: 4px
|
||||
}
|
||||
|
||||
div.proto {
|
||||
border: 0;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
div.issue {
|
||||
border-bottom-color: black;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1pt;
|
||||
margin-bottom: 20pt;
|
||||
}
|
||||
|
||||
th.issue-toc-head {
|
||||
border-bottom-color: black;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1pt;
|
||||
}
|
||||
|
||||
div.schemaComp {
|
||||
border: 4px double gray;
|
||||
margin: 0em 1em;
|
||||
padding: 0em;
|
||||
}
|
||||
|
||||
div.compHeader {
|
||||
margin: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.schemaComp {
|
||||
background-color: white;
|
||||
color: #A52A2A;
|
||||
}
|
||||
|
||||
div.compBody {
|
||||
border-top-width: 4px;
|
||||
border-top-style: double;
|
||||
border-top-color: #d3d3d3;
|
||||
padding: 4px;
|
||||
margin: 0em;
|
||||
}
|
||||
|
||||
div.exampleInner {
|
||||
background-color: #d5dee3;
|
||||
color: black;
|
||||
border-top-width: 4px;
|
||||
border-top-style: double;
|
||||
border-top-color: #d3d3d3;
|
||||
border-bottom-width: 4px;
|
||||
border-bottom-style: double;
|
||||
border-bottom-color: #d3d3d3;
|
||||
padding: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
div.issueBody {
|
||||
margin-left: 0.25in;
|
||||
}
|
||||
|
||||
code.function {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
code.return-type {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
code.return-varies {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
code.type {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
code.as {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
code.arg {
|
||||
|
||||
}
|
||||
|
||||
code.strikeout {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
code.small {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
p.table.footnote {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
table.casting {
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
table.hierarchy {
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
table.proto {
|
||||
|
||||
}
|
||||
|
||||
td.castY {
|
||||
background-color: #7FFF7F;
|
||||
color: black;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
td.castN {
|
||||
background-color: #FF7F7F;
|
||||
color: black;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
td.castM {
|
||||
background-color: white;
|
||||
color: black;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
td.castOther {
|
||||
background-color: yellow;
|
||||
color: black;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
span.cancast:hover {
|
||||
background-color: #ffa;
|
||||
color: black;
|
||||
}
|
||||
|
||||
div.protoref {
|
||||
margin-left: 0.5in;
|
||||
text-indent: -0.5in;
|
||||
}
|
||||
|
||||
dd.indent {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
p.element-syntax {
|
||||
border: solid thin;
|
||||
background-color: #ffccff
|
||||
}
|
||||
|
||||
p.element-syntax-chg {
|
||||
border: solid thick yellow;
|
||||
background-color: #ffccff
|
||||
}
|
||||
|
||||
div.proto {
|
||||
padding: .5em;
|
||||
border: .5em;
|
||||
border-left-style: solid;
|
||||
page-break-inside: avoid;
|
||||
margin: 1em auto;
|
||||
border-color: #ff99ff;
|
||||
background: #ffe6ff;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
div.example-chg {
|
||||
border: solid thick yellow;
|
||||
background-color: #40e0d0;
|
||||
padding: 1em
|
||||
}
|
||||
|
||||
div.ffheader {
|
||||
margin-top: .8rem;
|
||||
font-size: 140%;
|
||||
font-variant: all-small-caps;
|
||||
text-transform: lowercase;
|
||||
font-weight: bold;
|
||||
color: hsla(203, 20%, 40%, .7);
|
||||
}
|
||||
|
||||
span.verb {
|
||||
font: small-caps 100% sans-serif
|
||||
}
|
||||
|
||||
span.error {
|
||||
font-size: small
|
||||
}
|
||||
|
||||
span.definition {
|
||||
font: small-caps 100% sans-serif
|
||||
}
|
||||
|
||||
span.grayed {
|
||||
color: gray
|
||||
}
|
||||
|
||||
table.scrap td {
|
||||
vertical-align: baseline;
|
||||
text-align: left;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
table.data
|
||||
table.index {
|
||||
border-bottom: 2px !important;
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
|
|
@ -1,354 +0,0 @@
|
|||
(:~
|
||||
: Generate XQuery documentation in html
|
||||
: using file:///C:/Users/andy/workspace/app-doc/src/doc/data/doc/models
|
||||
: $efolder:="file:///C:/Users/andy/workspace/app-doc/src/doc/data/doc/models"
|
||||
: $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";
|
||||
|
||||
(:~ transform files to html
|
||||
: @param $params keys: resources
|
||||
: "ext-id": "299",
|
||||
: "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>
|
||||
<th>Restxq</th>
|
||||
<th>Update</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{ for $file at $pos in $state?files
|
||||
|
||||
order by $file?namespace
|
||||
return <tr>
|
||||
<td>
|
||||
<a href="{ $file?href }index.html" title="{ $file?path }">
|
||||
{ $file?namespace }
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{ $file?xqparse/name() }
|
||||
</td>
|
||||
<td>
|
||||
{ "R" }
|
||||
</td>
|
||||
<td>
|
||||
{ "U" }
|
||||
</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(*)
|
||||
)
|
||||
as document-node()
|
||||
{
|
||||
let $d:=<div>
|
||||
<h1>
|
||||
<span class="tag tag-success">
|
||||
{ $params?project }
|
||||
</span>
|
||||
XQDoc ,id: { $params?ext-id }
|
||||
</h1>
|
||||
{ xqhtml:toc($params) }
|
||||
<a href="restxq.html">RestXQ</a>
|
||||
<div>src: { $params?src-folder }</div>
|
||||
<div id="file">
|
||||
<h1>Files</h1>
|
||||
<ul>
|
||||
{ for $file at $pos in $files//c:file
|
||||
let $ip:= $file/@name/resolve-uri(.,base-uri($file))
|
||||
let $path:= string-join($file/ancestor-or-self::*/@name,'/')
|
||||
return <li>
|
||||
<a href="modules/F{ $pos }/index.html">
|
||||
{ $file/@name/string() }
|
||||
</a>
|
||||
|
||||
{ $pos }
|
||||
{ $ip }
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="ns">
|
||||
<h1>Namespace</h1>
|
||||
<ul>
|
||||
<for-each select=".//c:file">
|
||||
<variable name="path" select="resolve-uri(@name,$src-folder)"/>
|
||||
<variable name="doc" select="doc($path)"/>
|
||||
<li>
|
||||
<value-of select="position()"/>
|
||||
<value-of select="$path"/>
|
||||
</li>
|
||||
</for-each>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
return document{ xqhtml:page($d, $params ) }
|
||||
};
|
||||
|
||||
(:~
|
||||
: build toc
|
||||
: params: map{"project":..}
|
||||
:)
|
||||
declare function xqhtml:toc($params)
|
||||
as element()
|
||||
{
|
||||
<nav id="toc">
|
||||
<h2>
|
||||
<a id="contents"></a>
|
||||
<span class="tag tag-success">
|
||||
{ $params?project }
|
||||
</span>
|
||||
</h2>
|
||||
<ol class="toc">
|
||||
<li>
|
||||
<a href="#main">
|
||||
<span class="secno">1 </span>
|
||||
<span class="content">Introduction</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#ns">
|
||||
<span class="secno">2 </span>
|
||||
<span class="content">Module uris</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#file">
|
||||
<span class="secno">3 </span>
|
||||
<span class="content">Files</span>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</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?href}index.html">{ $f?namespace }</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)
|
||||
{
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Generator" content="xqdoc-r - https://github.com/quodatum/xqdoc-r" />
|
||||
|
||||
<title>
|
||||
RestXQ - xqDoc
|
||||
</title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{$opts?resources}xqdoc.png" />
|
||||
<link rel="stylesheet" type="text/css" href="{$opts?resources}page.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{$opts?resources}query.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{$opts?resources}base.css" />
|
||||
|
||||
</head>
|
||||
|
||||
<body class="home" id="top">
|
||||
<div id="main">
|
||||
{$body}
|
||||
</div>
|
||||
<div class="footer">
|
||||
<p style="text-align:right">generated at {current-dateTime()}</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -1,334 +0,0 @@
|
|||
(:~
|
||||
: Generate XQuery documentation in html
|
||||
: using file:///C:/Users/andy/workspace/app-doc/src/doc/data/doc/models
|
||||
: $efolder:="file:///C:/Users/andy/workspace/app-doc/src/doc/data/doc/models"
|
||||
: $target:="file:///C:/Users/andy/workspace/app-doc/src/doc/generated/models.xqm"
|
||||
:)
|
||||
module namespace xqd = 'quodatum:build.xqdoc';
|
||||
import module namespace xp="expkg-zone58:text.parse";
|
||||
import module namespace store = 'quodatum.store' at '../store.xqm';
|
||||
import module namespace xqhtml = 'quodatum:build.xqdoc-html' at "xqdoc-html.xqm";
|
||||
declare namespace c="http://www.w3.org/ns/xproc-step";
|
||||
declare namespace xqdoc="http://www.xqdoc.org/1.0";
|
||||
|
||||
declare variable $xqd:HTML5:=map{"method": "html","version":"5.0"};
|
||||
declare variable $xqd:XML:=map{"indent": "no"};
|
||||
declare variable $xqd:mod-xslt external :="html-module.xsl";
|
||||
declare variable $xqd:index-xslt external :="html-index.xsl";
|
||||
declare variable $xqd:nsRESTXQ:= 'http://exquery.org/ns/restxq';
|
||||
declare variable $xqd:cache external :=false();
|
||||
|
||||
(:~ @see https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods :)
|
||||
declare variable $xqd:methods:=("GET","HEAD","POST","PUT","DELETE","PATCH");
|
||||
|
||||
(:~
|
||||
: save documentation for files to target
|
||||
: @param $files c:directory-list
|
||||
: @param $target where to save
|
||||
: @param $opts
|
||||
:)
|
||||
declare function xqd:save-xq($files,$target,$params as map(*))
|
||||
{
|
||||
let $f:= document{$files} transform with { delete node //c:directory[not(.//c:file)]}
|
||||
|
||||
return (
|
||||
$files//c:file!xqd:gendoc(.,"modules/F" || position(),$target,$params),
|
||||
$f=>xqd:store($target || "/files.xml",$xqd:XML),
|
||||
$f=>xqhtml:index-html($params)=>xqd:store($target || "/index.html",$xqd:HTML5),
|
||||
xqd:export-resources($target)
|
||||
)
|
||||
};
|
||||
|
||||
(:~
|
||||
: save xqdoc and html for source file $f
|
||||
: @param $f <c:file/>
|
||||
: @param $target destination folder
|
||||
: @param map
|
||||
: @param
|
||||
:)
|
||||
declare function xqd:gendoc(
|
||||
$f as element(c:file),
|
||||
$op as xs:string,
|
||||
$target as xs:string,
|
||||
$params as map(*)
|
||||
)
|
||||
{
|
||||
let $_:= if(file:is-dir($target)) then () else file:create-dir($target)
|
||||
let $target:= file:path-to-native($target)
|
||||
let $ip:= $f/@name/resolve-uri(.,base-uri(.))
|
||||
let $dest:= file:resolve-path($op,$target)
|
||||
|
||||
let $xqdoc:= xqd:xqdoc($ip,map{"source": $ip})
|
||||
let $xq:= fetch:text($ip)
|
||||
let $params:=map:merge((map{
|
||||
"source": $xq,
|
||||
"filename": $f/@name/string(),
|
||||
"cache": $xqd:cache,
|
||||
"show-private": true(),
|
||||
"resources": "resources/"},
|
||||
$params))
|
||||
return (
|
||||
$xq=>xqd:parse()=>xqd:store($dest || "/xparse.xml",$xqd:XML),
|
||||
$xqdoc=>xqd:store($dest || "/xqdoc.xml",$xqd:XML),
|
||||
$xqdoc=>xqd:xqdoc-html($params)=>xqd:store($dest || "/index.html",$xqd:HTML5)
|
||||
)
|
||||
};
|
||||
|
||||
(:~
|
||||
: 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,
|
||||
"project": tokenize($efolder,"[/\\]")[last()],
|
||||
"files": for $file at $pos in $files
|
||||
let $full:=concat($efolder || "\", $file)
|
||||
let $spath:=translate($file,"\","/")
|
||||
let $xqdoc:=xqd:xqdoc($full,map{"_source": $spath})
|
||||
return map{
|
||||
"path":$file,
|
||||
"href": ``[modules/F`{ $pos }`/]``,
|
||||
"namespace": $xqdoc/xqdoc:module/xqdoc:uri/string(),
|
||||
"xqdoc": $xqdoc,
|
||||
"xqparse": fetch:text($full)=>xqd:parse()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
(: return sequence of maps are imported ns values are where imported:)
|
||||
declare function xqd:imports($doc)
|
||||
as map(*)*
|
||||
{
|
||||
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}
|
||||
|
||||
};
|
||||
|
||||
(:~
|
||||
: save xqdoc and html for source file $f
|
||||
: @param $f <c:file/>
|
||||
: @param $target destination folder
|
||||
: @param map
|
||||
: @param
|
||||
:)
|
||||
declare function xqd:gendoc2(
|
||||
$f as element(c:file),
|
||||
$op as xs:string,
|
||||
$target as xs:string,
|
||||
$params as map(*)
|
||||
)
|
||||
as map(*)* {
|
||||
let $ip:= $f/@name/resolve-uri(.,base-uri(.))
|
||||
let $xqdoc:= xqd:xqdoc($ip,map{})
|
||||
let $xq:= fetch:text($ip)
|
||||
let $params:=map:merge((map{
|
||||
"source": $xq,
|
||||
"filename": $f/@name/string(),
|
||||
"cache": $xqd:cache,
|
||||
"show-private": true(),
|
||||
"root": "../../",
|
||||
"resources": "resources/"},
|
||||
$params))
|
||||
return (
|
||||
xqd:store2(xqd:parse($xq), "xparse.xml",$xqd:XML),
|
||||
xqd:store2($xqdoc,"xqdoc.xml",$xqd:XML),
|
||||
xqd:store2(xqd:xqdoc-html($xqdoc,$params), "index.html",$xqd:HTML5)
|
||||
)
|
||||
};
|
||||
(:~
|
||||
:save $data to $url , create fdolder if missing)
|
||||
:)
|
||||
declare function xqd:store($data,$url as xs:string,$params as map(*))
|
||||
{
|
||||
let $p:=file:parent($url)
|
||||
return (
|
||||
if(file:is-dir($p)) then () else file:create-dir($p),
|
||||
file:write($url,$data,$params)
|
||||
)
|
||||
};
|
||||
|
||||
(:~
|
||||
: return intent to save $data to $url with serialization $params
|
||||
:)
|
||||
declare function xqd:store2($data,$url as xs:string,$params as map(*))
|
||||
{
|
||||
map{"document": $data, "uri":$url,"opts":$params}
|
||||
};
|
||||
|
||||
(:~ parse XQuery
|
||||
: result is <XQuery> or <ERROR>
|
||||
:)
|
||||
declare function xqd:parse($xq as xs:string)
|
||||
as element(*)
|
||||
{
|
||||
xp:parse($xq || "",map{"lang":"xquery","version":"3.1 basex"})
|
||||
};
|
||||
|
||||
(:~
|
||||
: Generate xqdoc adding custom opts
|
||||
:)
|
||||
declare function xqd:xqdoc($url as xs:string,$opts as map(*))
|
||||
as element(xqdoc:xqdoc)
|
||||
{
|
||||
inspect:xqdoc($url)
|
||||
transform with {
|
||||
for $tag in map:keys($opts)
|
||||
return insert node <xqdoc:custom tag="_{ $tag }">{ $opts?($tag) }</xqdoc:custom>
|
||||
into xqdoc:module[@type="library"]/xqdoc:comment
|
||||
}
|
||||
};
|
||||
|
||||
(:~ transform xqdoc to html :)
|
||||
declare function xqd:xqdoc-html($xqd as element(xqdoc:xqdoc),
|
||||
$params as map(*)
|
||||
)
|
||||
as document-node()
|
||||
{
|
||||
xslt:transform($xqd,$xqd:mod-xslt,$params)
|
||||
};
|
||||
|
||||
(:~ transform files to html :)
|
||||
declare function xqd:index-html($files,
|
||||
$params as map(*)
|
||||
)
|
||||
as document-node()
|
||||
{
|
||||
xslt:transform($files,$xqd:index-xslt,$params)
|
||||
};
|
||||
|
||||
(:~ save runtime support files to $target :)
|
||||
declare
|
||||
function xqd:export-resources($target as xs:string)
|
||||
as empty-sequence(){
|
||||
archive:extract-to($target, file:read-binary(resolve-uri('resources.zip')))
|
||||
};
|
||||
|
||||
(:~ save runtime support files to $target :)
|
||||
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))]
|
||||
|
||||
};
|
||||
|
||||
(:~
|
||||
: return annotations with namespace and name
|
||||
:)
|
||||
declare function xqd:methods($annots as element(xqdoc:annotations),
|
||||
$annotns as xs:string,
|
||||
$aname as xs:string)
|
||||
as element(xqdoc:annotation)*
|
||||
{
|
||||
let $ns:=$annots/ancestor::xqdoc:xqdoc/xqdoc:namespaces
|
||||
let $prefixes:=$ns/xqdoc:namespace[@uri=$annotns]/@prefix/string()
|
||||
return $annots/xqdoc:annotation[@name=(for $p in $prefixes return concat($p,':',$aname))]
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
(: @return map of functions and variables having annotations :)
|
||||
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))
|
||||
))
|
||||
let $f:=$xqdoc//xqdoc:function[xqdoc:annotations]!
|
||||
map:entry(
|
||||
xqdoc:name || "#" || @arity,
|
||||
xqd:annots(xqdoc:annotations/xqdoc:annotation,$ns)
|
||||
)
|
||||
let $v:=$xqdoc//xqdoc:variable[xqdoc:annotations]!
|
||||
map:entry(
|
||||
xqdoc:name ,
|
||||
xqd:annots(xqdoc:annotations/xqdoc:annotation,$ns)
|
||||
)
|
||||
return map:merge(($f,$v))
|
||||
|
||||
};
|
||||
|
||||
(: return annotation map for a name
|
||||
: map{ $ns: map{
|
||||
: $aname: $values
|
||||
: }
|
||||
: }
|
||||
:)
|
||||
declare function xqd:annots(
|
||||
$annots as element(xqdoc:annotation)*,
|
||||
$ns as map(*)
|
||||
) as map(*)
|
||||
{
|
||||
map:merge(
|
||||
for $a in $annots
|
||||
group by $prefix:=substring-before($a/@name,":")
|
||||
return for $p in $prefix
|
||||
return map:entry(
|
||||
$ns?($p),
|
||||
map:merge((
|
||||
for $x in $a
|
||||
group by $aname:=if(contains($x/@name,":")) then substring-after($x/@name,":") else $x/@name
|
||||
return map:entry($aname,$x/*/string())
|
||||
))
|
||||
)
|
||||
)};
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- shared module for xqdoc -->
|
||||
<xsl:stylesheet version="3.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:doc="http://www.xqdoc.org/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qd="http://www.quodatum.com/ns/xsl" exclude-result-prefixes="xs doc">
|
||||
|
||||
<xsl:template name="resources">
|
||||
<xsl:param name="path" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{$path}xqdoc.png"/>
|
||||
<link rel="stylesheet" type="text/css" href="{$path}prism.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="{$path}page.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="{$path}query.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="{$path}base.css"/>
|
||||
<style>
|
||||
.tag {font-size: 100%;}
|
||||
</style>
|
||||
<script src="{$path}prism.js" type="text/javascript"> </script>
|
||||
</xsl:template>
|
||||
|
||||
<!-- path -->
|
||||
<xsl:function name="qd:path" as="xs:string">
|
||||
<xsl:param name="file" />
|
||||
<xsl:sequence select="concat('*',$file)" />
|
||||
</xsl:function>
|
||||
|
||||
<!-- link to namespace -->
|
||||
<xsl:function name="qd:nslink" as="element(a)">
|
||||
<xsl:param name="ns" as="xs:string"/>
|
||||
<a href="imports.html#{ $ns }"><xsl:value-of select="$ns"/></a>
|
||||
</xsl:function>
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
(: entity access maps
|
||||
: auto generated from xml files in entities folder at: 2019-08-06T22:46:17.734+01:00
|
||||
: auto generated from xml files in entities folder at: 2019-10-13T21:47:03.427+01:00
|
||||
:)
|
||||
|
||||
module namespace entity = 'quodatum.models.generated';
|
||||
|
|
@ -9,62 +9,6 @@ declare namespace h='urn:quodatum:vue-poc.history';
|
|||
declare namespace c='http://www.w3.org/ns/xproc-step';
|
||||
|
||||
declare variable $entity:list:=map {
|
||||
"basexlog": map{
|
||||
"name": "basexlog",
|
||||
"description": "BaseX log entries ",
|
||||
"access": map{
|
||||
"address": function($_ as element()) as xs:string {$_/@address },
|
||||
"ms": function($_ as element()) as xs:integer {$_/@ms },
|
||||
"text": function($_ as element()) as xs:string {$_/. },
|
||||
"time": function($_ as element()) as xs:string {$_/concat(@date,'T',@time) },
|
||||
"type": function($_ as element()) as xs:string {$_/@type },
|
||||
"user": function($_ as element()) as xs:string {$_/@user } },
|
||||
|
||||
"filter": function($item,$q) as xs:boolean{
|
||||
some $e in ( ) satisfies
|
||||
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
|
||||
},
|
||||
"json": map{
|
||||
"address": function($_ as element()) as element(address)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@address)!element address { .}
|
||||
},
|
||||
"ms": function($_ as element()) as element(ms)? {
|
||||
(: xs:integer :)
|
||||
fn:data($_/@ms)!element ms { attribute type {'number'}, .}
|
||||
},
|
||||
"text": function($_ as element()) as element(text)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/.)!element text { .}
|
||||
},
|
||||
"time": function($_ as element()) as element(time)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/concat(@date,'T',@time))!element time { .}
|
||||
},
|
||||
"type": function($_ as element()) as element(type)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@type)!element type { .}
|
||||
},
|
||||
"user": function($_ as element()) as element(user)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@user)!element user { .}
|
||||
} },
|
||||
|
||||
"data": function() as element(entry)*
|
||||
{
|
||||
let $add-date:=function($logs as element(*)*,$d as xs:string){
|
||||
$logs!(. transform with { insert node attribute date {$d} into .})
|
||||
}
|
||||
|
||||
return
|
||||
hof:top-k-by(admin:logs(), string#1, 2)
|
||||
!(reverse(admin:logs(.,true()))=>$add-date(.))
|
||||
},
|
||||
|
||||
"views": map{
|
||||
|
||||
}
|
||||
},
|
||||
"basexjob": map{
|
||||
"name": "basexjob",
|
||||
"description": "A BaseX job",
|
||||
|
|
@ -137,6 +81,87 @@ hof:top-k-by(admin:logs(), string#1, 2)
|
|||
|
||||
"views": map{
|
||||
'filter': 'name description'
|
||||
}
|
||||
},
|
||||
"basexlog": map{
|
||||
"name": "basexlog",
|
||||
"description": "BaseX log entries for today and yesterday from the running server",
|
||||
"access": map{
|
||||
"address": function($_ as element()) as xs:string {$_/@address },
|
||||
"ms": function($_ as element()) as xs:integer {$_/@ms },
|
||||
"text": function($_ as element()) as xs:string {$_/. },
|
||||
"time": function($_ as element()) as xs:string {$_/concat(@date,@date!'T',@time) },
|
||||
"type": function($_ as element()) as xs:string {$_/@type },
|
||||
"user": function($_ as element()) as xs:string {$_/@user } },
|
||||
|
||||
"filter": function($item,$q) as xs:boolean{
|
||||
some $e in ( ) satisfies
|
||||
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
|
||||
},
|
||||
"json": map{
|
||||
"address": function($_ as element()) as element(address)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@address)!element address { .}
|
||||
},
|
||||
"ms": function($_ as element()) as element(ms)? {
|
||||
(: xs:integer :)
|
||||
fn:data($_/@ms)!element ms { attribute type {'number'}, .}
|
||||
},
|
||||
"text": function($_ as element()) as element(text)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/.)!element text { .}
|
||||
},
|
||||
"time": function($_ as element()) as element(time)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/concat(@date,@date!'T',@time))!element time { .}
|
||||
},
|
||||
"type": function($_ as element()) as element(type)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@type)!element type { .}
|
||||
},
|
||||
"user": function($_ as element()) as element(user)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@user)!element user { .}
|
||||
} },
|
||||
|
||||
"data": function() as element(entry)*
|
||||
{
|
||||
let $add-date:=function($logs as element(*)*,$d as xs:string){
|
||||
$logs!(. transform with { insert node attribute date {$d} into .})
|
||||
}
|
||||
|
||||
return
|
||||
hof:top-k-by(admin:logs(), string#1, 2)
|
||||
!(reverse(admin:logs(.,true()))=>$add-date(.))
|
||||
},
|
||||
|
||||
"views": map{
|
||||
|
||||
}
|
||||
},
|
||||
"basexlogfile": map{
|
||||
"name": "basexlogfile",
|
||||
"description": "saved BaseX log entries in the vue-poc database",
|
||||
"access": map{
|
||||
"name": function($_ as element()) as xs:string {$_/. } },
|
||||
|
||||
"filter": function($item,$q) as xs:boolean{
|
||||
some $e in ( ) satisfies
|
||||
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
|
||||
},
|
||||
"json": map{
|
||||
"name": function($_ as element()) as element(name)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/.)!element name { .}
|
||||
} },
|
||||
|
||||
"data": function() as element(resource)*
|
||||
{
|
||||
db:dir("vue-poc","logs")
|
||||
},
|
||||
|
||||
"views": map{
|
||||
|
||||
}
|
||||
},
|
||||
"entity.field": map{
|
||||
|
|
@ -355,6 +380,61 @@ hof:top-k-by(admin:logs(), string#1, 2)
|
|||
|
||||
"views": map{
|
||||
'filter': 'name description'
|
||||
}
|
||||
},
|
||||
"logxml": map{
|
||||
"name": "logxml",
|
||||
"description": " log entries in XML format",
|
||||
"access": map{
|
||||
"address": function($_ as element()) as xs:string {$_/@address },
|
||||
"end": function($_ as element()) as xs:string? {$_/self::*[@ms]!(xs:dateTime(concat("2019-01-01",'T',@time))+ xs:dayTimeDuration("PT" || (@ms div 1000) || "S")) },
|
||||
"ms": function($_ as element()) as xs:integer {$_/@ms },
|
||||
"status": function($_ as element()) as xs:string {$_/@type },
|
||||
"text": function($_ as element()) as xs:string {$_/. },
|
||||
"time": function($_ as element()) as xs:string {$_/concat("2019-01-01",'T',@time) },
|
||||
"user": function($_ as element()) as xs:string {$_/@user } },
|
||||
|
||||
"filter": function($item,$q) as xs:boolean{
|
||||
some $e in ( ) satisfies
|
||||
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
|
||||
},
|
||||
"json": map{
|
||||
"address": function($_ as element()) as element(address)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@address)!element address { .}
|
||||
},
|
||||
"end": function($_ as element()) as element(end)? {
|
||||
(: xs:string? :)
|
||||
fn:data($_/self::*[@ms]!(xs:dateTime(concat("2019-01-01",'T',@time))+ xs:dayTimeDuration("PT" || (@ms div 1000) || "S")))!element end { .}
|
||||
},
|
||||
"ms": function($_ as element()) as element(ms)? {
|
||||
(: xs:integer :)
|
||||
fn:data($_/@ms)!element ms { attribute type {'number'}, .}
|
||||
},
|
||||
"status": function($_ as element()) as element(status)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@type)!element status { .}
|
||||
},
|
||||
"text": function($_ as element()) as element(text)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/.)!element text { .}
|
||||
},
|
||||
"time": function($_ as element()) as element(time)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/concat("2019-01-01",'T',@time))!element time { .}
|
||||
},
|
||||
"user": function($_ as element()) as element(user)? {
|
||||
(: xs:string :)
|
||||
fn:data($_/@user)!element user { .}
|
||||
} },
|
||||
|
||||
"data": function() as element(entry)*
|
||||
{
|
||||
db:open("vue-poc","/logs/")[1]/entries/entry
|
||||
},
|
||||
|
||||
"views": map{
|
||||
|
||||
}
|
||||
},
|
||||
"namespace": map{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"description": "A vue test",
|
||||
"dependencies": {
|
||||
"ace": "1.4.5",
|
||||
"vuetify": "1.5.16",
|
||||
"vuetify": "2.1.1",
|
||||
"vue": "2.6.10",
|
||||
"vuex": "3.0.1",
|
||||
"vue-router": "3.0.3",
|
||||
|
|
@ -14,7 +14,10 @@
|
|||
"axios": "0.18.1",
|
||||
"qs": "6.4.0",
|
||||
"localforage": "1.7.1",
|
||||
"momentjs": "2.18.1",
|
||||
"vuetify-jsonschema-form": "0.27.1"
|
||||
"momentjs": "2.24.0",
|
||||
"vuetify-jsonschema-form": "0.27.1",
|
||||
"prism": "1.15.0",
|
||||
"vue-prism-component": "1.1.1",
|
||||
"vis": "4.21.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ const router = new VueRouter({
|
|||
{ path: '/images/people', component: People, meta:{title:"Image people"} },
|
||||
|
||||
{ path: '/documentation', component: Documentation, meta:{title:"documentation"} },
|
||||
|
||||
{ path: '/logdate', component: Logdate, meta:{title:"log files"} },
|
||||
{ path: '/entity', component: Entity, meta:{title:"Entities"} },
|
||||
{ path: '/entity/:entity', name:"entity1", component: Entity1, props: true, meta:{title:"Entity"} },
|
||||
|
||||
|
|
@ -39,8 +39,7 @@ const router = new VueRouter({
|
|||
{ path: '/tabs', name: "multi-edit", component: Tabs,meta:{title:"tab test"} },
|
||||
|
||||
{ path: '/edit', name: "edit",component: Edit,meta:{title:"Ace editor"} },
|
||||
{ path: '/server/users', component: Users,meta:{title:"Users"} },
|
||||
{ path: '/server/repo', component: Repo,meta:{title:"Repository"} },
|
||||
|
||||
{ path: '/files', component: Files,meta:{title:"File system"},props:{protocol:"webfile"} },
|
||||
{ path: '/database', component: Files,meta:{title:"Databases"},props:{protocol:"xmldb"} },
|
||||
{ path: '/login', component: Login,meta:{title:"login"} },
|
||||
|
|
@ -88,7 +87,8 @@ const router = new VueRouter({
|
|||
{ path: 'settings', component: Basexsettings,meta:{title:"BaseX settings"} },
|
||||
{ path: 'ping', component: Ping,meta:{title:"Ping"} },
|
||||
{ path: 'dicetest', component: Dicetest,meta:{title:"Dice test"} },
|
||||
|
||||
{ path: 'users', component: Users,meta:{title:"Users"} },
|
||||
{ path: 'repo', component: Repo,meta:{title:"Repository"} },
|
||||
]
|
||||
},
|
||||
{ path: '/history', component: { template: '<router-view/>' }
|
||||
|
|
@ -123,7 +123,6 @@ const router = new VueRouter({
|
|||
|
||||
{ path: '/tasks', component: Tasks, meta:{title:"Runnable tasks"} },
|
||||
{ path: '/tasks/model', component: Model, meta:{title:"build model"} },
|
||||
{ path: '/tasks/xqdoc', component: Xqdoc, meta:{title:"build xqdoc"} },
|
||||
{ path: '/tasks/vuecompile', component: Vuecompile, meta:{title:"vue compile"} },
|
||||
{ path: '/tasks/:task', component: Runtask, props: true, meta:{title:"Run task"} },
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -10,11 +10,11 @@
|
|||
<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@2.0.5/dist/vuetify.min.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="//unpkg.com/vuetify@2.1.2/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" type="text/css"/>
|
||||
<link rel="stylesheet" href="//unpkg.com/leaflet@1.0.3/dist/leaflet.css"/>
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@koumoul/vuetify-jsonschema-form@0.27.1/dist/main.css" />
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@koumoul/vuetify-jsonschema-form@0.35.0/dist/main.css" />
|
||||
<link href="/vue-poc/ui/app.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/vue-poc/ui/svg/d3-svg.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.css" />
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<body>
|
||||
<div id="app">
|
||||
<h3><code>vue-poc</code> <small>(v0.4.1)</small> </h3>
|
||||
<h3><code>vue-poc</code> <small>(v0.4.4)</small> </h3>
|
||||
|
||||
<div class="spinner">
|
||||
<div class="rect1"></div>
|
||||
|
|
@ -39,27 +39,27 @@
|
|||
<script src="//cdnjs.cloudflare.com/ajax/libs/axios/0.18.1/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@2.0.5/dist/vuetify.min.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.5/ace.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.5/ext-language_tools.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.5/ext-linking.js" crossorigin="anonymous" charset="utf-8"></script>
|
||||
<script src="//unpkg.com/vuetify@2.1.2/dist/vuetify.min.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.6/ace.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.6/ext-language_tools.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.6/ext-linking.js" crossorigin="anonymous" charset="utf-8"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/4.13.0/d3.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.9.0/beautify.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.9.0/beautify-css.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.9.0/beautify-html.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/localforage/1.7.1/localforage.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.js" crossorigin="anonymous"></script>
|
||||
<script src="//unpkg.com/vue-clip@1.0.0/dist/vue-clip.js" crossorigin="anonymous"></script>
|
||||
<script src="//unpkg.com/@riophae/vue-treeselect@0.0.29/dist/vue-treeselect.min.js" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="/vue-poc/ui/prism/prism.js" crossorigin="anonymous"></script>
|
||||
<script src="//unpkg.com/vue-prism-component@1.0.1/dist/vue-prism-component.min.js" crossorigin="anonymous"></script>
|
||||
<script src="//unpkg.com/vue-prism-component@1.1.1/dist/vue-prism-component.min.js" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="//unpkg.com/leaflet@1.0.3/dist/leaflet.js" crossorigin="anonymous"></script>
|
||||
<script src="//unpkg.com/vue2-leaflet@1.0.2/dist/vue2-leaflet.js" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="//cdn.jsdelivr.net/npm/@koumoul/vuetify-jsonschema-form@0.27.1/dist/main.js" crossorigin="anonymous"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/@koumoul/vuetify-jsonschema-form@0.35.0/dist/main.js" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="//unpkg.com/vue-native-websocket@2.0.8/dist/build.js" crossorigin="anonymous"></script>
|
||||
<script src="/vue-poc/ui/svg/d3-svg.js"></script>
|
||||
|
|
|
|||
72
src/vue-poc/static/uri/URI.js
Normal file
72
src/vue-poc/static/uri/URI.js
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/*! URI.js v1.19.1 http://medialize.github.io/URI.js/ */
|
||||
/* build contains: URI.js */
|
||||
/*
|
||||
URI.js - Mutating URLs
|
||||
|
||||
Version: 1.19.1
|
||||
|
||||
Author: Rodney Rehm
|
||||
Web: http://medialize.github.io/URI.js/
|
||||
|
||||
Licensed under
|
||||
MIT License http://www.opensource.org/licenses/mit-license
|
||||
|
||||
*/
|
||||
(function(m,v){"object"===typeof module&&module.exports?module.exports=v(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],v):m.URI=v(m.punycode,m.IPv6,m.SecondLevelDomains,m)})(this,function(m,v,t,h){function d(a,b){var c=1<=arguments.length,e=2<=arguments.length;if(!(this instanceof d))return c?e?new d(a,b):new d(a):new d;if(void 0===a){if(c)throw new TypeError("undefined is not a valid argument for URI");
|
||||
a="undefined"!==typeof location?location.href+"":""}if(null===a&&c)throw new TypeError("null is not a valid argument for URI");this.href(a);return void 0!==b?this.absoluteTo(b):this}function p(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function k(a){return"Array"===u(a)}function C(a,b){var c={},d;if("RegExp"===u(b))c=null;else if(k(b)){var f=0;for(d=b.length;f<d;f++)c[b[f]]=!0}else c[b]=
|
||||
!0;f=0;for(d=a.length;f<d;f++)if(c&&void 0!==c[a[f]]||!c&&b.test(a[f]))a.splice(f,1),d--,f--;return a}function w(a,b){var c;if(k(b)){var d=0;for(c=b.length;d<c;d++)if(!w(a,b[d]))return!1;return!0}var f=u(b);d=0;for(c=a.length;d<c;d++)if("RegExp"===f){if("string"===typeof a[d]&&a[d].match(b))return!0}else if(a[d]===b)return!0;return!1}function D(a,b){if(!k(a)||!k(b)||a.length!==b.length)return!1;a.sort();b.sort();for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function z(a){return a.replace(/^\/+|\/+$/g,
|
||||
"")}function F(a){return escape(a)}function A(a){return encodeURIComponent(a).replace(/[!'()*]/g,F).replace(/\*/g,"%2A")}function x(a){return function(b,c){if(void 0===b)return this._parts[a]||"";this._parts[a]=b||null;this.build(!c);return this}}function E(a,b){return function(c,d){if(void 0===c)return this._parts[a]||"";null!==c&&(c+="",c.charAt(0)===b&&(c=c.substring(1)));this._parts[a]=c;this.build(!d);return this}}var G=h&&h.URI;d.version="1.19.1";var g=d.prototype,l=Object.prototype.hasOwnProperty;
|
||||
d._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:d.preventInvalidHostname,duplicateQueryParameters:d.duplicateQueryParameters,escapeQuerySpace:d.escapeQuerySpace}};d.preventInvalidHostname=!1;d.duplicateQueryParameters=!1;d.escapeQuerySpace=!0;d.protocol_expression=/^[a-z][a-z0-9.+-]*$/i;d.idn_expression=/[^a-z0-9\._-]/i;d.punycode_expression=/(xn--)/i;d.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
|
||||
d.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
|
||||
d.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/ig;d.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g};d.defaultPorts={http:"80",https:"443",ftp:"21",
|
||||
gopher:"70",ws:"80",wss:"443"};d.hostProtocols=["http","https"];d.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/;d.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"};d.getDomAttribute=function(a){if(a&&a.nodeName){var b=a.nodeName.toLowerCase();if("input"!==b||"image"===a.type)return d.domAttributes[b]}};d.encode=A;d.decode=decodeURIComponent;d.iso8859=
|
||||
function(){d.encode=escape;d.decode=unescape};d.unicode=function(){d.encode=A;d.decode=decodeURIComponent};d.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@",
|
||||
"%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}};d.encodeQuery=function(a,b){var c=d.encode(a+"");void 0===b&&(b=d.escapeQuerySpace);return b?c.replace(/%20/g,"+"):c};d.decodeQuery=
|
||||
function(a,b){a+="";void 0===b&&(b=d.escapeQuerySpace);try{return d.decode(b?a.replace(/\+/g,"%20"):a)}catch(c){return a}};var r={encode:"encode",decode:"decode"},y,B=function(a,b){return function(c){try{return d[b](c+"").replace(d.characters[a][b].expression,function(c){return d.characters[a][b].map[c]})}catch(e){return c}}};for(y in r)d[y+"PathSegment"]=B("pathname",r[y]),d[y+"UrnPathSegment"]=B("urnpath",r[y]);r=function(a,b,c){return function(e){var f=c?function(a){return d[b](d[c](a))}:d[b];
|
||||
e=(e+"").split(a);for(var g=0,n=e.length;g<n;g++)e[g]=f(e[g]);return e.join(a)}};d.decodePath=r("/","decodePathSegment");d.decodeUrnPath=r(":","decodeUrnPathSegment");d.recodePath=r("/","encodePathSegment","decode");d.recodeUrnPath=r(":","encodeUrnPathSegment","decode");d.encodeReserved=B("reserved","encode");d.parse=function(a,b){b||(b={preventInvalidHostname:d.preventInvalidHostname});var c=a.indexOf("#");-1<c&&(b.fragment=a.substring(c+1)||null,a=a.substring(0,c));c=a.indexOf("?");-1<c&&(b.query=
|
||||
a.substring(c+1)||null,a=a.substring(0,c));"//"===a.substring(0,2)?(b.protocol=null,a=a.substring(2),a=d.parseAuthority(a,b)):(c=a.indexOf(":"),-1<c&&(b.protocol=a.substring(0,c)||null,b.protocol&&!b.protocol.match(d.protocol_expression)?b.protocol=void 0:"//"===a.substring(c+1,c+3)?(a=a.substring(c+3),a=d.parseAuthority(a,b)):(a=a.substring(c+1),b.urn=!0)));b.path=a;return b};d.parseHost=function(a,b){a||(a="");a=a.replace(/\\/g,"/");var c=a.indexOf("/");-1===c&&(c=a.length);if("["===a.charAt(0)){var e=
|
||||
a.indexOf("]");b.hostname=a.substring(1,e)||null;b.port=a.substring(e+2,c)||null;"/"===b.port&&(b.port=null)}else{var f=a.indexOf(":");e=a.indexOf("/");f=a.indexOf(":",f+1);-1!==f&&(-1===e||f<e)?(b.hostname=a.substring(0,c)||null,b.port=null):(e=a.substring(0,c).split(":"),b.hostname=e[0]||null,b.port=e[1]||null)}b.hostname&&"/"!==a.substring(c).charAt(0)&&(c++,a="/"+a);b.preventInvalidHostname&&d.ensureValidHostname(b.hostname,b.protocol);b.port&&d.ensureValidPort(b.port);return a.substring(c)||
|
||||
"/"};d.parseAuthority=function(a,b){a=d.parseUserinfo(a,b);return d.parseHost(a,b)};d.parseUserinfo=function(a,b){var c=a.indexOf("/"),e=a.lastIndexOf("@",-1<c?c:a.length-1);-1<e&&(-1===c||e<c)?(c=a.substring(0,e).split(":"),b.username=c[0]?d.decode(c[0]):null,c.shift(),b.password=c[0]?d.decode(c.join(":")):null,a=a.substring(e+1)):(b.username=null,b.password=null);return a};d.parseQuery=function(a,b){if(!a)return{};a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"");if(!a)return{};for(var c={},e=a.split("&"),
|
||||
f=e.length,g,n,k=0;k<f;k++)if(g=e[k].split("="),n=d.decodeQuery(g.shift(),b),g=g.length?d.decodeQuery(g.join("="),b):null,l.call(c,n)){if("string"===typeof c[n]||null===c[n])c[n]=[c[n]];c[n].push(g)}else c[n]=g;return c};d.build=function(a){var b="";a.protocol&&(b+=a.protocol+":");a.urn||!b&&!a.hostname||(b+="//");b+=d.buildAuthority(a)||"";"string"===typeof a.path&&("/"!==a.path.charAt(0)&&"string"===typeof a.hostname&&(b+="/"),b+=a.path);"string"===typeof a.query&&a.query&&(b+="?"+a.query);"string"===
|
||||
typeof a.fragment&&a.fragment&&(b+="#"+a.fragment);return b};d.buildHost=function(a){var b="";if(a.hostname)b=d.ip6_expression.test(a.hostname)?b+("["+a.hostname+"]"):b+a.hostname;else return"";a.port&&(b+=":"+a.port);return b};d.buildAuthority=function(a){return d.buildUserinfo(a)+d.buildHost(a)};d.buildUserinfo=function(a){var b="";a.username&&(b+=d.encode(a.username));a.password&&(b+=":"+d.encode(a.password));b&&(b+="@");return b};d.buildQuery=function(a,b,c){var e="",f,g;for(f in a)if(l.call(a,
|
||||
f)&&f)if(k(a[f])){var n={};var h=0;for(g=a[f].length;h<g;h++)void 0!==a[f][h]&&void 0===n[a[f][h]+""]&&(e+="&"+d.buildQueryParameter(f,a[f][h],c),!0!==b&&(n[a[f][h]+""]=!0))}else void 0!==a[f]&&(e+="&"+d.buildQueryParameter(f,a[f],c));return e.substring(1)};d.buildQueryParameter=function(a,b,c){return d.encodeQuery(a,c)+(null!==b?"="+d.encodeQuery(b,c):"")};d.addQuery=function(a,b,c){if("object"===typeof b)for(var e in b)l.call(b,e)&&d.addQuery(a,e,b[e]);else if("string"===typeof b)void 0===a[b]?
|
||||
a[b]=c:("string"===typeof a[b]&&(a[b]=[a[b]]),k(c)||(c=[c]),a[b]=(a[b]||[]).concat(c));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};d.setQuery=function(a,b,c){if("object"===typeof b)for(var e in b)l.call(b,e)&&d.setQuery(a,e,b[e]);else if("string"===typeof b)a[b]=void 0===c?null:c;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");};d.removeQuery=function(a,b,c){var e;if(k(b))for(c=0,e=b.length;c<e;c++)a[b[c]]=
|
||||
void 0;else if("RegExp"===u(b))for(e in a)b.test(e)&&(a[e]=void 0);else if("object"===typeof b)for(e in b)l.call(b,e)&&d.removeQuery(a,e,b[e]);else if("string"===typeof b)void 0!==c?"RegExp"===u(c)?!k(a[b])&&c.test(a[b])?a[b]=void 0:a[b]=C(a[b],c):a[b]!==String(c)||k(c)&&1!==c.length?k(a[b])&&(a[b]=C(a[b],c)):a[b]=void 0:a[b]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");};d.hasQuery=function(a,b,c,e){switch(u(b)){case "String":break;
|
||||
case "RegExp":for(var f in a)if(l.call(a,f)&&b.test(f)&&(void 0===c||d.hasQuery(a,f,c)))return!0;return!1;case "Object":for(var g in b)if(l.call(b,g)&&!d.hasQuery(a,g,b[g]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter");}switch(u(c)){case "Undefined":return b in a;case "Boolean":return a=!(k(a[b])?!a[b].length:!a[b]),c===a;case "Function":return!!c(a[b],b,a);case "Array":return k(a[b])?(e?w:D)(a[b],c):!1;case "RegExp":return k(a[b])?
|
||||
e?w(a[b],c):!1:!(!a[b]||!a[b].match(c));case "Number":c=String(c);case "String":return k(a[b])?e?w(a[b],c):!1:a[b]===c;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};d.joinPaths=function(){for(var a=[],b=[],c=0,e=0;e<arguments.length;e++){var f=new d(arguments[e]);a.push(f);f=f.segment();for(var g=0;g<f.length;g++)"string"===typeof f[g]&&b.push(f[g]),f[g]&&c++}if(!b.length||!c)return new d("");b=(new d("")).segment(b);
|
||||
""!==a[0].path()&&"/"!==a[0].path().slice(0,1)||b.path("/"+b.path());return b.normalize()};d.commonPath=function(a,b){var c=Math.min(a.length,b.length),d;for(d=0;d<c;d++)if(a.charAt(d)!==b.charAt(d)){d--;break}if(1>d)return a.charAt(0)===b.charAt(0)&&"/"===a.charAt(0)?"/":"";if("/"!==a.charAt(d)||"/"!==b.charAt(d))d=a.substring(0,d).lastIndexOf("/");return a.substring(0,d+1)};d.withinString=function(a,b,c){c||(c={});var e=c.start||d.findUri.start,f=c.end||d.findUri.end,g=c.trim||d.findUri.trim,n=
|
||||
c.parens||d.findUri.parens,k=/[a-z0-9-]=["']?$/i;for(e.lastIndex=0;;){var h=e.exec(a);if(!h)break;var m=h.index;if(c.ignoreHtml){var q=a.slice(Math.max(m-3,0),m);if(q&&k.test(q))continue}var l=m+a.slice(m).search(f);q=a.slice(m,l);for(l=-1;;){var p=n.exec(q);if(!p)break;l=Math.max(l,p.index+p[0].length)}q=-1<l?q.slice(0,l)+q.slice(l).replace(g,""):q.replace(g,"");q.length<=h[0].length||c.ignore&&c.ignore.test(q)||(l=m+q.length,h=b(q,m,l,a),void 0===h?e.lastIndex=l:(h=String(h),a=a.slice(0,m)+h+a.slice(l),
|
||||
e.lastIndex=m+h.length))}e.lastIndex=0;return a};d.ensureValidHostname=function(a,b){var c=!!a,e=!1;b&&(e=w(d.hostProtocols,b));if(e&&!c)throw new TypeError("Hostname cannot be empty, if protocol is "+b);if(a&&a.match(d.invalid_hostname_characters)){if(!m)throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(m.toASCII(a).match(d.invalid_hostname_characters))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_]');
|
||||
}};d.ensureValidPort=function(a){if(a){var b=Number(a);if(!(/^[0-9]+$/.test(b)&&0<b&&65536>b))throw new TypeError('Port "'+a+'" is not a valid port');}};d.noConflict=function(a){if(a)return a={URI:this.noConflict()},h.URITemplate&&"function"===typeof h.URITemplate.noConflict&&(a.URITemplate=h.URITemplate.noConflict()),h.IPv6&&"function"===typeof h.IPv6.noConflict&&(a.IPv6=h.IPv6.noConflict()),h.SecondLevelDomains&&"function"===typeof h.SecondLevelDomains.noConflict&&(a.SecondLevelDomains=h.SecondLevelDomains.noConflict()),
|
||||
a;h.URI===this&&(h.URI=G);return this};g.build=function(a){if(!0===a)this._deferred_build=!0;else if(void 0===a||this._deferred_build)this._string=d.build(this._parts),this._deferred_build=!1;return this};g.clone=function(){return new d(this)};g.valueOf=g.toString=function(){return this.build(!1)._string};g.protocol=x("protocol");g.username=x("username");g.password=x("password");g.hostname=x("hostname");g.port=x("port");g.query=E("query","?");g.fragment=E("fragment","#");g.search=function(a,b){var c=
|
||||
this.query(a,b);return"string"===typeof c&&c.length?"?"+c:c};g.hash=function(a,b){var c=this.fragment(a,b);return"string"===typeof c&&c.length?"#"+c:c};g.pathname=function(a,b){if(void 0===a||!0===a){var c=this._parts.path||(this._parts.hostname?"/":"");return a?(this._parts.urn?d.decodeUrnPath:d.decodePath)(c):c}this._parts.path=this._parts.urn?a?d.recodeUrnPath(a):"":a?d.recodePath(a):"/";this.build(!b);return this};g.path=g.pathname;g.href=function(a,b){var c;if(void 0===a)return this.toString();
|
||||
this._string="";this._parts=d._parts();var e=a instanceof d,f="object"===typeof a&&(a.hostname||a.path||a.pathname);a.nodeName&&(f=d.getDomAttribute(a),a=a[f]||"",f=!1);!e&&f&&void 0!==a.pathname&&(a=a.toString());if("string"===typeof a||a instanceof String)this._parts=d.parse(String(a),this._parts);else if(e||f){e=e?a._parts:a;for(c in e)"query"!==c&&l.call(this._parts,c)&&(this._parts[c]=e[c]);e.query&&this.query(e.query,!1)}else throw new TypeError("invalid input");this.build(!b);return this};
|
||||
g.is=function(a){var b=!1,c=!1,e=!1,f=!1,g=!1,h=!1,k=!1,l=!this._parts.urn;this._parts.hostname&&(l=!1,c=d.ip4_expression.test(this._parts.hostname),e=d.ip6_expression.test(this._parts.hostname),b=c||e,g=(f=!b)&&t&&t.has(this._parts.hostname),h=f&&d.idn_expression.test(this._parts.hostname),k=f&&d.punycode_expression.test(this._parts.hostname));switch(a.toLowerCase()){case "relative":return l;case "absolute":return!l;case "domain":case "name":return f;case "sld":return g;case "ip":return b;case "ip4":case "ipv4":case "inet4":return c;
|
||||
case "ip6":case "ipv6":case "inet6":return e;case "idn":return h;case "url":return!this._parts.urn;case "urn":return!!this._parts.urn;case "punycode":return k}return null};var H=g.protocol,I=g.port,J=g.hostname;g.protocol=function(a,b){if(a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(d.protocol_expression)))throw new TypeError('Protocol "'+a+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return H.call(this,a,b)};g.scheme=g.protocol;g.port=function(a,b){if(this._parts.urn)return void 0===
|
||||
a?"":this;void 0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),d.ensureValidPort(a)));return I.call(this,a,b)};g.hostname=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var c={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==d.parseHost(a,c))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');a=c.hostname;this._parts.preventInvalidHostname&&d.ensureValidHostname(a,this._parts.protocol)}return J.call(this,
|
||||
a,b)};g.origin=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){var c=this.protocol();return this.authority()?(c?c+"://":"")+this.authority():""}c=d(a);this.protocol(c.protocol()).authority(c.authority()).build(!b);return this};g.host=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?d.buildHost(this._parts):"";if("/"!==d.parseHost(a,this._parts))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');
|
||||
this.build(!b);return this};g.authority=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?d.buildAuthority(this._parts):"";if("/"!==d.parseAuthority(a,this._parts))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');this.build(!b);return this};g.userinfo=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){var c=d.buildUserinfo(this._parts);return c?c.substring(0,c.length-1):c}"@"!==a[a.length-1]&&
|
||||
(a+="@");d.parseUserinfo(a,this._parts);this.build(!b);return this};g.resource=function(a,b){if(void 0===a)return this.path()+this.search()+this.hash();var c=d.parse(a);this._parts.path=c.path;this._parts.query=c.query;this._parts.fragment=c.fragment;this.build(!b);return this};g.subdomain=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,
|
||||
c)||""}c=this._parts.hostname.length-this.domain().length;c=this._parts.hostname.substring(0,c);c=new RegExp("^"+p(c));a&&"."!==a.charAt(a.length-1)&&(a+=".");if(-1!==a.indexOf(":"))throw new TypeError("Domains cannot contain colons");a&&d.ensureValidHostname(a,this._parts.protocol);this._parts.hostname=this._parts.hostname.replace(c,a);this.build(!b);return this};g.domain=function(a,b){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||
|
||||
this.is("IP"))return"";var c=this._parts.hostname.match(/\./g);if(c&&2>c.length)return this._parts.hostname;c=this._parts.hostname.length-this.tld(b).length-1;c=this._parts.hostname.lastIndexOf(".",c-1)+1;return this._parts.hostname.substring(c)||""}if(!a)throw new TypeError("cannot set domain empty");if(-1!==a.indexOf(":"))throw new TypeError("Domains cannot contain colons");d.ensureValidHostname(a,this._parts.protocol);!this._parts.hostname||this.is("IP")?this._parts.hostname=a:(c=new RegExp(p(this.domain())+
|
||||
"$"),this._parts.hostname=this._parts.hostname.replace(c,a));this.build(!b);return this};g.tld=function(a,b){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.lastIndexOf(".");c=this._parts.hostname.substring(c+1);return!0!==b&&t&&t.list[c.toLowerCase()]?t.get(this._parts.hostname)||c:c}if(a)if(a.match(/[^a-zA-Z0-9-]/))if(t&&t.is(a))c=new RegExp(p(this.tld())+"$"),this._parts.hostname=
|
||||
this._parts.hostname.replace(c,a);else throw new TypeError('TLD "'+a+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");c=new RegExp(p(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(c,a)}else throw new TypeError("cannot set TLD empty");this.build(!b);return this};g.directory=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path&&
|
||||
!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var c=this._parts.path.length-this.filename().length-1;c=this._parts.path.substring(0,c)||(this._parts.hostname?"/":"");return a?d.decodePath(c):c}c=this._parts.path.length-this.filename().length;c=this._parts.path.substring(0,c);c=new RegExp("^"+p(c));this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a));a&&"/"!==a.charAt(a.length-1)&&(a+="/");a=d.recodePath(a);this._parts.path=this._parts.path.replace(c,a);this.build(!b);
|
||||
return this};g.filename=function(a,b){if(this._parts.urn)return void 0===a?"":this;if("string"!==typeof a){if(!this._parts.path||"/"===this._parts.path)return"";var c=this._parts.path.lastIndexOf("/");c=this._parts.path.substring(c+1);return a?d.decodePathSegment(c):c}c=!1;"/"===a.charAt(0)&&(a=a.substring(1));a.match(/\.?\//)&&(c=!0);var e=new RegExp(p(this.filename())+"$");a=d.recodePath(a);this._parts.path=this._parts.path.replace(e,a);c?this.normalizePath(b):this.build(!b);return this};g.suffix=
|
||||
function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var c=this.filename(),e=c.lastIndexOf(".");if(-1===e)return"";c=c.substring(e+1);c=/^[a-z0-9%]+$/i.test(c)?c:"";return a?d.decodePathSegment(c):c}"."===a.charAt(0)&&(a=a.substring(1));if(c=this.suffix())e=a?new RegExp(p(c)+"$"):new RegExp(p("."+c)+"$");else{if(!a)return this;this._parts.path+="."+d.recodePath(a)}e&&(a=d.recodePath(a),this._parts.path=this._parts.path.replace(e,
|
||||
a));this.build(!b);return this};g.segment=function(a,b,c){var d=this._parts.urn?":":"/",f=this.path(),g="/"===f.substring(0,1);f=f.split(d);void 0!==a&&"number"!==typeof a&&(c=b,b=a,a=void 0);if(void 0!==a&&"number"!==typeof a)throw Error('Bad segment "'+a+'", must be 0-based integer');g&&f.shift();0>a&&(a=Math.max(f.length+a,0));if(void 0===b)return void 0===a?f:f[a];if(null===a||void 0===f[a])if(k(b)){f=[];a=0;for(var h=b.length;a<h;a++)if(b[a].length||f.length&&f[f.length-1].length)f.length&&!f[f.length-
|
||||
1].length&&f.pop(),f.push(z(b[a]))}else{if(b||"string"===typeof b)b=z(b),""===f[f.length-1]?f[f.length-1]=b:f.push(b)}else b?f[a]=z(b):f.splice(a,1);g&&f.unshift("");return this.path(f.join(d),c)};g.segmentCoded=function(a,b,c){var e;"number"!==typeof a&&(c=b,b=a,a=void 0);if(void 0===b){a=this.segment(a,b,c);if(k(a)){var f=0;for(e=a.length;f<e;f++)a[f]=d.decode(a[f])}else a=void 0!==a?d.decode(a):void 0;return a}if(k(b))for(f=0,e=b.length;f<e;f++)b[f]=d.encode(b[f]);else b="string"===typeof b||b instanceof
|
||||
String?d.encode(b):b;return this.segment(a,b,c)};var K=g.query;g.query=function(a,b){if(!0===a)return d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"===typeof a){var c=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace),e=a.call(this,c);this._parts.query=d.buildQuery(e||c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);this.build(!b);return this}return void 0!==a&&"string"!==typeof a?(this._parts.query=d.buildQuery(a,this._parts.duplicateQueryParameters,
|
||||
this._parts.escapeQuerySpace),this.build(!b),this):K.call(this,a,b)};g.setQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"===typeof a||a instanceof String)e[a]=void 0!==b?b:null;else if("object"===typeof a)for(var f in a)l.call(a,f)&&(e[f]=a[f]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");this._parts.query=d.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&
|
||||
(c=b);this.build(!c);return this};g.addQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);d.addQuery(e,a,void 0===b?null:b);this._parts.query=d.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};g.removeQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);d.removeQuery(e,a,b);this._parts.query=d.buildQuery(e,this._parts.duplicateQueryParameters,
|
||||
this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};g.hasQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.hasQuery(e,a,b,c)};g.setSearch=g.setQuery;g.addSearch=g.addQuery;g.removeSearch=g.removeQuery;g.hasSearch=g.hasQuery;g.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()};
|
||||
g.normalizeProtocol=function(a){"string"===typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a));return this};g.normalizeHostname=function(a){this._parts.hostname&&(this.is("IDN")&&m?this._parts.hostname=m.toASCII(this._parts.hostname):this.is("IPv6")&&v&&(this._parts.hostname=v.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!a));return this};g.normalizePort=function(a){"string"===typeof this._parts.protocol&&
|
||||
this._parts.port===d.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a));return this};g.normalizePath=function(a){var b=this._parts.path;if(!b)return this;if(this._parts.urn)return this._parts.path=d.recodeUrnPath(this._parts.path),this.build(!a),this;if("/"===this._parts.path)return this;b=d.recodePath(b);var c="";if("/"!==b.charAt(0)){var e=!0;b="/"+b}if("/.."===b.slice(-3)||"/."===b.slice(-2))b+="/";b=b.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/");e&&(c=b.substring(1).match(/^(\.\.\/)+/)||
|
||||
"")&&(c=c[0]);for(;;){var f=b.search(/\/\.\.(\/|$)/);if(-1===f)break;else if(0===f){b=b.substring(3);continue}var g=b.substring(0,f).lastIndexOf("/");-1===g&&(g=f);b=b.substring(0,g)+b.substring(f+3)}e&&this.is("relative")&&(b=c+b.substring(1));this._parts.path=b;this.build(!a);return this};g.normalizePathname=g.normalizePath;g.normalizeQuery=function(a){"string"===typeof this._parts.query&&(this._parts.query.length?this.query(d.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=
|
||||
null,this.build(!a));return this};g.normalizeFragment=function(a){this._parts.fragment||(this._parts.fragment=null,this.build(!a));return this};g.normalizeSearch=g.normalizeQuery;g.normalizeHash=g.normalizeFragment;g.iso8859=function(){var a=d.encode,b=d.decode;d.encode=escape;d.decode=decodeURIComponent;try{this.normalize()}finally{d.encode=a,d.decode=b}return this};g.unicode=function(){var a=d.encode,b=d.decode;d.encode=A;d.decode=unescape;try{this.normalize()}finally{d.encode=a,d.decode=b}return this};
|
||||
g.readable=function(){var a=this.clone();a.username("").password("").normalize();var b="";a._parts.protocol&&(b+=a._parts.protocol+"://");a._parts.hostname&&(a.is("punycode")&&m?(b+=m.toUnicode(a._parts.hostname),a._parts.port&&(b+=":"+a._parts.port)):b+=a.host());a._parts.hostname&&a._parts.path&&"/"!==a._parts.path.charAt(0)&&(b+="/");b+=a.path(!0);if(a._parts.query){for(var c="",e=0,f=a._parts.query.split("&"),g=f.length;e<g;e++){var h=(f[e]||"").split("=");c+="&"+d.decodeQuery(h[0],this._parts.escapeQuerySpace).replace(/&/g,
|
||||
"%26");void 0!==h[1]&&(c+="="+d.decodeQuery(h[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}b+="?"+c.substring(1)}return b+=d.decodeQuery(a.hash(),!0)};g.absoluteTo=function(a){var b=this.clone(),c=["protocol","username","password","hostname","port"],e,f;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a instanceof d||(a=new d(a));if(b._parts.protocol)return b;b._parts.protocol=a._parts.protocol;if(this._parts.hostname)return b;for(e=0;f=c[e];e++)b._parts[f]=
|
||||
a._parts[f];b._parts.path?(".."===b._parts.path.substring(-2)&&(b._parts.path+="/"),"/"!==b.path().charAt(0)&&(c=(c=a.directory())?c:0===a.path().indexOf("/")?"/":"",b._parts.path=(c?c+"/":"")+b._parts.path,b.normalizePath())):(b._parts.path=a._parts.path,b._parts.query||(b._parts.query=a._parts.query));b.build();return b};g.relativeTo=function(a){var b=this.clone().normalize();if(b._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a=(new d(a)).normalize();var c=
|
||||
b._parts;var e=a._parts;var f=b.path();a=a.path();if("/"!==f.charAt(0))throw Error("URI is already relative");if("/"!==a.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");c.protocol===e.protocol&&(c.protocol=null);if(c.username===e.username&&c.password===e.password&&null===c.protocol&&null===c.username&&null===c.password&&c.hostname===e.hostname&&c.port===e.port)c.hostname=null,c.port=null;else return b.build();if(f===a)return c.path="",b.build();f=d.commonPath(f,a);
|
||||
if(!f)return b.build();e=e.path.substring(f.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");c.path=e+c.path.substring(f.length)||"./";return b.build()};g.equals=function(a){var b=this.clone(),c=new d(a);a={};var e;b.normalize();c.normalize();if(b.toString()===c.toString())return!0;var f=b.query();var g=c.query();b.query("");c.query("");if(b.toString()!==c.toString()||f.length!==g.length)return!1;b=d.parseQuery(f,this._parts.escapeQuerySpace);g=d.parseQuery(g,this._parts.escapeQuerySpace);for(e in b)if(l.call(b,
|
||||
e)){if(!k(b[e])){if(b[e]!==g[e])return!1}else if(!D(b[e],g[e]))return!1;a[e]=!0}for(e in g)if(l.call(g,e)&&!a[e])return!1;return!0};g.preventInvalidHostname=function(a){this._parts.preventInvalidHostname=!!a;return this};g.duplicateQueryParameters=function(a){this._parts.duplicateQueryParameters=!!a;return this};g.escapeQuerySpace=function(a){this._parts.escapeQuerySpace=!!a;return this};return d});
|
||||
|
|
@ -6,8 +6,11 @@ import module namespace dbtools = 'quodatum.dbtools' at "../lib/dbtools.xqm";
|
|||
declare variable $target-db:="vue-poc";
|
||||
|
||||
declare variable $data-uri:=resolve-uri("../data/vue-poc/");
|
||||
(dbtools:sync-from-files(
|
||||
$target-db
|
||||
,$data-uri
|
||||
,file:list($data-uri,fn:true())
|
||||
,hof:id#1))
|
||||
|
||||
dbtools:sync-from-files(
|
||||
$target-db
|
||||
,$data-uri
|
||||
,file:list($data-uri,fn:true())
|
||||
,hof:id#1
|
||||
,true()
|
||||
)
|
||||
7
tests/vue-poc/smoke-xqdoca.xq
Normal file
7
tests/vue-poc/smoke-xqdoca.xq
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
(:
|
||||
:)
|
||||
import module namespace query-a = 'vue-poc/query-a' at 'C:\Users\andy\git\vue-poc\src\vue-poc\lib\query-a.xqm';
|
||||
|
||||
declare variable $q-uri:= "C:\Users\andy\git\xqdoca\src\main\xqdoca.xq";
|
||||
let $opts:= map{"base-uri":"C:\Users\andy\git\xqdoca\src\main\xqdoca.xq"}
|
||||
return query-a:run($q-uri, map{}, $opts)
|
||||
Loading…
Add table
Reference in a new issue