Skip to content

Commit

Permalink
- add a screenshot.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unpredictability committed Feb 6, 2025
1 parent 2cb1fbb commit b76b81e
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 137 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# tex2typst-UI
# tex2typst-UI

This is a simple GUI for the [tex2typset-rs](https://github.com/Unpredictability/tex2typst-rs).

See it in action here -> [https://unpredictability.github.io/tex2typst-UI/](https://unpredictability.github.io/tex2typst-UI/).

# Screenshot

![Screenshot](https://raw.githubusercontent.com/Unpredictability/tex2typst-UI/main/screenshot.png)
File renamed without changes
Binary file removed assets/android-chrome-192x192.png
Binary file not shown.
25 changes: 0 additions & 25 deletions assets/sw.js

This file was deleted.

Binary file removed dist/assets/android-chrome-192x192.png
Binary file not shown.
Binary file removed dist/assets/android-chrome-512x512.png
Binary file not shown.
Binary file removed dist/assets/apple-touch-icon.png
Binary file not shown.
Binary file removed dist/assets/favicon-16x16.png
Binary file not shown.
Binary file removed dist/assets/favicon-32x32.png
Binary file not shown.
23 changes: 2 additions & 21 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

<head>
<title>TeX to Typst UI</title>
<title>TeX to Typst Demo</title>

<!-- config for our rust wasm binary. go to https://trunkrs.dev/assets/#rust for more customization -->

Expand All @@ -28,18 +28,9 @@













<link rel="manifest" href="assets/manifest.json">
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#404040">

Expand Down Expand Up @@ -129,7 +120,7 @@
}
}
</style>
<link rel="modulepreload" href="/tex2typst-UI.js" crossorigin="anonymous" integrity="sha384-M/xkVwbG1vRn1qLC4oEe77gG65YJZKKoGlMWMnR1GqpnO1mLa6liysxMVX2Rp57i"><link rel="preload" href="/tex2typst-UI_bg.wasm" crossorigin="anonymous" integrity="sha384-+4mTIZFgR+H3Kj1XK1FtRPME5SPSHdBp2EDFIlgeONsttCPXtmTxvD/hwblTi9B2" as="fetch" type="application/wasm"></head>
<link rel="modulepreload" href="/tex2typst-UI.js" crossorigin="anonymous" integrity="sha384-CDsiIMoR+fmk2MCNOLUqEh/pCjFimTZddyPq6mKYST7FOpmuU+R3IUYtQwBMk2ry"><link rel="preload" href="/tex2typst-UI_bg.wasm" crossorigin="anonymous" integrity="sha384-KwT3ALHks2VRFjdpRms5dYYJT7sQyAqq/8Gs17lHUXdVp3L31Ob4RQxbR4VCsRAO" as="fetch" type="application/wasm"></head>

<body>
<!-- The WASM code will resize the canvas dynamically -->
Expand All @@ -144,16 +135,6 @@
<div class="lds-dual-ring"></div>
</div>

<!--Register Service Worker. this will cache the wasm / js scripts for offline use (for PWA functionality). -->
<!-- Force refresh (Ctrl + F5) to load the latest files instead of cached files -->
<!--<script>-->
<!-- // We disable caching during development so that we always view the latest version.-->
<!-- if ('serviceWorker' in navigator && window.location.hash !== "#dev") {-->
<!-- window.addEventListener('load', function () {-->
<!-- navigator.serviceWorker.register('sw.js');-->
<!-- });-->
<!-- }-->
<!--</script>-->
<script>"use strict";

(function () {
Expand Down
38 changes: 0 additions & 38 deletions dist/manifest.json

This file was deleted.

25 changes: 0 additions & 25 deletions dist/sw.js

This file was deleted.

8 changes: 4 additions & 4 deletions dist/tex2typst-UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -1404,19 +1404,19 @@ function __wbg_get_imports() {
const ret = false;
return ret;
};
imports.wbg.__wbindgen_closure_wrapper4091 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper4092 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 463, __wbg_adapter_30);
return ret;
};
imports.wbg.__wbindgen_closure_wrapper4093 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper4094 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 463, __wbg_adapter_33);
return ret;
};
imports.wbg.__wbindgen_closure_wrapper4095 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper4096 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 463, __wbg_adapter_30);
return ret;
};
imports.wbg.__wbindgen_closure_wrapper4361 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper4362 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 548, __wbg_adapter_38);
return ret;
};
Expand Down
Binary file modified dist/tex2typst-UI_bg.wasm
Binary file not shown.
21 changes: 1 addition & 20 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

