texd 0.4.0 → 0.4.1
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/CHANGELOG.md +3 -3
- data/Gemfile.lock +1 -1
- data/README.md +38 -10
- data/gemfiles/rails-6.0.lock +1 -1
- data/gemfiles/rails-6.1.lock +1 -1
- data/gemfiles/rails-7.0.lock +1 -1
- data/lib/texd/config.rb +1 -1
- data/lib/texd/document.rb +6 -0
- data/lib/texd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e81fb33476966032e12c55d7078c824f82e249ad5191bb499a6f0047e6748603
|
4
|
+
data.tar.gz: 41860606ab46c0006a33b740120c8441a8a29d2b48b577ef133a4acff8a5bd8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 352f6eca45f3e55b0e0df036d59f21f4d77dd7567a6c92853ae5766b6a6b3e2d751a9d9a68f4f353c95435caf6cdfed843f0774a4fd64d3fc0ba0ec33a90405d
|
7
|
+
data.tar.gz: 71f761e43adf6268567cd49285a8fe542887e4654499dc297fe7d26feb6882803474702704f6493ece465a339e8ba2283cfd4e0e114f6ed153b7e2c98f2c99b5
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
-
[Compare changes](https://github.com/digineo/texd-ruby/compare/v0.4.
|
3
|
+
[Compare changes](https://github.com/digineo/texd-ruby/compare/v0.4.1...master)
|
4
4
|
|
5
|
-
## v0.4.
|
5
|
+
## v0.4.1 - 2022-06-16
|
6
6
|
|
7
|
-
[Compare changes](https://github.com/digineo/texd-ruby/compare/v0.3.2...v0.4.
|
7
|
+
[Compare changes](https://github.com/digineo/texd-ruby/compare/v0.3.2...v0.4.1)
|
8
8
|
|
9
9
|
**Changes**
|
10
10
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,7 +21,7 @@ Install the gem and add to the application's Gemfile by executing:
|
|
21
21
|
|
22
22
|
## Configuration
|
23
23
|
|
24
|
-
|
24
|
+
Before you can use texd, you need to tell it where your instance is located.
|
25
25
|
|
26
26
|
By default, this gem reads the `TEXD_ENDPOINT` environment variable and falls
|
27
27
|
back to `http://localhost:2201/render`, should it be empty.
|
@@ -38,15 +38,18 @@ end
|
|
38
38
|
|
39
39
|
```rb
|
40
40
|
Texd.configure do |config|
|
41
|
-
config.endpoint
|
42
|
-
config.open_timeout
|
43
|
-
config.read_timeout
|
44
|
-
config.write_timeout
|
45
|
-
config.error_format
|
46
|
-
config.
|
47
|
-
config.
|
48
|
-
config.
|
49
|
-
config.
|
41
|
+
config.endpoint = ENV.fetch("TEXD_ENDPOINT", "http://localhost:2201/")
|
42
|
+
config.open_timeout = ENV.fetch("TEXD_OPEN_TIMEOUT", 60)
|
43
|
+
config.read_timeout = ENV.fetch("TEXD_READ_TIMEOUT", 180)
|
44
|
+
config.write_timeout = ENV.fetch("TEXD_WRITE_TIMEOUT", 60)
|
45
|
+
config.error_format = ENV.fetch("TEXD_ERRORS", "full")
|
46
|
+
config.error_handler = ENV.fetch("TEXD_ERROR_HANDLER", "raise")
|
47
|
+
config.tex_engine = ENV["TEXD_ENGINE"]
|
48
|
+
config.tex_image = ENV["TEXD_IMAGE"]
|
49
|
+
config.helpers = []
|
50
|
+
config.lookup_paths = []
|
51
|
+
config.lookup_paths = [] # Rails.root.join("app/tex") is always prepended
|
52
|
+
config.ref_cache_size = 128
|
50
53
|
end
|
51
54
|
```
|
52
55
|
|
@@ -174,6 +177,31 @@ All errors inherit from `Texd::Client::RenderError` and should have
|
|
174
177
|
a `details` attribute (a Hash) containing the actual error returned
|
175
178
|
from the server.
|
176
179
|
|
180
|
+
## Global error reporting
|
181
|
+
|
182
|
+
texd can be configured with external error reporting, like Sentry.
|
183
|
+
|
184
|
+
This example sends the LaTeX compilation log and compiled main input `.tex`
|
185
|
+
file to Sentry:
|
186
|
+
|
187
|
+
```ruby
|
188
|
+
Texd.configure do |config|
|
189
|
+
config.error_handler = ->(err, doc) {
|
190
|
+
Sentry.set_context "texd", {
|
191
|
+
details: err.details, # if config.error_format == "json"
|
192
|
+
logs: err.logs, # otherwise
|
193
|
+
}.compact
|
194
|
+
Sentry.capture_exception(err)
|
195
|
+
|
196
|
+
raise err # re-raise, so that your code can decide further actions
|
197
|
+
}
|
198
|
+
end
|
199
|
+
```
|
200
|
+
|
201
|
+
`config.error_handler` must respond to `call`, and receives the error (an instance
|
202
|
+
of `Texd::Client::CompilationError`) and the document context (an instance of
|
203
|
+
`Texd::Document::Compilation`).
|
204
|
+
|
177
205
|
## Development
|
178
206
|
|
179
207
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
data/gemfiles/rails-6.0.lock
CHANGED
data/gemfiles/rails-6.1.lock
CHANGED
data/gemfiles/rails-7.0.lock
CHANGED
data/lib/texd/config.rb
CHANGED
@@ -82,7 +82,7 @@ module Texd
|
|
82
82
|
#
|
83
83
|
# Supported values are described in ERROR_FORMATS.
|
84
84
|
#
|
85
|
-
# The default is "full" and can be overriden by the `
|
85
|
+
# The default is "full" and can be overriden by the `TEXD_ERRORS`
|
86
86
|
# environment variable.
|
87
87
|
attr_reader :error_format
|
88
88
|
|
data/lib/texd/document.rb
CHANGED
@@ -40,6 +40,12 @@ module Texd
|
|
40
40
|
def to_upload_ios(missing_refs: Set.new)
|
41
41
|
attachments.to_upload_ios(missing_refs)
|
42
42
|
end
|
43
|
+
|
44
|
+
# Convenience accessor for the main input file.
|
45
|
+
# @returns [String] main input file contents
|
46
|
+
def main_input_contents
|
47
|
+
attachments.items.fetch(main_input_name).contents
|
48
|
+
end
|
43
49
|
end
|
44
50
|
end
|
45
51
|
end
|
data/lib/texd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: texd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Menke
|
@@ -141,7 +141,7 @@ metadata:
|
|
141
141
|
rubygems_mfa_required: 'true'
|
142
142
|
homepage_uri: https://github.com/digineo/texd-ruby
|
143
143
|
source_code_uri: https://github.com/digineo/texd-ruby
|
144
|
-
changelog_uri: https://github.com/digineo/texd-ruby/blob/v0.4.
|
144
|
+
changelog_uri: https://github.com/digineo/texd-ruby/blob/v0.4.1/CHANGELOG.md
|
145
145
|
post_install_message:
|
146
146
|
rdoc_options: []
|
147
147
|
require_paths:
|