Merge pull request #68 from quaggaone/main
codly-languages: fix layout shifts when using lang-icon
No files matched your search
@@ -10,10 +10,10 @@ Pretty simple. Import `codly`. Initialize it. Import `codly-languages`.
|
||||
Configure `codly` with the languages. Like this:
|
||||
|
||||
```typst
|
||||
#import "@preview/codly:1.2.0": *
|
||||
#import "@preview/codly:1.3.0": *
|
||||
#show: codly-init
|
||||
|
||||
#import "@preview/codly-languages:0.1.8": *
|
||||
#import "@preview/codly-languages:0.1.9": *
|
||||
#codly(languages: codly-languages)
|
||||
```
|
||||
|
||||
|
||||
@@ -4,21 +4,20 @@
|
||||
// To use:
|
||||
//
|
||||
// ```typst
|
||||
// #import "@preview/codly:1.2.0": *
|
||||
// #import "@preview/codly:1.3.0": *
|
||||
// #show: codly-init
|
||||
//
|
||||
// #import "codly-languages.typ:0.1.8": *
|
||||
// #import "codly-languages.typ:0.1.9": *
|
||||
// #codly(languages: codly-languages)
|
||||
// ```
|
||||
#let codly-languages = {
|
||||
// helper function which takes an image filename and creates an icon
|
||||
let __icon(image-filename) = {
|
||||
box(
|
||||
image("icons/" + image-filename, height: 0.9em),
|
||||
baseline: 0.05em,
|
||||
image("icons/" + image-filename, height: 130%, fit: "contain"),
|
||||
inset: 0pt,
|
||||
outset: 0pt,
|
||||
) + h(0.3em)
|
||||
)
|
||||
}
|
||||
|
||||
let __emoji(emoji) = {
|
||||
@@ -26,7 +25,7 @@
|
||||
emoji,
|
||||
inset: 0pt,
|
||||
outset: 0pt,
|
||||
) + h(0.3em)
|
||||
)
|
||||
}
|
||||
|
||||
// configurations for languages
|
||||
|
||||
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 72 KiB |
@@ -1,4 +1,4 @@
|
||||
#import "@preview/codly:1.2.0": *
|
||||
#import "@preview/codly:1.3.0": *
|
||||
#import "/lib.typ": *
|
||||
#show: codly-init
|
||||
#codly(languages: codly-languages)
|
||||
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 102 KiB |
@@ -1,5 +1,5 @@
|
||||
#import "/lib.typ": *
|
||||
#import "@preview/codly:1.2.0": *
|
||||
#import "@preview/codly:1.3.0": *
|
||||
#show: codly-init
|
||||
#codly(languages: codly-languages)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "codly-languages"
|
||||
version = "0.1.8"
|
||||
version = "0.1.9"
|
||||
entrypoint = "lib.typ"
|
||||
authors = ["Stephen Waits <steve@waits.net>"]
|
||||
license = "MIT"
|
||||
|
||||