Skip to content

Commit

Permalink
Allow adding javascript and css links dynamically as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
karelvaculik authored Sep 12, 2023
1 parent f5ba885 commit 13caed2
Show file tree
Hide file tree
Showing 23 changed files with 2,628 additions and 999 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Added `--config-path` CLI option, changed how `pyreball-generate-config` command works and how the config paths are
handled.
- Updated CLI arguments and config parameters for tables and figures.
- Updated template files.
- Updated to newer versions of 3rd party dependencies for example.
- Created documentation at readthedocs.

Expand Down
88 changes: 52 additions & 36 deletions docs/configuration.md

Large diffs are not rendered by default.

122 changes: 18 additions & 104 deletions examples/custom_arguments.html
Original file line number Diff line number Diff line change
@@ -1,102 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title class="custom_pyreball_title">Custom Arguments</title>
<meta charset="UTF-16">
<script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-3.2.2.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.2.2.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.2.2.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.2.2.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-3.2.2.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/python.min.js"></script>
<script>hljs.highlightAll();</script>
<script>

function change_expand(button, table_id){
var table = document.getElementById(table_id);
if (table.classList.contains("expanded")) {
// collapse the table
table.style.maxHeight = "390px";
button.innerHTML = "⟱";
} else {
// expand the table
table.style.maxHeight = "none";
button.innerHTML = "⟰";
}
table.classList.toggle("expanded");
}



window.onload = function() {
//dom not only ready, but everything is loaded
scrollers = document.getElementsByClassName("table-scroller");

for (i = 0; i < scrollers.length; i++) {
if (scrollers[i].scrollHeight == scrollers[i].clientHeight) {
// hide the expand button
expander_id = scrollers[i].id.replace('scroller', 'expander');
expander = document.getElementById(expander_id);
expander.style.display = "none";
}
}

};


function next(div_id, button_next_id, button_prev_id) {
var qElems = document.querySelectorAll(div_id + '>div');
for (var i = 0; i < qElems.length; i++) {
if (qElems[i].style.display != 'none') {
qElems[i].style.display = 'none';
qElems[i + 1].style.display = 'block';
if (i == qElems.length - 2) {
document.getElementById(button_next_id).disabled = true;
}
document.getElementById(button_prev_id).disabled = false;
break;
}
}
}

function previous(div_id, button_next_id, button_prev_id) {
var qElems = document.querySelectorAll(div_id + '>div');
for (var i = 0; i < qElems.length; i++) {
if (qElems[i].style.display != 'none') {
qElems[i].style.display = 'none';
qElems[i - 1].style.display = 'block';
if (i == 1) {
document.getElementById(button_prev_id).disabled = true;
}
document.getElementById(button_next_id).disabled = false;
break;
}
}
}


</script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}

.main_container {
.pyreball-main-container {
width: 80%;
margin-left: auto;
margin-right: auto;
}

.image-wrapper {
.pyreball-image-wrapper {
margin-left: auto;
margin-right: auto;
margin-top: 20px;
Expand All @@ -109,44 +28,40 @@
display: block;
}

.text-centered {
.pyreball-text-centered {
text-align: center;
}

.table-wrapper
.pyreball-table-wrapper
{
width: 100%;
margin-top: 30px;
margin-bottom: 30px;
}

.table-fit-content {
.pyreball-table-fit-content {
width: fit-content;
max-width: 100%;
margin-top: 10px;
margin-bottom: 10px;
}

.centered {
.pyreball-centered {
margin-left:auto;
margin-right:auto;
}

.left-aligned {
.pyreball-left-aligned {
margin-left:0px;
margin-right:auto;
}

.right-aligned {
.pyreball-right-aligned {
margin-left:auto;
margin-right:0px;
}

.dataframe caption {
font-weight: bold;
}

a.anchor-link:link {
a.pyreball-anchor-link:link {
text-decoration: none;
padding: 0px 20px;
opacity: 0;
Expand All @@ -159,20 +74,19 @@
color: #001f3f
}


h1:hover .anchor-link,
h2:hover .anchor-link,
h3:hover .anchor-link,
h4:hover .anchor-link,
h5:hover .anchor-link,
h6:hover .anchor-link {
h1:hover .pyreball-anchor-link,
h2:hover .pyreball-anchor-link,
h3:hover .pyreball-anchor-link,
h4:hover .pyreball-anchor-link,
h5:hover .pyreball-anchor-link,
h6:hover .pyreball-anchor-link {
opacity: 1;
}
</style>
</head>
<body>
<div class="main_container">
<h1 id="toc_generated_0">Custom Arguments<a class="anchor-link" href="#toc_generated_0"></a></h1>
<div class="pyreball-main-container">
<h1 id="toc_generated_0">Custom Arguments<a class="pyreball-anchor-link" href="#toc_generated_0"></a></h1>
</div>
</body>
<script>
Expand Down
Loading

0 comments on commit 13caed2

Please sign in to comment.