paperwork 0.2.3 → 0.2.4

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: 9a4d78a79310dd0ce95afc1fa65864f5a5b8f71a0d01972762484c9ab4d4e28c
4
- data.tar.gz: 6d5edf6cddc099b47bf01e659a639df84a7305ac1d895aeb31018d65a20f8e87
3
+ metadata.gz: c5d904d85bcbd5a2ba7eca856dad8793b0e4eee24da094fbbc1fe774584eae0c
4
+ data.tar.gz: 1c33cc363286cc5413a321196719cfb6e9a36e61d5e29778491cca20ad7f67dc
5
5
  SHA512:
6
- metadata.gz: 5983c073fb3c2295aa6827c66f6c27f647a3f3d19efaad7bce6c5ccaccdf0b67e42aeea9096c3a814ec5fea39a7980eee4df5c65aa462da0e82f51dfbccdcba4
7
- data.tar.gz: 7038d59fa69df43ef00541adc169a440439dda1f418822a0c4c36fcb86322f2866f2f988cca6e55143cb25bd81c92449b234dbf0dbff8c911521bfd1730d6191
6
+ metadata.gz: 40c2a56a01a32c60dbf5770d5875ab952a12cf808d5a5a1a0ab441e30daf53640114ddceb9d539d65770da8253df0800ccd067474dd89ae811924dd2420448a9
7
+ data.tar.gz: c46981794b979171ef040449fe987dfc2e2199cf8b7714f73b7b6a0fd176aeefe59fa596b763e9b388c8039b09ec0a5b8774465d9cebe58d5dfc2967d6426bc9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperwork (0.2.3)
4
+ paperwork (0.2.4)
5
5
  rake (~> 12.3)
6
6
  redcarpet (~> 3.5.0)
7
7
 
@@ -35,19 +35,19 @@ module Paperwork
35
35
  private
36
36
 
37
37
  def get_destination(dst_base, src) # rubocop:disable Metrics/AbcSize
38
- dst_base = File.join(dst_base, File.dirname(src))
38
+ nested = File.dirname(src)
39
39
  ext = File.extname(src)
40
40
  case ext
41
41
  when ".md"
42
- File.join(dst_base, File.basename(src)).gsub(".md", ".html.md")
42
+ File.join(dst_base, nested, File.basename(src)).gsub(".md", ".html.md")
43
43
  when ".scss"
44
- Paperwork::Config[:custom_css] << File.basename(src)
44
+ Paperwork::Config[:custom_css] << File.basename(src, ext)
45
45
  File.join(dst_base, "stylesheets", File.basename(src)).gsub(".scss", ".css.scss")
46
46
  when ".css"
47
- Paperwork::Config[:custom_css] << File.basename(src)
47
+ Paperwork::Config[:custom_css] << File.basename(src, ext)
48
48
  File.join(dst_base, "stylesheets", File.basename(src))
49
49
  when ".js"
50
- Paperwork::Config[:custom_js] << File.basename(src)
50
+ Paperwork::Config[:custom_js] << File.basename(src, ext)
51
51
  File.join(dst_base, "javascripts", File.basename(src))
52
52
  when ".yml"
53
53
  File.join(dst_base, "..", "data", File.basename(src))
@@ -50,7 +50,6 @@ set :relative_links, true
50
50
  activate :relative_assets
51
51
  activate :livereload
52
52
  activate :syntax, line_numbers: true
53
- # activate :directory_indexes
54
53
 
55
54
 
56
55
  require "lib/doc_renderer"
@@ -6,10 +6,12 @@
6
6
  #
7
7
  module DocRenderer
8
8
  require "middleman-core/renderers/redcarpet"
9
+ require_relative "info_helpers"
9
10
 
10
11
  # This is a basic renderer for transforming markdown to HTML
11
12
  # inherit from this renderer to create more specific variants
12
13
  class Base < Middleman::Renderers::MiddlemanRedcarpetHTML
14
+ include InfoHelpers
13
15
 
14
16
  # block level calls
15
17
  def block_code(code, language)
@@ -79,11 +81,12 @@ module DocRenderer
79
81
  # def emphasis(text)
80
82
  # end
81
83
 
82
- # def image(link, title, alt_text, default_class: "img-fluid")
83
- # <<~IMG
84
- # <img src="#{link}" alt="#{alt_text}" class="#{default_class}">
85
- # IMG
86
- # end
84
+ def image(link, title, alt_text)
85
+ <<~IMG
86
+ <img src="#{relative_link link, scope.current_path}" alt="#{alt_text}" class="img-fluid">#{title}</img>
87
+ IMG
88
+ #super(relative_link(link, scope.current_path), title, alt_text)
89
+ end
87
90
 
88
91
  # def linebreak()
89
92
  # end
@@ -20,9 +20,9 @@ module InfoHelpers
20
20
  end
21
21
  end
22
22
 
23
- def relative_link(stringifyable)
23
+ def relative_link(stringifyable, current_path=current_page.path)
24
24
  relative = String.new
25
- dots = current_page.path.split(/[\/\\]/).size - 1
25
+ dots = current_path.split(/[\/\\]/).size - 1
26
26
  dots.times{ relative += "../" }
27
27
  # This has been some nasty part to debug...
28
28
  # keep these comments for debugging session yet to come
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paperwork
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schmid