Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
WGUNDERWOOD committed Jan 12, 2025
2 parents dce3d02 + daaee40 commit a7651a4
Show file tree
Hide file tree
Showing 24 changed files with 444 additions and 89 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,49 @@ jobs:
- run: cargo install cross
- name: Build
run: cross build --target ${{ matrix.target }}
wasm:
name: Cargo wasm build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: jetli/wasm-bindgen-action@v0.2.0
with:
version: '0.2.95'
- name: Build wasm
run: cargo build -r --lib --target wasm32-unknown-unknown
- name: Bind wasm
run: |
wasm-bindgen --target web --out-dir web/pkg \
target/wasm32-unknown-unknown/release/tex_fmt.wasm
- name: Optimize wasm
uses: NiklasEi/wasm-opt-action@v2
with:
options: -Oz
file: web/pkg/tex_fmt_bg.wasm
output: web/pkg/tex_fmt_bg.wasm
- name: Upload wasm
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
path: "web/pkg"
pages:
if: github.ref == 'refs/heads/main'
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: wasm
steps:
- uses: actions/checkout@v3
- name: Download WASM and JS artifacts
uses: actions/download-artifact@v3
- run: mkdir -p web/pkg && mv pkg/* web/pkg/ && rmdir pkg
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: web
nix:
name: Nix build
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
**/*.rs.bk
*.pdb
/result
*.html
*.log
flamegraph.svg
perf.data*
Expand Down
127 changes: 108 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ clap_mangen = "0.2.24"
colored = "2.2.0"
dirs = "5.0.1"
env_logger = "0.11.6"
js-sys = "0.3.72"
lazy_static = "1.5.0"
log = "0.4.22"
merge = "0.1.0"
regex = "1.11.1"
similar = "2.6.0"
toml = "0.8.19"
wasm-bindgen = "0.2.95"
web-time = "1.1.0"

[features]
shellinstall = []
Expand All @@ -34,3 +37,12 @@ clap_mangen = "0.2.24"

[profile.release]
codegen-units = 1

[lib]
name = "tex_fmt"
path = "src/lib.rs"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "tex-fmt"
path = "src/bin.rs"
6 changes: 5 additions & 1 deletion completion/tex-fmt.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
complete -c tex-fmt -s l -l wraplen -d 'Line length for wrapping [default: 80]' -r
complete -c tex-fmt -s t -l tabsize -d 'Number of characters to use as tab size [default: 2]' -r
complete -c tex-fmt -l config -d 'Path to configuration file' -r -F
complete -c tex-fmt -l completion -d 'Generate shell completion script' -r -f -a "{bash\t'',elvish\t'',fish\t'',powershell\t'',zsh\t''}"
complete -c tex-fmt -l completion -d 'Generate shell completion script' -r -f -a "bash\t''
elvish\t''
fish\t''
powershell\t''
zsh\t''"
complete -c tex-fmt -s c -l check -d 'Check formatting, do not modify files'
complete -c tex-fmt -s p -l print -d 'Print to stdout, do not modify files'
complete -c tex-fmt -s n -l nowrap -d 'Do not wrap long lines'
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
description = "LaTeX formatter written in Rust";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
Expand Down
Loading

0 comments on commit a7651a4

Please sign in to comment.