forked from HEL/rivet-typst
Compare commits
2 Commits
dev
...
fix-consec
| Author | SHA1 | Date | |
|---|---|---|---|
| b6f2fd99b8 | |||
|
6f13df815f
|
@@ -28,9 +28,9 @@
|
|||||||
/// - ltr-bits (bool): If true, bits are placed with the LSB on the left instead of the right
|
/// - ltr-bits (bool): If true, bits are placed with the LSB on the left instead of the right
|
||||||
/// -> dictionary
|
/// -> dictionary
|
||||||
#let config(
|
#let config(
|
||||||
default-font-family: "DejaVu Sans Mono",
|
default-font-family: "Ubuntu Mono",
|
||||||
default-font-size: 15pt,
|
default-font-size: 15pt,
|
||||||
italic-font-family: "Libertinus Serif",
|
italic-font-family: "Ubuntu Mono",
|
||||||
italic-font-size: 12pt,
|
italic-font-size: 12pt,
|
||||||
background: white,
|
background: white,
|
||||||
text-color: black,
|
text-color: black,
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 408 KiB After Width: | Height: | Size: 378 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 328 KiB After Width: | Height: | Size: 303 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 490 KiB After Width: | Height: | Size: 485 KiB |
BIN
gallery/test.pdf
BIN
gallery/test.pdf
Binary file not shown.
1098
manual.pdf
1098
manual.pdf
File diff suppressed because it is too large
Load Diff
28
manual.typ
28
manual.typ
@@ -152,6 +152,34 @@ The range name (or key) defines the left- and rightmost bits (e.g. `7-4` goes fr
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
=== Start <format-start>
|
||||||
|
|
||||||
|
By default, structures start at bit 0, but you may want to number bits from 1, or another arbitrary value. To do this, you can set the `start` property of a structure to the desired start value. For example,
|
||||||
|
|
||||||
|
```json
|
||||||
|
"main": {
|
||||||
|
"bits": 8,
|
||||||
|
"start": 4,
|
||||||
|
"ranges": {
|
||||||
|
"11-7": { ... },
|
||||||
|
"6-4": { ... }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#let start-schema = (structures: (main: (bits: 8, start: 4, ranges: ("11-7": (name: ""), "6-4": (name: "")))))
|
||||||
|
|
||||||
|
would render as
|
||||||
|
|
||||||
|
#align(
|
||||||
|
center,
|
||||||
|
schema.render(
|
||||||
|
schema.load(start-schema),
|
||||||
|
width: 50%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
== Range <format-range>
|
== Range <format-range>
|
||||||
|
|
||||||
A range represents a group of consecutive bits. It can have a name (displayed in the bit cells), a description (displayed under the structure) and / or values.
|
A range represents a group of consecutive bits. It can have a name (displayed in the bit cells), a description (displayed under the structure) and / or values.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#let config(
|
#let config(
|
||||||
default-font-family: "DejaVu Sans Mono",
|
default-font-family: "Ubuntu Mono",
|
||||||
default-font-size: 15pt,
|
default-font-size: 15pt,
|
||||||
italic-font-family: "Libertinus Serif",
|
italic-font-family: "Ubuntu Mono",
|
||||||
italic-font-size: 12pt,
|
italic-font-size: 12pt,
|
||||||
background: white,
|
background: white,
|
||||||
text-color: black,
|
text-color: black,
|
||||||
|
|||||||
@@ -387,8 +387,10 @@
|
|||||||
}
|
}
|
||||||
let range-boundaries = ()
|
let range-boundaries = ()
|
||||||
for r in struct.ranges.values() {
|
for r in struct.ranges.values() {
|
||||||
let i = to-real-i(if config.ltr-bits {r.start} else {r.end})
|
let start-i = to-real-i(if config.ltr-bits {r.start} else {r.end})
|
||||||
range-boundaries.push(i)
|
let end-i = to-real-i(if config.ltr-bits {r.end} else {r.start}) + 1
|
||||||
|
range-boundaries.push(start-i)
|
||||||
|
range-boundaries.push(end-i)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw colors
|
// Draw colors
|
||||||
|
|||||||
Reference in New Issue
Block a user