<head>
<title>TeX to Typst UI</title>
<title>TeX to Typst Demo</title>

<!-- config for our rust wasm binary. go to https://trunkrs.dev/assets/#rust for more customization -->
<link data-trunk rel="rust" data-wasm-opt="2"/>
Expand All @@ -16,19 +16,10 @@
<link data-trunk rel="icon" href="assets/favicon.ico">


<link data-trunk rel="copy-file" href="assets/sw.js"/>
<link data-trunk rel="copy-file" href="assets/manifest.json"/>
<link data-trunk rel="copy-file" href="assets/android-chrome-192x192.png" data-target-path="assets"/>
<link data-trunk rel="copy-file" href="assets/android-chrome-512x512.png" data-target-path="assets"/>
<link data-trunk rel="copy-file" href="assets/apple-touch-icon.png" data-target-path="assets"/>
<link data-trunk rel="copy-file" href="assets/favicon-16x16.png" data-target-path="assets"/>
<link data-trunk rel="copy-file" href="assets/favicon-32x32.png" data-target-path="assets"/>

<link data-trunk rel="copy-file" href="assets/NotoSansSC-Regular.ttf" data-target-path="assets"/>


<link rel="manifest" href="assets/manifest.json">
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#404040">

Expand Down Expand Up @@ -133,16 +124,6 @@
<div class="lds-dual-ring"></div>
</div>

<!--Register Service Worker. this will cache the wasm / js scripts for offline use (for PWA functionality). -->
<!-- Force refresh (Ctrl + F5) to load the latest files instead of cached files -->
<!--<script>-->
<!-- // We disable caching during development so that we always view the latest version.-->
<!-- if ('serviceWorker' in navigator && window.location.hash !== "#dev") {-->
<!-- window.addEventListener('load', function () {-->
<!-- navigator.serviceWorker.register('sw.js');-->
<!-- });-->
<!-- }-->
<!--</script>-->
</body>

</html>
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ impl eframe::App for App {
});

egui::CentralPanel::default().show(ctx, |ui| {

ui.heading("TeX to Typst Convert Demo");

ui.label("This is a wrapper of tex2typst-rs compiled to WASM, which means it runs natively in your browser.");

ui.separator();

let cols = ui.columns(2, |columns| {
// 左侧
columns[0].push_id("left", |ui| {
Expand Down Expand Up @@ -100,7 +107,7 @@ impl eframe::App for App {
.code_editor()
.desired_width(ui.available_width())
.desired_rows(25)
.layouter(&mut layouter),
.layouter(&mut layouter)
);
});
})
Expand Down Expand Up @@ -137,7 +144,7 @@ impl eframe::App for App {
.code_editor()
.desired_width(ui.available_width())
.desired_rows(25)
.layouter(&mut layouter),
.layouter(&mut layouter)
);
});
})
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() -> eframe::Result {
.with_min_inner_size([300.0, 220.0])
.with_icon(
// NOTE: Adding an icon is optional
eframe::icon_data::from_png_bytes(&include_bytes!("../assets/android-chrome-512x512.png")[..])
eframe::icon_data::from_png_bytes(&include_bytes!("../assets/512x512.png")[..])
.expect("Failed to load icon"),
),
..Default::default()
Expand Down

0 comments on commit b76b81e

Please sign in to comment.