Commit graph

32 commits

Author SHA1 Message Date
Fuad Hasan
710cfe520b
refactor: replace ioutil with os and io packages for file operations 2025-02-04 20:24:55 +06:00
Alexander Wang
4989a95906
do not run imgbundler unnecessarily 2024-05-23 13:20:06 -06:00
Alexander Wang
15b4717323
cli: resolve local icon paths relative to d2 file 2024-04-25 21:27:15 -06:00
Gavin Nishizawa
32fbe7e4a8
create simplelog Logger interface 2023-10-19 17:44:39 -07:00
Gavin Nishizawa
eba687fbbe
don't use xmain.State in imgbundler library 2023-10-19 16:06:12 -07:00
Alexander Wang
df7d6536e9
flag 2023-06-06 11:09:19 -07:00
Alexander Wang
b37b5571e1
logs 2023-06-06 10:56:44 -07:00
Alexander Wang
c40dc7ec34
img optimizations 2023-06-06 10:43:52 -07:00
Alexander Wang
0314a74eab
unescape img hrefs 2023-01-14 14:20:08 -08:00
Anmol Sethi
b72959a91f
fmt 2022-12-07 23:22:20 -08:00
Anmol Sethi
d116889fc9
Switch fully to util-go 2022-12-01 11:48:49 -08:00
Anmol Sethi
07e316fac5
xmain: rm -rf 2022-12-01 11:48:49 -08:00
Anmol Sethi
1d2ea2bb87
imgbundler: Use time.Ticker instead 2022-11-30 14:58:52 -08:00
Anmol Sethi
e3104688a6
pr278: Review fixes 2022-11-30 14:58:52 -08:00
Anmol Sethi
fd0eba997d
imgbundler: Split bundle into three functions 2022-11-30 14:58:52 -08:00
Anmol Sethi
b8b269db0c
imgbundler: Improve mime type detection
The order of priority in detecting the mime type is now:
- Content-Type response header
- File path extension
- http.DetectContentType
2022-11-30 14:58:52 -08:00
Anmol Sethi
0edf30a6cd
imgbundler: Fixes
- Make bundle flag work
- Display error and update render at the same time in watch mode.
  Before we would just display the render and not show the error.

- Rename imgbundler.InlineX functions to BundleX
- Print imgbundler fetch/readFile errors as they happen in the workers
  instead of coalescing and printing at the end.
- Minor performance improvements by using []byte everywhere possible.
- Improved symbol naming in imgbundler code
- **major**: Ignore already bundled images instead of trying to os.ReadFile them.
2022-11-30 14:58:52 -08:00
Alexander Wang
7cbcd88f9c
2022-11-29 05:01:15PM 2022-11-29 17:01:15 -08:00
Alexander Wang
66b6c7de56
2022-11-29 02:20:17PM 2022-11-29 14:20:17 -08:00
Alexander Wang
983b05bd9c
2022-11-29 01:50:48PM 2022-11-29 13:50:48 -08:00
Alexander Wang
fe75e7067b
2022-11-29 01:30:22PM 2022-11-29 13:30:22 -08:00
Alexander Wang
10e13c3716
fixes 2022-11-29 13:19:03 -08:00
Alexander Wang
d7fb9c16b8
2022-11-29 12:54:30PM 2022-11-29 12:54:30 -08:00
Anmol Sethi
d31ed1d3ac
imgbundler: Fixes
- Correct concurrency
- Return multierr
- Use []byte wherever possible
- Add semaphore to limit number of workers
- Separate timeout for each fetch
2022-11-29 11:40:53 -08:00
Alexander Wang
7368d15186
typo 2022-11-29 11:15:57 -08:00
Alexander Wang
6c921c9c22
bytes 2022-11-29 11:01:51 -08:00
Alexander Wang
97f7679797
2022-11-29 10:37:57AM 2022-11-29 10:37:57 -08:00
Alexander Wang
ff02459402
no passing respChan 2022-11-29 10:20:32 -08:00
Alexander Wang
9259079d61
small fry 2022-11-29 08:40:05 -08:00
Alexander Wang
9ad44bdec0
2022-11-28 01:25:40PM 2022-11-28 13:25:40 -08:00
Alexander Wang
bd8a389f95
2022-11-26 06:14:41PM 2022-11-26 18:14:41 -08:00
Alexander Wang
d328b23fb6
2022-11-26 03:26:14PM 2022-11-26 15:26:14 -08:00