giblish 2.1.1 → 2.1.2

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: ebe6a65bd46cad23c3403ebad0a5356f9225a2fe3312144b2204673179726606
4
- data.tar.gz: 05db79e2cf43b9955cea4fd5a3f0cbef399e2efb359860093a98a5c9b7a17c3d
3
+ metadata.gz: 22133b3cded62a83b48e863debd9f87aa046934504fa382251b96253926e7475
4
+ data.tar.gz: 59aaff1c7e7264fd3e02303dd07b8ffe736b66b41ea62af23bc5a9923cfa0de8
5
5
  SHA512:
6
- metadata.gz: ee9cd78fb1b29cbbef483d6f5279900746966011bb01dd4e9118ab66ceb2c1d029479bd563932eadfcf33287d93c719da2d85af63770fc8c535a0842aee7ff84
7
- data.tar.gz: 27dd128a3a313323d51a1801da3839930e593ef6368e84639cdac5d2fe292953f792a8a058dbcd58e40c842bcdc5ca0cff42b608feae57925b25ee7718112fef
6
+ metadata.gz: 01c930aa02c6cbb16325f3fb9981bd1d53396d992e7386cc189fa6c21804e872d56da7a6a343f0988c9403697bf64c3b5ea583363c9433813fcd0d65aa82f149
7
+ data.tar.gz: b1cb48faa21d4305adf4981f75148b1db995a5a23af0187f0bcd69fffb0e920b6a4c980917bfc6adf24a39b0d889b75cf071a7194163af137cf71d6628fb80e9
@@ -46,6 +46,28 @@ module Giblish
46
46
  end
47
47
  end
48
48
 
49
+ # A combined docattr_provider and post-processor that:
50
+ # - instructs asciidoctor-mathematical to use svg as format
51
+ # - removes svg cache files produced by asciidoctor-mathematical
52
+ class PdfMathHelper
53
+ # called by the TreeConverter during the post_build phase
54
+ def on_postbuild(src_topdir, dst_tree, converter)
55
+ dst_top = src_topdir.pathname
56
+ dst_top.each_child do |c|
57
+ if c.basename.to_s.match?(/^stem-[0-9a-f]*\.svg$/)
58
+ Giblog.logger.debug("will remove #{c}")
59
+ c.delete
60
+ end
61
+ end
62
+ end
63
+
64
+ def document_attributes(src_node, dst_node, dst_top)
65
+ {
66
+ "mathematical-format" => "svg"
67
+ }
68
+ end
69
+ end
70
+
49
71
  class PdfLayoutConfig
50
72
  attr_reader :pre_builders, :post_builders, :adoc_extensions, :adoc_api_opts, :docattr_providers
51
73
 
@@ -56,6 +78,15 @@ module Giblish
56
78
  @adoc_extensions = {}
57
79
  @docattr_providers = []
58
80
 
81
+ begin
82
+ require "asciidoctor-mathematical"
83
+ cc = PdfMathHelper.new
84
+ @post_builders << cc
85
+ @docattr_providers << cc
86
+ rescue LoadError
87
+ Giblog.logger.warn { "Did not find asciidoctor-mathematical. stem blocks will not be rendered correctly!" }
88
+ end
89
+
59
90
  unless config_opts.resource_dir.nil?
60
91
  # generate pdf using asciidoctor-pdf with custom styling
61
92
  rp = ResourcePaths.new(config_opts)
@@ -70,8 +70,6 @@ module Giblish
70
70
  c = repo.gcommit(branch)
71
71
  commit = CommitInfo.new(c.sha, c.date, c.author.name, c.message)
72
72
 
73
- # puts c.instance_variables
74
-
75
73
  BranchInfo.new(branch.name, commit)
76
74
  end
77
75
  end
@@ -1,3 +1,3 @@
1
1
  module Giblish
2
- VERSION = "2.1.1".freeze
2
+ VERSION = "2.1.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: giblish
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anders Rillbert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-26 00:00:00.000000000 Z
11
+ date: 2023-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest