-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support generating PNG and SVG files
- Loading branch information
Showing
8 changed files
with
167 additions
and
34 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#let gitHash = sys.inputs.at("gitHash") | ||
#let gitHash = sys.inputs.at("gitHash", default: "") | ||
|
||
= Test document #gitHash | ||
|
||
#lorem(50) | ||
#lorem(5000) |
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
37 changes: 37 additions & 0 deletions
37
plugin/src/main/kotlin/de/infolektuell/gradle/typst/extensions/TypstOutputFormatExtension.kt
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,37 @@ | ||
package de.infolektuell.gradle.typst.extensions | ||
|
||
import org.gradle.api.Action | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Nested | ||
|
||
abstract class TypstOutputFormatExtension { | ||
abstract class OutputFormat { | ||
abstract val enabled: Property<Boolean> | ||
} | ||
abstract class PDF : OutputFormat() { | ||
val extension: String get() = "pdf" | ||
abstract val merged: Property<String> | ||
} | ||
abstract class PNG : OutputFormat() { | ||
val extension: String get() = "png" | ||
abstract val ppi: Property<Int> | ||
} | ||
abstract class SVG : OutputFormat() { | ||
val extension: String get() = "svg" | ||
} | ||
@get:Nested | ||
abstract val pdf: PDF | ||
fun pdf(action: Action<in PDF>) { | ||
action.execute(pdf) | ||
} | ||
@get:Nested | ||
abstract val png: PNG | ||
fun png(action: Action<in PNG>) { | ||
action.execute(png) | ||
} | ||
@get:Nested | ||
abstract val svg: SVG | ||
fun svg(action: Action<in SVG>) { | ||
action.execute(svg) | ||
} | ||
} |
14 changes: 12 additions & 2 deletions
14
plugin/src/main/kotlin/de/infolektuell/gradle/typst/extensions/TypstSourceSet.kt
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