Skip to content

Commit

Permalink
use:highlight_matches action to highlight matching text when using se…
Browse files Browse the repository at this point in the history
…arch <input>

auto-update readme when launching dev server
rename assets/(transformations->thermo-ensemble-trafos)
  • Loading branch information
janosh committed Jan 28, 2024
1 parent 6ef9249 commit 2f00b84
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 15 deletions.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: Transformations
title: Thermodynamic Ensemble transforms
tags:
- physics
- thermodynamics
Expand Down
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ Have a TikZ image you'd like to share? [Submit a PR](https://github.com/janosh/t
| ![`single-head-attention.png`](assets/single-head-attention/single-head-attention.png) | ![`skip-connection.png`](assets/skip-connection/skip-connection.png) |
| [`spontaneous-magnetization`](https://janosh.github.io/tikz/spontaneous-magnetization) | [`tanh`](https://janosh.github.io/tikz/tanh) |
| ![`spontaneous-magnetization.png`](assets/spontaneous-magnetization/spontaneous-magnetization.png) | ![`tanh.png`](assets/tanh/tanh.png) |
| [`theory-space`](https://janosh.github.io/tikz/theory-space) | [`thomson-scattering`](https://janosh.github.io/tikz/thomson-scattering) |
| ![`theory-space.png`](assets/theory-space/theory-space.png) | ![`thomson-scattering.png`](assets/thomson-scattering/thomson-scattering.png) |
| [`tori`](https://janosh.github.io/tikz/tori) | [`torus-fundamental-domain`](https://janosh.github.io/tikz/torus-fundamental-domain) |
| ![`tori.png`](assets/tori/tori.png) | ![`torus-fundamental-domain.png`](assets/torus-fundamental-domain/torus-fundamental-domain.png) |
| [`torus`](https://janosh.github.io/tikz/torus) | [`transformations`](https://janosh.github.io/tikz/transformations) |
| ![`torus.png`](assets/torus/torus.png) | ![`transformations.png`](assets/transformations/transformations.png) |
| [`theory-space`](https://janosh.github.io/tikz/theory-space) | [`thermo-ensemble-trafos`](https://janosh.github.io/tikz/thermo-ensemble-trafos) |
| ![`theory-space.png`](assets/theory-space/theory-space.png) | ![`thermo-ensemble-trafos.png`](assets/thermo-ensemble-trafos/thermo-ensemble-trafos.png) |
| [`thomson-scattering`](https://janosh.github.io/tikz/thomson-scattering) | [`tori`](https://janosh.github.io/tikz/tori) |
| ![`thomson-scattering.png`](assets/thomson-scattering/thomson-scattering.png) | ![`tori.png`](assets/tori/tori.png) |
| [`torus-fundamental-domain`](https://janosh.github.io/tikz/torus-fundamental-domain) | [`torus`](https://janosh.github.io/tikz/torus) |
| ![`torus-fundamental-domain.png`](assets/torus-fundamental-domain/torus-fundamental-domain.png) | ![`torus.png`](assets/torus/torus.png) |
| [`two-point-no-cutoff`](https://janosh.github.io/tikz/two-point-no-cutoff) | [`two-point`](https://janosh.github.io/tikz/two-point) |
| ![`two-point-no-cutoff.png`](assets/two-point-no-cutoff/two-point-no-cutoff.png) | ![`two-point.png`](assets/two-point/two-point.png) |
| [`unregularized-propagator-diagrams`](https://janosh.github.io/tikz/unregularized-propagator-diagrams) | [`vae`](https://janosh.github.io/tikz/vae) |
Expand All @@ -148,7 +148,7 @@ To run the scripts requires the following dependencies:
- [`pdf-compressor`](https://github.com/janosh/pdf-compressor) (`pip install pdf-compressor`)
- [`gs` (GhostScript)](https://ghostscript.com) (optional, worse compression but needs no API key so less setup than `pdf-compressor`)
- [`pdf2svg`](https://github.com/dawbarton/pdf2svg) (`brew install pdf2svg`)
- [`convert`](https://linux.die.net/man/1/convert) (part of [ImageMagick](https://imagemagick.org/script))
- `convert` (part of [ImageMagick](https://imagemagick.org/script))
- [`pngquant`](https://github.com/kornelski/pngquant) (`brew install pngquant`)
- [`zopflipng`](https://github.com/google/zopfli) (`brew install zopfli`)

Expand Down
10 changes: 5 additions & 5 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"devDependencies": {
"@iconify/svelte": "^3.1.6",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.4.1",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@sveltejs/kit": "^2.5.0",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@types/js-yaml": "^4.0.9",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
"eslint-plugin-svelte": "^2.35.1",
"highlight.js": "^11.9.0",
Expand All @@ -39,7 +39,7 @@
"svelte-check": "^3.6.3",
"svelte-multiselect": "^10.2.0",
"svelte-preprocess": "^5.1.3",
"svelte-zoo": "^0.4.9",
"svelte-zoo": "^0.4.10",
"svelte2tsx": "^0.7.0",
"typescript": "5.3.3",
"unified": "^11.0.4",
Expand Down
5 changes: 5 additions & 0 deletions site/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ button.link {
cursor: pointer;
padding: 0;
}

::highlight(highlight-match) {
color: mediumaquamarine;
text-decoration: underline;
}
8 changes: 6 additions & 2 deletions site/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { homepage, repository } from '$root/package.json'
import Icon from '@iconify/svelte'
import MultiSelect from 'svelte-multiselect'
import { RadioButtons } from 'svelte-zoo'
import { RadioButtons, highlight_matches } from 'svelte-zoo'
let innerWidth: number
$: cols = clamp(Math.floor(innerWidth / 300), 1, 6)
Expand Down Expand Up @@ -131,7 +131,11 @@
{/if}

{#if cols || building}
<ul style:column-count={cols} style="column-gap: 1em;">
<ul
style:column-count={cols}
style="column-gap: 1em;"
use:highlight_matches={{ query: $search, css_class: `highlight-match` }}
>
{#each $filtered_figs as item, idx (item.slug)}
<li class:active={active_idx == idx}>
<Card {item} style="break-inside: avoid;" />
Expand Down
8 changes: 8 additions & 0 deletions site/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { YamlMetadata } from '$lib'
import { sveltekit } from '@sveltejs/kit/vite'
import { exec } from 'child_process'
import * as fs from 'fs'
import image_dims from 'image-size'
import * as yaml from 'js-yaml'
Expand Down Expand Up @@ -61,3 +62,10 @@ fs.writeFileSync(
`src/lib/tikz-figures.json`,
JSON.stringify(tikz_figures, null, 2),
)

exec(
`python ../scripts/update-readme-table.py`,
(err: string, _stdout: string, _stderr: string) => {
if (err) console.error(err)
},
)

0 comments on commit 2f00b84

Please sign in to comment.