asciidoctor-external-callout 0.0.6.pre.beta7 → 1.0.0

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: 910479158955009faec89ab7797f5b30c5d97aff3433c276fb6bc34d0f1e10c2
4
- data.tar.gz: e082c0a766caa8a2cd5f5f60f8063052f75ca398b2a6933afc06eb581c9c1e48
3
+ metadata.gz: 53e488dac87a1685e9450b031e44aea9ef5d265b92f974965e7b212df326b284
4
+ data.tar.gz: 27559c5adc5c7daf42eb2b958ed6d96be360d6ee4a25689e726f2c42dffca8b5
5
5
  SHA512:
6
- metadata.gz: ce3c945787e12aef49a863250cbdab404e5a2c0ee7396c81c8a969829b724506c0c5cfec3bb42a407cac9bb017d03bb4d1979fd11d0539ee466339648f52f4a4
7
- data.tar.gz: 4bf8d47eb9008153011617d1e3438b7c8bff86d1e70a0686dd8494f543fac7dc4f72c7cd75d4c8ae02b9a95ddea30f8ad665a4f23e7a208775e9e6f6fa5dd145
6
+ metadata.gz: 7b48ae24cdb081bedffb3702cd10821ac8739e52d372042dfeb851acb9d0b607d3e72afb6fd6e7cabc0be2a81647eaf50f46604ba3b0f44b5d30ea2db9616608
7
+ data.tar.gz: 53cd492e35f520d503d7643723a4289abe3f88ef8f9b00607d494e1e2e0240692e58da74af6f05d0f10e365070ac24fe0d195612b29b589f8579e585eccc6797
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  Record of bug fixes, enhancements, and changes.
4
4
 
5
+ ## [1.0.0] – 22-06-16
6
+
7
+ ### Added
8
+ - Added roles to the source block and the callout list so that CSS folk can pick them out to make style changes (For example, adjusting the gap between callout items in the source code block.)
9
+
5
10
  ## [0.0.6-beta6] – 2022-06-11
6
11
 
7
12
  ### Changed
data/README.md CHANGED
@@ -80,7 +80,46 @@ Or install it yourself as:
80
80
 
81
81
  ## Usage
82
82
 
83
- TODO: Write usage instructions here
83
+ To use the extension, you need to register it before calling one of the Asciidoc `convert` functions to render the output.
84
+
85
+ ```ruby
86
+ require 'asciidoctor-external-callout'
87
+ require 'asciidoctor'
88
+
89
+ Asciidoctor.convert_file File.join(File.dirname(__FILE__), 'sample.adoc'), safe: :unsafe, backend: :html5
90
+ ```
91
+
92
+ ## Use with the [IntelliJ Asciidoc Plugin](https://plugins.jetbrains.com/plugin/7391-asciidoc)
93
+
94
+ If you're not using the excellent Asciidoc plugin then you're really missing out.
95
+ One if it's lesser known features is that it supports Asciidoc extensions written in Ruby:
96
+
97
+ 1. Create a new folder structure in the root of your IntelliJ project called `.asciidoctor/lib`.
98
+ 2. Copy the file `asciidoctor-external-calllout.rb` from this distribution to `.asciidoctor/lib`.
99
+
100
+ Now, when you preview an Asciidoc file with the plugin enabled, external callouts will now show up in the preview.
101
+
102
+ ## Formatting
103
+
104
+ By default, the callout extension will put a single space between callouts that occur on the same line. If you want to adjust this, then you need to create a style that puts a horizontal margin between the callouts:
105
+
106
+ ```css
107
+ div.external-callout-block i.conum {
108
+ margin-left: 10px;
109
+ margin-right: 10px;
110
+ }
111
+ ```
112
+ The callout attaches a class called `external-callout-block` to each source listing it processes. You can use this to differentiate between standard callouts, and callouts written by the extension.
113
+
114
+ The extension also adds a class called `external-callout-list` to the list of definitions at the bottom of the source block. (There's probably no need to adjust the styling for this.)
115
+
116
+ Then to convert a document with a stylesheet, use something like this:
117
+
118
+ ```ruby
119
+ Asciidoctor.convert_file File.join(File.dirname(__FILE__), 'sample.adoc'),
120
+ safe: :unsafe, backend: :html5,
121
+ attributes: {'stylesheet' => './callout.css'}
122
+ ```
84
123
 
85
124
  ## Development
86
125
 
@@ -9,7 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["clogs-wrench-0z@icloud.com"]
10
10
 
11
11
  spec.summary = "Asciidoc extension for adding callouts without marking up the source listing block."
12
- # spec.description = "TODO: Write a longer description or delete this line."
12
+ spec.description = "If you can't add callout markers to your source listing" \
13
+ "(if you need to keep a shell script runnable for example), then use this."
13
14
  spec.homepage = "https://github.com/RayOffiah/asciidoctor-external-callout-ruby"
14
15
  spec.license = "MIT"
15
16
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
@@ -15,6 +15,9 @@ include Asciidoctor
15
15
 
16
16
  Asciidoctor::Extensions::register do
17
17
 
18
+ CALLOUT_SOURCE_BLOCK_ROLE = 'external-callout-block'
19
+ CALLOUT_ORDERED_LIST_ROLE = 'external-callout-list'
20
+
18
21
  LOCATION_TOKEN_RX = /@(\d+)|@\/([^\/]+?)\//
19
22
  LOCATION_TOKEN_ARRAY_RX = /^(@\d+|@\/[^\/]+?\/)((\s+@\d+)|(\s+@\/[^\/]+?\/))*$/
20
23
 
@@ -37,6 +40,9 @@ Asciidoctor::Extensions::register do
37
40
 
38
41
  list.context = :colist
39
42
 
43
+ owner_block.add_role(CALLOUT_SOURCE_BLOCK_ROLE) unless owner_block.has_role?(CALLOUT_SOURCE_BLOCK_ROLE)
44
+ list.add_role(CALLOUT_ORDERED_LIST_ROLE) unless list.has_role?(CALLOUT_ORDERED_LIST_ROLE)
45
+
40
46
  end
41
47
 
42
48
  end
data/lib/version.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Asciidoctor
4
4
  module External
5
5
  module Callout
6
- VERSION = "0.0.6-beta7"
6
+ VERSION = "1.0.0"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-external-callout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6.pre.beta7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Offiah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-11 00:00:00.000000000 Z
11
+ date: 2022-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -24,7 +24,8 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
- description:
27
+ description: If you can't add callout markers to your source listing(if you need to
28
+ keep a shell script runnable for example), then use this.
28
29
  email:
29
30
  - clogs-wrench-0z@icloud.com
30
31
  executables: []
@@ -61,9 +62,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
62
  version: 2.3.0
62
63
  required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  requirements:
64
- - - ">"
65
+ - - ">="
65
66
  - !ruby/object:Gem::Version
66
- version: 1.3.1
67
+ version: '0'
67
68
  requirements: []
68
69
  rubygems_version: 3.2.3
69
70
  signing_key: