Skip to content

Commit

Permalink
docs parsing in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
williamngan committed Jun 25, 2018
1 parent af10a8f commit 66f7161
Show file tree
Hide file tree
Showing 8 changed files with 11,321 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules/
temp/
*.js.map
.DS_Store
*.mp4
*.mp4
docsn/**/*.json
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,import-star-module-level,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,long-suffix,old-ne-operator,old-octal-literal,suppressed-message,useless-suppression,missing-docstring,invalid-name,trailing-whitespace,trailing-newline,bad-indentation,bad-whitespace
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,import-star-module-level,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,long-suffix,old-ne-operator,old-octal-literal,suppressed-message,useless-suppression,missing-docstring,invalid-name,trailing-whitespace,trailing-newline,bad-indentation,bad-whitespace,bad-continuation


[REPORTS]
Expand Down
29 changes: 0 additions & 29 deletions docs/json/parse.py

This file was deleted.

53 changes: 53 additions & 0 deletions docsn/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<html>
<head>
<script type="text/javascript" src="./js/vue.js"></script>
<style type="text/css">
body {
font-family: "Helvetica", sans-serif;
font-size: 13px;
line-height: 1.35;
margin: 0;
}
#modules {
position: absolute;
top: 0; left: 0; bottom: 0; width: 25vw;
overflow: auto;
padding: 20px;
}
#contents {
position: absolute;
top: 0; left: 30vw; bottom: 0; right: 0;
overflow: auto;
padding: 20px;
}
</style>
</head>
<body>

<div id="docapp">
<div id="modules">
<div v-for="m in modules">
<h4>{{ m[0] }}</h4>
<div v-for="c in m[1]" v-on:click="loadClass( m[0], c )">{{ c }}</div>
</div>
</div>
<div id="contents">
<h1>{{ contents.name }}</h1>
<h3>Methods</h3>
<div v-for="m in contents.methods">
<h4>{{ m.name }}</h4>
<div>
<div v-for="s in m.signatures">
<div>{{ s.comment }}</div>
<div v-for="p in s.parameters">
{{ p.name }} ({{ p.type}}) : {{ p.comment }}
</div>
</div>
</div>
</div>
</div>
</div>

<script type="text/javascript" src="./js/doc.js"></script>
</body>
</html>
58 changes: 58 additions & 0 deletions docsn/js/doc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
var app = new Vue({
el: '#docapp',
data: {
message: 'Hello Vue!',
modules: [],
contents: { name: "...", methods: [{name: "test"}]}
},
methods: {
test: function( m ) {
this.message = m;
},
loadClass: function( mod, cls ) {
loadContents( mod+"_"+cls );
}
}
})



function loadJSON( url, callback ) {
var request = new XMLHttpRequest();
request.open('GET', url, true);

request.onload = function() {
if (request.status >= 200 && request.status < 400) {
callback( JSON.parse(request.responseText), "success" );
} else {
callback( false, "server error" );
}
};

request.onerror = function() {
callback( false, "connection error" );
};

request.send();
}


loadJSON( "./json/modules.json", (data, status) => {
let ms = [];
for (var k in data) {
let m = [ k ];
m.push( data[k] );
ms.push( m );
}

console.log( ms );
app.modules = ms;
});

function loadContents( id ) {
console.log( id );
loadJSON( `./json/${id}.json`, (data, status) => {
app.contents.name = data.name;
app.contents.methods = data.methods;
});
}
Loading

0 comments on commit 66f7161

Please sign in to comment.