giblish 2.1.0 → 2.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8408ee3c107d81b67183f08d1da4b5e4aa5edc0cb0050bab222be0c2bc7f2d2e
4
- data.tar.gz: d98a66177b686af3f20a46b57c2425ab0c1462296ca27455a1f79c426fd2958d
3
+ metadata.gz: 22133b3cded62a83b48e863debd9f87aa046934504fa382251b96253926e7475
4
+ data.tar.gz: 59aaff1c7e7264fd3e02303dd07b8ffe736b66b41ea62af23bc5a9923cfa0de8
5
5
  SHA512:
6
- metadata.gz: 72b392c42daaef6cd52224eaf43687463a0750934ac995d67e529bdb16b2be7498f31fc8dcd2112756873894adf6314a965231e6325460e7458f214c987419fa
7
- data.tar.gz: 61afa2acbf3ec664fc289e673e8c5faac55bf1f1d564b0955a1d2eb541e7764333f9ef326d82c4da1fc4db83386c8aa2b0d7024fddbc9962b048d87645baf020
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.0".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.0
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