Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .nojekyll
Empty file.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@

[![CI](https://github.com/NLESC-JCER/cpp2wasm/workflows/CI/badge.svg)](https://github.com/NLESC-JCER/cpp2wasm/actions?query=workflow%3ACI)

Document describing a way that a researcher with a C++ algorithm can make it available as a web application. We will host the C++ algorithm as an web application in several different ways:
Document describing a way that a researcher with a C++ algorithm can make it available as a web application. We will host the C++ algorithm as an web application in several different ways:

* as a cgi script
* as a Python application via pybind11, Flask and Celery
* in the web browser using web assembly and JavaScript
- as a cgi script
- as a Python application via pybind11, Flask and Celery
- in the web browser using web assembly and JavaScript

We assume the operating system is Linux (We used Linux while writing this guide).

The [Newton-Raphson root finding algorithm](https://en.wikipedia.org/wiki/Newton%27s_method) will be the use case.
The code we are using came from [geeksforgeeks.org](https://www.geeksforgeeks.org/program-for-newton-raphson-method/).

The interface would like

Expand Down
54 changes: 54 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Guide to make C++ available as a web application
</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'Guide to make C++ available as a web application',
repo: 'NLESC-JCER/cpp2wasm',
themeColor: '#009FE3',
noEmoji: true,

markdown: {
renderer: {
// Overwrite code renderer to support entangled info string format
// https://github.com/docsifyjs/docsify/blob/master/src/core/render/compiler/code.js
code: function(code, lang = '') {
const info = lang;
if (lang.startsWith('{')) {
// for example '{.cpp file=src/newtonraphson.hpp}' to 'cpp'
lang = info.replace('{','').replace('}','').split(' ').find((d) => d.startsWith('.')).replace('.','');
}
const langOrMarkup = Prism.languages[lang] || Prism.languages.markup;
const text = Prism.highlight(
code.replace(/@DOCSIFY_QM@/g, '`'),
langOrMarkup
);

return `<pre v-pre data-lang="${info}"><code class="lang-${lang}">${text}</code></pre>`;
}
}
}
}
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/ga.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-python.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-c.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-cpp.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-json.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-javascript.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-yaml.min.js"></script>
</body>
</html>