Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sano-jin committed Jul 13, 2024
1 parent f7c868b commit 69360ba
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A JavaScript engine to render bussproofs style proof tree in html.

![](./nvim-preview.gif)
![](./demo/nvim-preview.gif)

## Preliminary

Expand Down Expand Up @@ -30,7 +30,7 @@ You can use this engine by adding a script tag as follows:
```

- html source: [demo/sample.html](./demo/sample.html)
- deployed page: https://sano-jin.github.io/busproofs-html/sample.html
- deployed page: https://sano-jin.github.io/busproofs-html/demo/sample.html

> [!NOTE]
> CSS class names starting from `bussproofs-html__` are reserved.
Expand All @@ -56,7 +56,7 @@ you can use the previewer as follows:
},
```

![](./nvim-preview.gif)
![](./demo/nvim-preview.gif)

### Marp

Expand Down
File renamed without changes
File renamed without changes
Binary file added docs/demo/marp-sample-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/demo/marp-sample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
marp: true
math: katex
paginate: true
footer: https://github.com/sano-jin/busproofs-html
---

# Integration with Marp is easy!

Here comes a proof tree:
\begin{prooftree}
\AXC{$1 + 2$}
\AXC{$1 + 2 + 3$}
\BIC{$1 + 2$}
\AXC{$1 + 2 + 3$}
\RightLabel{Label}
\BIC{$1 + 2 + 3 + 4$}
\end{prooftree}

---

# Here is the code for the previous page.

```md
# Integration with Marp is easy!

Here comes a proof tree:
\begin{prooftree}
\AXC{$1 + 2$}
\AXC{$1 + 2 + 3$}
\BIC{$1 + 2$}
\AXC{$1 + 2 + 3$}
\RightLabel{Label}
\BIC{$1 + 2 + 3 + 4$}
\end{prooftree}

<script type="module">
import { renderProofTreesOnLoad } from "https://sano-jin.github.io/busproofs-html/assets/prooftree.js";
renderProofTreesOnLoad();
</script>
```

<script type="module">
import { renderProofTreesOnLoad } from "https://sano-jin.github.io/busproofs-html/assets/prooftree.js";
renderProofTreesOnLoad();
</script>
Binary file added docs/demo/marp-sample.pdf
Binary file not shown.
File renamed without changes
Binary file added docs/demo/nvim-preview.mp4
Binary file not shown.
6 changes: 2 additions & 4 deletions docs/sample.html → docs/demo/sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ <h1>Proof Tree Rendering in HTML</h1>
</p>

<script type="module">
import {renderProofTrees} from "https://sano-jin.github.io/busproofs-html/assets/prooftree.js";
window.addEventListener("load", function () {
renderProofTrees();
});
import {renderProofTreesOnLoad} from "https://sano-jin.github.io/busproofs-html/assets/prooftree.js";
renderProofTreesOnLoad();
</script>
</body>

Expand Down
28 changes: 28 additions & 0 deletions docs/demo/sample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Bussproofs Rendering

Testing an integration with
neovim-markdown-preview:

- **first** element.
- second element.

Here comes a proof tree:

\begin{prooftree}
\AXC{$1 + 2 + 3 + 4 + 5$}
\RightLabel{Label 7}
\UIC{$1 + a$}
\RightLabel{Label 6}
\UIC{$1 + 2 + 3$}
\AXC{$1 + 2$}
\RightLabel{Long Label 2}
\UIC{$1 + 2 + 3$}
\RightLabel{Label 3}
\BIC{$1 + 2$}
\AXC{$1 + 2$}
\RightLabel{Label 4}
\BIC{$1 + 2 + 3 + 4 + 5$}
\end{prooftree}
iage
aiaiaia
jiage
39 changes: 22 additions & 17 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# bussproofs-html

A JavaScript engine to render bussproofs style proof tree in html.

github: [sano-jin/busproofs-html](https://github.com/sano-jin/busproofs-html)

![](./nvim-preview.gif)
# bussproofs-html

A JavaScript engine to render bussproofs style proof tree in html.

![](./demo/nvim-preview.gif)

## Preliminary

- Only `\RightLabel` can be used for a label for now.
- Only proof trees directly under `p` elements are rendered.
- Only `\RightLabel` can be used for a label for now.
- Only `\AXC`, `\UIC`, `\BIC`, `\TIC`, and `\QuaternaryInfC` are allowed
as a constcutor of the node of a proof tree.
No other LaTeX commands are allowed.
- `\normalsize`, `\small`, `\footnotesize`, `\scriptsize`, and `\tiny`
are ignored.
- No other LaTeX commands are allowed.

Send me PRs if you enable others.

Expand All @@ -24,15 +28,16 @@ You can use this engine by adding a script tag as follows:

```html
<script type="module">
import { renderProofTrees } from "https://sano-jin.github.io/busproofs-html/assets/prooftree.js";
window.addEventListener("load", function () {
renderProofTrees();
});
import { renderProofTreesOnLoad } from "https://sano-jin.github.io/busproofs-html/assets/prooftree.js";
renderProofTreesOnLoad();
</script>
```

- html source: [demo/sample.html](https://github.com/sano-jin/busproofs-html/tree/master/demo/sample.html)
- deployed page: https://sano-jin.github.io/busproofs-html/sample.html
- html source: [demo/sample.html](./demo/sample.html)
- deployed page: https://sano-jin.github.io/busproofs-html/demo/sample.html

> [!NOTE]
> CSS class names starting from `bussproofs-html__` are reserved.
### markdown-preview.nvim

Expand All @@ -55,7 +60,7 @@ you can use the previewer as follows:
},
```

![](./nvim-preview.gif)
![](./demo/nvim-preview.gif)

### Marp

Expand All @@ -82,15 +87,15 @@ Here comes a proof tree:
\end{prooftree}

<script type="module">
import { renderProofTrees } from "https://sano-jin.github.io/busproofs-html/assets/prooftree.js";
window.addEventListener('load', function() { renderProofTrees() });
import { renderProofTreesOnLoad } from "https://sano-jin.github.io/busproofs-html/assets/prooftree.js";
renderProofTreesOnLoad();
</script>
```

![](./marp-sample-0.png)
![](./demo/marp-sample-0.png)

- markdown: [marp-sample.md](https://github.com/sano-jin/busproofs-html/tree/master/demo/marp-sample.md)
- output pdf: [demo/marp-sample.pdf](https://github.com/sano-jin/busproofs-html/tree/master/demo/marp-sample.pdf)
- markdown: [demo/marp-sample.md](./demo/marp-sample.md)
- output pdf: [demo/marp-sample.pdf](./demo/marp-sample.pdf)

### VSCode

Expand Down
Binary file removed docs/marp-sample.png
Binary file not shown.

0 comments on commit 69360ba

Please sign in to comment.