Skip to content

Commit

Permalink
Deploying to gh-pages from @ ac7701e 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
dvd101x committed Jul 21, 2024
1 parent a32fd8c commit 26450ce
Show file tree
Hide file tree
Showing 7 changed files with 874 additions and 868 deletions.
858 changes: 858 additions & 0 deletions assets/index-CJNO_hNG.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/index-Clt42072.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion assets/index-bT4Uvd-k.css

This file was deleted.

857 changes: 0 additions & 857 deletions assets/index-zdBQJ8rn.js

This file was deleted.

1 change: 0 additions & 1 deletion getWorker.js

This file was deleted.

8 changes: 5 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
<link rel="icon" type="image/png" sizes="16x16" href="./assets/favicon-16x16-C1m-SE63.png">
<link rel="manifest" href="./assets/site-BwHFeIBa.webmanifest">
<script src="https://cdn.plot.ly/plotly-2.31.1.min.js" charset="utf-8"></script>
<script type="module" crossorigin src="./assets/index-zdBQJ8rn.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-bT4Uvd-k.css">
<script type="module" crossorigin src="./assets/index-CJNO_hNG.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Clt42072.css">
</head>
<script src="./getWorker.js"></script>
<script>
const mathWorker = new Worker("mathWorker.js", {type: "classic"});
</script>
<body>
<nav class="markdown-body">
<form name="topBar">
Expand Down
16 changes: 10 additions & 6 deletions mathWorker.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
importScripts(
"https://cdnjs.cloudflare.com/ajax/libs/mathjs/13.0.0/math.js",
"https://cdnjs.cloudflare.com/ajax/libs/mathjs/13.0.3/math.js",
"coolprop.js",
"fluidProperties.js",
"molecularMass.js"
)

const parser = math.parser()
const digits = 14

Expand Down Expand Up @@ -98,7 +97,7 @@ function makeDoc(code) {
let output = [];

cells.forEach(
cell => output.push(processOutput(cell.source, cell.cell_type))
cell => output.push(processOutput(cell.source, cell.cell_type, cell.from, cell.to))
)
return output
}
Expand Down Expand Up @@ -258,18 +257,23 @@ function formatObject(obj) {
return objResult
}

function processOutput(content, type) {
function processOutput(content, type, from, to) {
switch (type) {
case "math":
const expressions = getExpressions(content.join('\n'));
const results = expressions.map(expression => {
const result = processExpression(expression)
return { ...expression, ...result }
return {
source: expression.source,
from: expression.from + from,
to: expression.to + from,
...result
}
})
return { type: "math", text: results }
break;
case "md":
return { type: "markdown", text: content.join('\n') }
return { type: "markdown", text: content.join('\n'), from, to }
break;
}
}
Expand Down

0 comments on commit 26450ce

Please sign in to comment.