texd 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Makefile +3 -2
- 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/document.rb +7 -4
- data/lib/texd/version.rb +1 -1
- data/lib/texd.rb +5 -2
- 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: 6ac1013a4aa1ebd3b6889f40a3de4b8e48b6b55ea5413f1c997141c3660d8c81
|
4
|
+
data.tar.gz: 5fd52ec7b93abdd53c12276977b13e8c00ca8d16af39659be19128a3e9684860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6522bec685edb067867df07b39b9de12d554b9907c2886e6f72fd53377a9dc5dc87cdc6370f4af4067970aa65b4f4a62415f7eb46aec65dadd1c9f3d65badfae
|
7
|
+
data.tar.gz: 29283c3b8a723f156ae5ce67f79e0cedd2c186b940a831eb7a7fe8a972f50ab5b1bb29017137edbfa87668429f190f5a82bc883b97299c6b8f783c5a678fb944
|
data/Gemfile.lock
CHANGED
data/Makefile
CHANGED
@@ -45,10 +45,11 @@ docs:
|
|
45
45
|
.PHONY: texd-docker
|
46
46
|
texd-docker:
|
47
47
|
mkdir -p tmp/jobs tmp/refs
|
48
|
+
rm -vf tmp/jobs/* tmp/refs/*
|
48
49
|
docker run --rm \
|
49
50
|
--name texd-dev \
|
50
51
|
-p 127.0.0.1:2201:2201 \
|
51
52
|
-v $$(pwd)/tmp/jobs:/texd \
|
52
53
|
-v $$(pwd)/tmp/refs:/refs \
|
53
|
-
|
54
|
-
digineode/texd --reference-store dir:///refs
|
54
|
+
-u $$(id -u):$$(id -g) \
|
55
|
+
digineode/texd --reference-store dir:///refs --keep-jobs always
|
data/gemfiles/rails-6.0.lock
CHANGED
data/gemfiles/rails-6.1.lock
CHANGED
data/gemfiles/rails-7.0.lock
CHANGED
data/lib/texd/document.rb
CHANGED
@@ -6,8 +6,8 @@ module Texd
|
|
6
6
|
attr_reader :attachments
|
7
7
|
|
8
8
|
# Shorthand for `new.compile`.
|
9
|
-
def self.compile(
|
10
|
-
new.compile(
|
9
|
+
def self.compile(**kwargs)
|
10
|
+
new.compile(**kwargs)
|
11
11
|
end
|
12
12
|
|
13
13
|
def initialize
|
@@ -22,12 +22,15 @@ module Texd
|
|
22
22
|
# context.
|
23
23
|
# @param [Hash, nil] locals will be made available as getter methods in
|
24
24
|
# the template.
|
25
|
+
# @param [String, Boolean] layout to be used. String value name template
|
26
|
+
# files in `app/views/layouts`, `true` (default) uses the application
|
27
|
+
# layout, and `false` renders without a layout.
|
25
28
|
# @return [Compilation]
|
26
|
-
def compile(template:, locals: {})
|
29
|
+
def compile(template:, locals: {}, layout: true)
|
27
30
|
helper_mod = ::Texd.helpers(attachments, locals)
|
28
31
|
tex_source = Class.new(ApplicationController) {
|
29
32
|
helper helper_mod
|
30
|
-
}.render(template: template, format: :tex)
|
33
|
+
}.render(template: template, format: :tex, layout: layout)
|
31
34
|
|
32
35
|
main = attachments.main_input(tex_source)
|
33
36
|
Compilation.new(main.name, attachments)
|
data/lib/texd/version.rb
CHANGED
data/lib/texd.rb
CHANGED
@@ -119,12 +119,15 @@ module Texd
|
|
119
119
|
# context.
|
120
120
|
# @param [Hash, nil] locals will be made available as getter methods in
|
121
121
|
# the template.
|
122
|
+
# @param [String, Boolean] layout to be used. String value name template
|
123
|
+
# files in `app/views/layouts`, `true` (default) uses the application
|
124
|
+
# layout, and `false` renders without a layout.
|
122
125
|
# @raise [Texd::Client::ResponseError] on input and queue errors. Also on
|
123
126
|
# compilation errors, if Texd.config.error_format is set to JSON.
|
124
127
|
# @raise [Texd::Error] on other Texd related errors.
|
125
128
|
# @return [String] the PDF object
|
126
|
-
def render(template:, locals: {})
|
127
|
-
doc = Document.compile(template: template, locals: locals)
|
129
|
+
def render(template:, locals: {}, layout: true)
|
130
|
+
doc = Document.compile(template: template, locals: locals, layout: layout)
|
128
131
|
|
129
132
|
client.render doc.to_upload_ios,
|
130
133
|
input: doc.main_input_name
|
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.3.
|
4
|
+
version: 0.3.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.3.
|
144
|
+
changelog_uri: https://github.com/digineo/texd-ruby/blob/v0.3.1/CHANGELOG.md
|
145
145
|
post_install_message:
|
146
146
|
rdoc_options: []
|
147
147
|
require_paths:
|