Skip to content

Commit

Permalink
update demo docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Edison Abahurire committed Jul 22, 2020
1 parent 68a909a commit b304734
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 76 deletions.
27 changes: 16 additions & 11 deletions demo/docs/index.html
Expand Up @@ -94,7 +94,7 @@ <h5 id="space">Documentation generated by <a href="https://pypi.org/project/scro
<script src="./traces_data.js"></script>

<script>
console.log(functions); // this will show the info it in firebug console
// console.log(functions); // this will show the info in firebug console
const sidebar = document.getElementById('sidebar');
functions.forEach(function (item, index) {
// console.log(item, index);
Expand All @@ -109,9 +109,9 @@ <h5 id="space">Documentation generated by <a href="https://pypi.org/project/scro
});

display_func_name = (class_name) => {
console.log(class_name);
// console.log(class_name);
func_trace = traces[class_name];
console.log(func_trace);
// console.log(func_trace);
var args_str = ''
call_args = func_trace['call_args']
for (var item in call_args) {
Expand All @@ -121,24 +121,25 @@ <h5 id="space">Documentation generated by <a href="https://pypi.org/project/scro
var calls_str = ''
func_calls = func_trace['calls']
func_calls.forEach(function (item, index) {
console.log(item)
// console.log(item)
calls_str = calls_str + `<a class='calls' name="${item}" onclick="display_func(this)">${item}()</a><br>`;
console.log(calls_str)
// console.log(calls_str)
});
document.getElementById('func-calls').innerHTML = calls_str;
document.getElementById('arg-types').innerHTML = args_str;
document.getElementById('func').innerHTML = func_trace['function_name'];
document.getElementById('func-caller').innerHTML = func_trace['caller'];
let func_caller = func_trace['caller'];
document.getElementById('func-caller').innerHTML = `<a class='callers' name="${func_caller}" onclick="display_func(this)">${func_caller}()</a><br>`
document.getElementById('func-code').innerHTML = func_trace['docstring'];
document.getElementById('return').innerHTML = func_trace['return_type'];
document.getElementById('file-name').innerHTML = '.' + func_trace['filename'];
};

display_func = (e) => {
let class_name = e.name;
console.log(class_name);
// console.log(class_name);
func_trace = traces[class_name];
console.log(func_trace);
// console.log(func_trace);
var args_str = ''
call_args = func_trace['call_args']
for (var item in call_args) {
Expand All @@ -148,19 +149,23 @@ <h5 id="space">Documentation generated by <a href="https://pypi.org/project/scro
var calls_str = ''
func_calls = func_trace['calls']
func_calls.forEach(function (item, index) {
console.log(item)
// console.log(item)
calls_str = calls_str + `<a class='calls' name='${item}' onclick='display_func(this)'>${item}()</a><br>`;
console.log(calls_str)
// console.log(calls_str)
});
document.getElementById('func-calls').innerHTML = calls_str;
document.getElementById('arg-types').innerHTML = args_str;
document.getElementById('func').innerHTML = func_trace['function_name'];
document.getElementById('func-caller').innerHTML = func_trace['caller'];
let func_caller = func_trace['caller'];
document.getElementById('func-caller').innerHTML = `<a class='callers' name="${func_caller}" onclick="display_func(this)">${func_caller}()</a><br>`
document.getElementById('func-code').innerHTML = func_trace['docstring'];
document.getElementById('return').innerHTML = func_trace['return_type'];
document.getElementById('file-name').innerHTML = '.' + func_trace['filename'];
};

console.log(functions[0])
functions[0]['caller'] = ''
console.log(functions[0])
display_func_name(functions[0]);

</script>
Expand Down
117 changes: 53 additions & 64 deletions demo/docs/scroll.css
Expand Up @@ -5,101 +5,90 @@
*/

#wrapper {
overflow-x: hidden;
}

overflow-x: hidden;
}
#sidebar-wrapper {
min-height: 100vh;
margin-left: -35rem;
-webkit-transition: margin .25s ease-out;
-moz-transition: margin .25s ease-out;
-o-transition: margin .25s ease-out;
transition: margin .25s ease-out;
min-height: 100vh;
margin-left: -35rem;
-webkit-transition: margin .25s ease-out;
-moz-transition: margin .25s ease-out;
-o-transition: margin .25s ease-out;
transition: margin .25s ease-out;
}


.list-group-item {
padding-top: .25rem !important;
padding-bottom: .25rem !important;
padding-top: .25rem !important;
padding-bottom: .25rem !important;
}

#sidebar-wrapper .sidebar-heading {
padding: 0.875rem 1.25rem;
font-size: 1.2rem;
padding: 0.875rem 1.25rem;
font-size: 1.2rem;
}

#sidebar-wrapper .list-group {
width: 15rem;
#sidebar {
overflow: scroll;
height: 100vh;
}

#page-content-wrapper {
min-width: 100vw;
min-width: 100vw;
/* position: fixed; */
position: -webkit-sticky;
position: sticky;
float: left;
}

#wrapper.toggled #sidebar-wrapper {
margin-left: 0;
margin-left: 0;
}

@media (min-width: 768px) {
#sidebar-wrapper {
margin-left: 0;
}

#page-content-wrapper {
min-width: 0;
width: 100%;
}

#wrapper.toggled #sidebar-wrapper {
margin-left: -15rem;
}
#sidebar-wrapper {
margin-left: 0;
}
#page-content-wrapper {
min-width: 0;
width: 100%;
}
#wrapper.toggled #sidebar-wrapper {
margin-left: -15rem;
}
}

#space {
margin-left: auto;
margin-left: auto;
}

.calls {
padding-left: 55px;
color: #007bff !important;
padding-left: 55px;
color: #007bff !important;
}
.callers {
padding-left: 5px;
color: #007bff !important;
}

table {
margin-left: 55px;
margin-left: 55px;
}

.return {
padding-top: 10px;;
padding-top: 10px;
;
}

.args {
margin-bottom: 3px;
font-weight: bold;
margin-bottom: 3px;
font-weight: bold;
}

pre {
margin-bottom: 0 !important;
margin-left: 40px;
margin-bottom: 0 !important;
margin-left: 40px;
}

.container-fluid {
padding-left: 50px !important;
padding-top: 25px;;
padding-left: 50px !important;
padding-top: 25px;
;
}

.func {
font-size: 25px;
font-size: 25px;
}

.func-caller {
font-size: 18px;
font-size: 18px;
}

.to-right {
text-align: right;
text-align: right;
}

.code {
font-weight: normal;
}

font-weight: normal;
}
2 changes: 1 addition & 1 deletion demo/docs/traces_data.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b304734

Please sign in to comment.