Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy committed Oct 24, 2024
1 parent b2565e4 commit b87963e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.svg linguist-generated
*.html linguist-generated
*.js linguist-generated
30 changes: 30 additions & 0 deletions assets/changelog/0.2.12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## css minify

[support minify](https://github.com/ahaoboy/ansi2/pull/11): Merge text with the same attributes to reduce the number of elements
[support css minify](https://github.com/ahaoboy/ansi2/pull/14): Compress CSS class names

Through this two optimization methods, the size has been reduced to about one-fifth.


```
-rw-r--r-- 1 ace None 89K Oct 23 17:04 vitest.svg
-rw-r--r-- 1 ace None 8.8K Oct 24 19:37 vitest.html
-rw-r--r-- 1 ace None 25K Oct 24 19:37 vitest.svg
```

## Config

Added two new parameters

### font-size
Customize font size

### length-adjust

Control SVG text rendering


## wasm

Publish the correct .d.ts file to avoid tsc compiling enum incorrectly
13 changes: 11 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ neofetch | ansi2 --format=svg --font=Consolas > neofetch.svg
neofetch | ansi2 --format=svg --font="Courier New" > neofetch.svg
neofetch | ansi2 --format=svg --font="Monaco" > neofetch.svg
neofetch | ansi2 --format=svg --font=https://fonts.cdnfonts.com/s/98875/JetBrainsMonoRegular.woff > neofetch.svg
neofetch | ansi2 --format=svg --font=https://fonts.cdnfonts.com/s/55487/FiraCode-Regular.woff > neofetch.svg
```

### font-size
Expand Down Expand Up @@ -97,10 +98,13 @@ neofetch | ansi2 --format=svg -c > neofetch.svg

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/lengthAdjust

The textLength attribute is added by default and can be removed using an empty string


```bash
neofetch | ansi2 --format=svg --length-adjust=spacing > neofetch.svg
neofetch | ansi2 --format=svg --length-adjust=spacingAndGlyphs > neofetch.svg
neofetch | ansi2 --format=svg --length-adjust="" > neofetch.svg
```

## example
Expand Down Expand Up @@ -130,11 +134,16 @@ ls | table | ansi2 | save nu-ls.svg -f
</a>
</div>


## changelog

- [0.2.12](./assets/changelog/0.2.12.md)

## todo

- [x] link
- [ ] merge characters of the same style to reduce the number of tags
- [x] merge characters of the same style to reduce the number of tags
- [x] vscode extension: [preview-easy](https://github.com/ahaoboy/preview-easy.git)
- [ ] ansi minify
- [ ] html support copy text, continuous text will be separated by line breaks
- [ ] html minify
- [x] html minify

0 comments on commit b87963e

Please sign in to comment.