oicana 0.10.0.rc.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/oicana/oicana_uniffi.rb +113 -29
- data/lib/oicana/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17ba60a714e20dc2b47fd8a0c3ba0333fab75a281bce7698b12d253c1b999213
|
|
4
|
+
data.tar.gz: 634c2be9efedaa4d8d7bdf569257354f5df5a2c09efd8fd191ad38a34dce39dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f11b6e769d19b5cbfeb4bcd072c51b4fbf93d568cafd23247eba85eca4b1d4b7bb00b3f93f17a5b7dfd61613fc181ed9e43a23adcdd8f5a0915cf67ec3512fae
|
|
7
|
+
data.tar.gz: 3c0392ea653b3b15cebcae83de7f99a6a7022e113f9dd7bb88edeaf182318538727468a1ff8f0b8f1f3980e93232c81a9cc2fcbd13e03005a836b3116a377741
|
data/README.md
CHANGED
|
@@ -35,6 +35,15 @@ JSON inputs take Strings holding JSON, or any value `JSON.generate` accepts. Blo
|
|
|
35
35
|
|
|
36
36
|
Creating a `Template` compiles it once to warm up the Typst cache, so create it once per process, not per request. Oicana cannot compile in a process forked after its parent compiled, so with forking servers and job runners like Puma in cluster mode or Solid Queue, create templates on first use instead of during boot. A template is safe to use from multiple threads, and native calls release the GVL. Templates and compiled documents are freed by the garbage collector, or right away with `close`.
|
|
37
37
|
|
|
38
|
+
## Why Oicana
|
|
39
|
+
|
|
40
|
+
- **Runs in your infrastructure**: PDFs are generated inside your own application. No data is sent to a third-party service.
|
|
41
|
+
- **Multi-platform**: the same template works in the browser, Node.js, C#, Java, Rust, Python, PHP, Go, Ruby, and Dart.
|
|
42
|
+
- **Powerful typesetting**: templates have all of Typst, including its package ecosystem.
|
|
43
|
+
- **Performant**: a warmed up template renders a PDF in single-digit milliseconds.
|
|
44
|
+
- **AI and version control ready**: templates are text files. They live next to your code, and AI can help write them.
|
|
45
|
+
- **No proprietary format**: templates are plain Typst projects. The Typst compiler is open source.
|
|
46
|
+
|
|
38
47
|
## Licensing
|
|
39
48
|
|
|
40
49
|
Oicana is source-available under the [PolyForm Noncommercial License 1.0.0](https://github.com/oicana/oicana/blob/main/LICENSE.md) and free for noncommercial use. Commercial use is free for 30 days; see [pricing](https://oicana.com/#pricing) for subscriptions, or write to `hello@oicana.com`.
|
data/lib/oicana/oicana_uniffi.rb
CHANGED
|
@@ -953,39 +953,39 @@ class RustBufferStream
|
|
|
953
953
|
variant = unpack_from 4, 'l>'
|
|
954
954
|
|
|
955
955
|
if variant == 1
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
956
|
+
return OicanaError::InvalidTemplate.new(
|
|
957
|
+
readString()
|
|
958
|
+
)
|
|
959
959
|
end
|
|
960
960
|
if variant == 2
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
961
|
+
return OicanaError::InvalidInput.new(
|
|
962
|
+
readString()
|
|
963
|
+
)
|
|
964
964
|
end
|
|
965
965
|
if variant == 3
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
966
|
+
return OicanaError::Compilation.new(
|
|
967
|
+
readString()
|
|
968
|
+
)
|
|
969
969
|
end
|
|
970
970
|
if variant == 4
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
971
|
+
return OicanaError::FileNotFound.new(
|
|
972
|
+
readString()
|
|
973
|
+
)
|
|
974
974
|
end
|
|
975
975
|
if variant == 5
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
976
|
+
return OicanaError::Export.new(
|
|
977
|
+
readString()
|
|
978
|
+
)
|
|
979
979
|
end
|
|
980
980
|
if variant == 6
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
981
|
+
return OicanaError::NotFound.new(
|
|
982
|
+
readString()
|
|
983
|
+
)
|
|
984
984
|
end
|
|
985
985
|
if variant == 7
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
986
|
+
return OicanaError::Internal.new(
|
|
987
|
+
readString()
|
|
988
|
+
)
|
|
989
989
|
end
|
|
990
990
|
|
|
991
991
|
raise InternalError, 'Unexpected variant tag for TypeOicanaError'
|
|
@@ -1567,14 +1567,98 @@ CALL_ERROR = 1
|
|
|
1567
1567
|
CALL_PANIC = 2
|
|
1568
1568
|
|
|
1569
1569
|
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1570
|
+
module OicanaError
|
|
1571
|
+
class InvalidTemplate < StandardError
|
|
1572
|
+
def initialize(message)
|
|
1573
|
+
@message = message
|
|
1574
|
+
super()
|
|
1575
|
+
end
|
|
1576
|
+
|
|
1577
|
+
attr_reader :message
|
|
1578
|
+
|
|
1579
|
+
|
|
1580
|
+
def to_s
|
|
1581
|
+
"#{self.class.name}(message=#{@message.inspect})"
|
|
1582
|
+
end
|
|
1583
|
+
end
|
|
1584
|
+
class InvalidInput < StandardError
|
|
1585
|
+
def initialize(message)
|
|
1586
|
+
@message = message
|
|
1587
|
+
super()
|
|
1588
|
+
end
|
|
1589
|
+
|
|
1590
|
+
attr_reader :message
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
def to_s
|
|
1594
|
+
"#{self.class.name}(message=#{@message.inspect})"
|
|
1595
|
+
end
|
|
1596
|
+
end
|
|
1597
|
+
class Compilation < StandardError
|
|
1598
|
+
def initialize(message)
|
|
1599
|
+
@message = message
|
|
1600
|
+
super()
|
|
1601
|
+
end
|
|
1602
|
+
|
|
1603
|
+
attr_reader :message
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
def to_s
|
|
1607
|
+
"#{self.class.name}(message=#{@message.inspect})"
|
|
1608
|
+
end
|
|
1609
|
+
end
|
|
1610
|
+
class FileNotFound < StandardError
|
|
1611
|
+
def initialize(message)
|
|
1612
|
+
@message = message
|
|
1613
|
+
super()
|
|
1614
|
+
end
|
|
1615
|
+
|
|
1616
|
+
attr_reader :message
|
|
1617
|
+
|
|
1618
|
+
|
|
1619
|
+
def to_s
|
|
1620
|
+
"#{self.class.name}(message=#{@message.inspect})"
|
|
1621
|
+
end
|
|
1622
|
+
end
|
|
1623
|
+
class Export < StandardError
|
|
1624
|
+
def initialize(message)
|
|
1625
|
+
@message = message
|
|
1626
|
+
super()
|
|
1627
|
+
end
|
|
1628
|
+
|
|
1629
|
+
attr_reader :message
|
|
1630
|
+
|
|
1631
|
+
|
|
1632
|
+
def to_s
|
|
1633
|
+
"#{self.class.name}(message=#{@message.inspect})"
|
|
1634
|
+
end
|
|
1635
|
+
end
|
|
1636
|
+
class NotFound < StandardError
|
|
1637
|
+
def initialize(message)
|
|
1638
|
+
@message = message
|
|
1639
|
+
super()
|
|
1640
|
+
end
|
|
1641
|
+
|
|
1642
|
+
attr_reader :message
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
def to_s
|
|
1646
|
+
"#{self.class.name}(message=#{@message.inspect})"
|
|
1647
|
+
end
|
|
1648
|
+
end
|
|
1649
|
+
class Internal < StandardError
|
|
1650
|
+
def initialize(message)
|
|
1651
|
+
@message = message
|
|
1652
|
+
super()
|
|
1653
|
+
end
|
|
1654
|
+
|
|
1655
|
+
attr_reader :message
|
|
1656
|
+
|
|
1657
|
+
|
|
1658
|
+
def to_s
|
|
1659
|
+
"#{self.class.name}(message=#{@message.inspect})"
|
|
1660
|
+
end
|
|
1661
|
+
end
|
|
1578
1662
|
|
|
1579
1663
|
end
|
|
1580
1664
|
|
data/lib/oicana/version.rb
CHANGED