asciidoctor-boost 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9355b1eea374f38aed33615bd5b74055c986371b57f308f4ea7c6bae914021c4
4
+ data.tar.gz: c003523d80b95a77539a75ec91d194b46c190721132c61aaef0e91ce57f37ba1
5
+ SHA512:
6
+ metadata.gz: 88d9c32a04fb56f03d8a72d87bcaf2cd592efc1c832c56d03cf0cd59d2228ca2d5696f4acc0809f3758c18cbefc3026cf5869d2ecf2f69bd546f83e6c966118a
7
+ data.tar.gz: 455970031210e065839c3b3d11709a48e5e404e158422c7a779b438a3a41a638fc20cceb2262052cdc468b2eb81322f31717189a4788a97f94cde7f0109c54d8
@@ -0,0 +1,17 @@
1
+ # Copyright Dave O'Connor 2004 - 2024.
2
+ # Distributed under the Boost Software License, Version 1.0.
3
+ # (See accompanying file LICENSE_1_0.txt or copy at
4
+ # https://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ # frozen_string_literal: true
7
+
8
+ require 'asciidoctor'
9
+ require_relative 'at_link/extension'
10
+ require_relative 'github/extension'
11
+ require_relative 'phrase/extension'
12
+
13
+ Asciidoctor::Extensions.register do
14
+ inline_macro AtLinkInlineMacro
15
+ inline_macro GithubInlineMacro
16
+ inline_macro PhraseInlineMacro
17
+ end
@@ -0,0 +1,21 @@
1
+ # Copyright Dave O'Connor 2004 - 2024.
2
+ # Distributed under the Boost Software License, Version 1.0.
3
+ # (See accompanying file LICENSE_1_0.txt or copy at
4
+ # https://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ # frozen_string_literal: true
7
+
8
+ require 'asciidoctor'
9
+ require 'asciidoctor/extensions'
10
+
11
+ # handles the boost_at: macro
12
+ class AtLinkInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
13
+ use_dsl
14
+ named :boost_at
15
+ name_positional_attributes 'link'
16
+
17
+ def process(parent, target, attrs)
18
+ content = "link:#{target}[#{attrs['link']}]"
19
+ create_inline_pass parent, content
20
+ end
21
+ end
@@ -0,0 +1,26 @@
1
+ # Copyright Dave O'Connor 2004 - 2024.
2
+ # Distributed under the Boost Software License, Version 1.0.
3
+ # (See accompanying file LICENSE_1_0.txt or copy at
4
+ # https://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ # frozen_string_literal: true
7
+
8
+ require 'asciidoctor'
9
+ require 'asciidoctor/extensions'
10
+
11
+ # handles the boost_github: macro
12
+ class GithubInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
13
+ use_dsl
14
+ named :boost_gh
15
+ name_positional_attributes 'repo', 'number'
16
+
17
+ def process(parent, target, attrs)
18
+ content = "Target '#{target}' is invalid, check your syntax. Should be 'issue' or 'pr', not #{target}."
19
+ if target == 'issue'
20
+ content = "https://github.com/boostorg/#{attrs['repo']}/issues/#{attrs['number']}[#{attrs['number']}]"
21
+ elsif target == 'pr'
22
+ content = "https://github.com/boostorg/#{attrs['repo']}/pull/#{attrs['number']}[#{attrs['number']}]"
23
+ end
24
+ create_inline_pass parent, content
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ # Copyright Dave O'Connor 2004 - 2024.
2
+ # Distributed under the Boost Software License, Version 1.0.
3
+ # (See accompanying file LICENSE_1_0.txt or copy at
4
+ # https://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ # frozen_string_literal: true
7
+
8
+ require 'asciidoctor'
9
+ require 'asciidoctor/extensions'
10
+
11
+ # handles the boost_phrase: macro
12
+ class PhraseInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
13
+ use_dsl
14
+ named :boost_phrase
15
+ name_positional_attributes 'text'
16
+
17
+ def process(parent, target, attrs)
18
+ node = create_inline parent, :quoted, attrs['text'], type: :unquoted
19
+ node.add_role target
20
+ node
21
+ end
22
+ end
data/lib/version.rb ADDED
@@ -0,0 +1,10 @@
1
+ # Copyright Dave O'Connor 2004 - 2024.
2
+ # Distributed under the Boost Software License, Version 1.0.
3
+ # (See accompanying file LICENSE_1_0.txt or copy at
4
+ # https://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ # frozen_string_literal: true
7
+
8
+ module Boost
9
+ VERSION = '0.1.0'
10
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asciidoctor-boost
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dave O'Connor
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-10-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '13.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '13.2'
27
+ description: This library contains macros that can be used in Boost documentation.
28
+ email:
29
+ - docgithub@dead-pixels.org
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - lib/asciidoctor_boost.rb
35
+ - lib/at_link/extension.rb
36
+ - lib/github/extension.rb
37
+ - lib/phrase/extension.rb
38
+ - lib/version.rb
39
+ homepage: https://github.com/cppalliance/asciidoctor-boost
40
+ licenses:
41
+ - BSL-1.0
42
+ metadata:
43
+ bug_tracker_uri: https://github.com/cppalliance/asciidoctor-boost/issues
44
+ homepage_uri: https://github.com/cppalliance/asciidoctor-boost
45
+ source_code_uri: https://github.com/cppalliance/asciidoctor-boost
46
+ changelog_uri: https://github.com/cppalliance/asciidoctor-boost/CHANGELOG.md
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 2.4.0
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubygems_version: 3.5.16
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Asciidoctor macros for Boost documentation
66
+ test_files: []