-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Simplify common arg handling * Fix #10 - Ensure grid.kind is propagated down to super * Fix #9 - Ensure supplement inference does not fail if it is set * Release v0.1.1
- Loading branch information
Showing
12 changed files
with
132 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# added by typst-test |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Synopsis: | ||
// - default kind is figure and is not inferred from content | ||
// - the super supplement is propagated down by default | ||
// - same kind correctly usese same counter | ||
|
||
#import "/test/util.typ": * | ||
#import "/src/lib.typ" as subpar | ||
|
||
// figure by default regardless of inner content | ||
#subpar.grid( | ||
figure(```typst = Hello World```, caption: [Inner Caption]), <1a>, | ||
figure(```typst = Hello World```, caption: [Inner Caption]), <1b>, | ||
columns: (1fr, 1fr), | ||
caption: [Super], | ||
label: <1>, | ||
) | ||
|
||
// setting it propagates the inferred supplement down | ||
#subpar.grid( | ||
figure(```typst = Hello World```, caption: [Inner Caption]), <2a>, | ||
figure(```typst = Hello World```, caption: [Inner Caption]), <2b>, | ||
columns: (1fr, 1fr), | ||
caption: [Super], | ||
kind: raw, | ||
label: <2>, | ||
) | ||
|
||
// turning off propagation causes different supplements for super and sub figures | ||
#subpar.grid( | ||
figure(table[A], caption: [Inner Caption]), <3a>, | ||
figure(table[A], caption: [Inner Caption]), <3b>, | ||
columns: (1fr, 1fr), | ||
caption: [Super], | ||
propagate-supplement: false, | ||
label: <3>, | ||
) | ||
|
||
@1, @1a, @1b | ||
|
||
@2, @2a, @2b | ||
|
||
@3, @3a, @3b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# added by typst-test |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Synopsis: | ||
// - default supplement is figure | ||
// - supplement is inferred from kind | ||
// - set supplement is used and propagated by default | ||
// - propagation works as expected | ||
|
||
#import "/test/util.typ": * | ||
#import "/src/lib.typ" as subpar | ||
|
||
// default supplement is figure | ||
#subpar.grid( | ||
figure(fake-image, caption: [Inner Caption]), <1a>, | ||
figure(fake-image, caption: [Inner Caption]), <1b>, | ||
columns: (1fr, 1fr), | ||
caption: [Super], | ||
label: <1>, | ||
) | ||
|
||
// supplement is inferred from kind | ||
#subpar.grid( | ||
figure(fake-image, caption: [Inner Caption]), <2a>, | ||
figure(fake-image, caption: [Inner Caption]), <2b>, | ||
columns: (1fr, 1fr), | ||
caption: [Super], | ||
kind: raw, | ||
label: <2>, | ||
) | ||
|
||
// set supplement is used and propagated | ||
#subpar.grid( | ||
figure(fake-image, caption: [Inner Caption]), <3a>, | ||
figure(fake-image, caption: [Inner Caption]), <3b>, | ||
columns: (1fr, 1fr), | ||
caption: [Super], | ||
supplement: "Image", | ||
label: <3>, | ||
) | ||
|
||
// set supplement is used and not propagated | ||
#subpar.grid( | ||
figure(fake-image, caption: [Inner Caption]), <4a>, | ||
figure(fake-image, caption: [Inner Caption]), <4b>, | ||
columns: (1fr, 1fr), | ||
caption: [Super], | ||
supplement: "Image", | ||
propagate-supplement: false, | ||
label: <4>, | ||
) | ||
|
||
@1, @1a, @1b | ||
|
||
@2, @2a, @2b | ||
|
||
@3, @3a, @3b | ||
|
||
@4, @4a, @4b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
entrypoint = "src/lib.typ" | ||
name = "subpar" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
compiler = "0.11.0" | ||
authors = ["tinger <[email protected]>"] | ||
repository = "https://github.com/tingerrr/subpar" | ||
|