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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f90c7123f60872130f0a2c36a6a6fa44154d1e3956c140f45e07e6815761363
4
- data.tar.gz: a1c855d5a76517dae7eb2c5a2a9cc9be621236fa59018e62fbeeaa9b31ee0d49
3
+ metadata.gz: 6ac1013a4aa1ebd3b6889f40a3de4b8e48b6b55ea5413f1c997141c3660d8c81
4
+ data.tar.gz: 5fd52ec7b93abdd53c12276977b13e8c00ca8d16af39659be19128a3e9684860
5
5
  SHA512:
6
- metadata.gz: ecc5d22800aea0f4b77e76c0c052106cb80bb47c3c3a478696c712957fbc178ac74c7014d3927ff09bd45c4472a167fc8ebd7bcbd9ff154f12c90f2724df319d
7
- data.tar.gz: 88dad14c7c7f95fbb53bb12bd9777de8033d8b8aceafe896efabcf8f0c33463ece25b90ef43e2e3108c617586007171c498a969fe7184763d73812cf35ed0cf4
6
+ metadata.gz: 6522bec685edb067867df07b39b9de12d554b9907c2886e6f72fd53377a9dc5dc87cdc6370f4af4067970aa65b4f4a62415f7eb46aec65dadd1c9f3d65badfae
7
+ data.tar.gz: 29283c3b8a723f156ae5ce67f79e0cedd2c186b940a831eb7a7fe8a972f50ab5b1bb29017137edbfa87668429f190f5a82bc883b97299c6b8f783c5a678fb944
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- texd (0.3.0)
4
+ texd (0.3.1)
5
5
  multipart-post (~> 2.0)
6
6
  rails (>= 6.0, < 8)
7
7
 
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
- --user=$$(id -u):$$(id -g) \
54
- digineode/texd --reference-store dir:///refs
54
+ -u $$(id -u):$$(id -g) \
55
+ digineode/texd --reference-store dir:///refs --keep-jobs always
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- texd (0.3.0)
4
+ texd (0.3.1)
5
5
  multipart-post (~> 2.0)
6
6
  rails (>= 6.0, < 8)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- texd (0.3.0)
4
+ texd (0.3.1)
5
5
  multipart-post (~> 2.0)
6
6
  rails (>= 6.0, < 8)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- texd (0.3.0)
4
+ texd (0.3.1)
5
5
  multipart-post (~> 2.0)
6
6
  rails (>= 6.0, < 8)
7
7
 
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(template:, locals: {})
10
- new.compile(template: template, locals: locals)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Texd
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
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.0
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.0/CHANGELOG.md
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: