view mrjunejune/README.md @ 246:4f2b50bc78e7

[tools] Fix LaTeX editor visibility Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Mon, 03 Aug 2026 18:30:45 -0700
parents b8aa08503378
children 70f2a3dafc1c
line wrap: on
line source

# Mrjunejune

My personal website where I post my blogs / about me and resume.

## WebP assets

Raster source images live under `mrjunejune/assets/png/` and `assets/png/`.
Bazel converts them to WebP before they enter the server runfiles or release
bundle:

```bash
bazel build //mrjunejune:generated_webp_assets
bazel build //mrjunejune:mrjunejune_server_bundle
```

The deployed site contains no PNG files. Add new PNG source assets to the
corresponding list in `mrjunejune/BUILD` or `assets/BUILD`, then reference the
generated `.webp` URL from the site.

## HLS player

`/tools/hls_player` is a dependency-free JavaScript HLS player. It uses native
HLS where available and a MediaSource fallback for unencrypted VOD playlists
with fragmented MP4 segments. A VP9/Opus HLS sample is bundled at:

```text
/public/hls-sample/master.m3u8
```

The sample is generated from `mrjunejune/assets/video/sample_hls.mp4` through
the restored FFmpeg CLI wrapper:

```bash
bazel run //mrjunejune:generate_hls_sample
```

```bash
bazel test //mrjunejune/test:hls_player_test
bazel test //mrjunejune/test:theme_and_webp_test
```

## LaTeX editor

`/tools/latex_editor` sends source to the C server, which compiles it with the
host's `/usr/bin/pdflatex` and returns the PDF directly to the browser. Install
TeX Live on production hosts before deploying:

```bash
sudo apt-get install texlive-latex-base texlive-latex-recommended
```

The compiler child uses restricted TeX file access, Linux Landlock, a seccomp
network filter, and CPU, memory, file-size, process, and wall-clock limits.
Compilation fails closed when the Linux sandbox cannot be applied.

```bash
bazel test //mrjunejune/test:latex_renderer_test
bazel test //mrjunejune/test:latex_editor_test
```

## TODO 

- Add caching layer
- Update talk to be part
- Update test to automatically tests all paths for blogs.