Skip to content

Commit

Permalink
generate output
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitskvmdam committed Nov 7, 2023
1 parent c83ddb5 commit 977e286
Show file tree
Hide file tree
Showing 44 changed files with 178 additions and 107 deletions.
7 changes: 5 additions & 2 deletions demo/src/assets/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.test {
test-property: 'completed'
iframe {
border: 0;
height: 700px;
width: 100%;
background: white;
}
14 changes: 14 additions & 0 deletions demo/src/tutorials/AgentArray.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AgentArray</title>
</head>
<body>
<article>
This is agent array tutorial
<div></div>
</article>
</body>
</html>
4 changes: 2 additions & 2 deletions output/v4/AgentArray.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Alive.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Alive.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Apple.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Apple.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Database.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/Energy.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Energy.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/Environment.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Environment.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/HideConstructor.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Modules.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/NamespaceWithAlias.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Statement.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/StatementIterator.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/Test.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Tree.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/Tree.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/World.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/World.js.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
function runSomeScript() {
if (!window.location.pathname.toLocaleLowerCase().includes("agent")) {
/**
* If pathname doesn't include agent then we are not running this script.
* We can add any custom logic
*/
return
}

console.log('%c AgentScript', 'font-weight: bold; font-size: 50px;color: red; text-shadow: 3px 3px 0 rgb(217,31,38) , 6px 6px 0 rgb(226,91,14) , 9px 9px 0 rgb(245,221,8) , 12px 12px 0 rgb(5,148,68) , 15px 15px 0 rgb(2,135,206) , 18px 18px 0 rgb(4,77,145) , 21px 21px 0 rgb(42,21,113)');
}

runSomeScript()


function addLiveCodeExampleForAgentArrayPage() {
if (!window.location.pathname.toLocaleLowerCase().includes("agentarray.html")) {
return
}

const containerElement = document.querySelector('body article div')
const liveCodeContainer = document.createElement('div')

Expand Down
6 changes: 3 additions & 3 deletions output/v4/agentscript.js.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions output/v4/api.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/global.html

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions output/v4/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/module-SqlJs.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/module-bookshelf.Book.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/module-bookshelf.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/module-color_mixer-Colour.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/module-color_mixer.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/obj.map.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/pieOptions.html

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions output/v4/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.test {
test-property: 'completed'
iframe {
border: 0;
height: 700px;
width: 100%;
background: white;
}
3 changes: 3 additions & 0 deletions output/v4/tutorial-AgentArray_.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/tutorial-Alive_.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/tutorial-Apple_.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/tutorial-Environment_.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions output/v4/tutorial-Other.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tmpl/container.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,5 @@
<?js } ?>

<?js }); ?>

<?js= self.partial('include-target-script-and-styles.tmpl', arguments[0].filename) ?>
39 changes: 39 additions & 0 deletions tmpl/include-target-script-and-styles.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?js

const filename = obj.replace('.html', '')
const scripts = []
const styles = []


for (const script of this.includeScript) {
if(typeof script === 'object') {
for (const target of script.targets) {
if(filename === target) {
scripts.push(script.filepath)
}
}
}
}

for (const style of this.includeCss) {
if(typeof style === 'object') {
for (const target of style.targets) {
if(filename === target) {
styles.push(style.filepath)
}
}
}
}


?>

<?js scripts.forEach(function(source){ ?>
<script src="<?js= source ?>"></script>
<?js }) ?>

<?js styles.forEach(function(source){ ?>
<script>
document.head.innerHTML += '<link type="text/css" rel="stylesheet" href="<?js= source ?>">'
</script>
<?js }) ?>
8 changes: 6 additions & 2 deletions tmpl/layout.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@
<!-- Adding scripts-->
<?js if(this.includeScript != undefined) { ?>
<?js this.includeScript.forEach(function(source){ ?>
<script src="<?js= source ?>"></script>
<?js if(typeof source === 'string') { ?>
<script src="<?js= source ?>"></script>
<?js } ?>
<?js }) ?>
<?js } ?>

<!-- Adding style-->
<?js if(this.includeCss != undefined) { ?>
<?js this.includeCss.forEach(function(source){ ?>
<link type="text/css" rel="stylesheet" href="<?js= source ?>">
<?js if(typeof source === 'string') { ?>
<link type="text/css" rel="stylesheet" href="<?js= source ?>">
<?js } ?>
<?js }) ?>
<?js } ?>

Expand Down
5 changes: 5 additions & 0 deletions tmpl/tutorial.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
</article>

</section>


<?js console.log('Children', filename) ?>
<?js= this.partial('include-target-script-and-styles.tmpl', filename) ?>

0 comments on commit 977e286

Please sign in to comment.