asciidoctor-autoterm 1.0.2 → 1.0.3

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: dcc5c6113c38d85b30990827bb540723c544fca19945081ed308c27ba1a2e7ef
4
- data.tar.gz: cf29b08297c9ddcfbd6c3bd28513dd9264c6d35671ca032ff9cf9a675a0250a9
3
+ metadata.gz: ff2906959fee00ea8375d7f8ba6b777a5f524466753beab968387fae811f2673
4
+ data.tar.gz: d85a73b2d50ce110117e4b10872cceb89db5eb08b5113526ff84a71114fa363a
5
5
  SHA512:
6
- metadata.gz: 8808d90bc9f42c396a2d61fb5d0f5c92d48d378f00b304366a20045865f3fd375beb9c43111ed8816bdf670f8ee3a9d74184373284ae22f4d345545b9e341a15
7
- data.tar.gz: 1f13bed6c62613fc01bc66b9c65f67deea1e72721415eefdee58fa054eec8278f8c1a1afb9f6f121b7397ebebc5dd9fa4ccf5e226f2656a64d29b391b4c49078
6
+ metadata.gz: 83a18e1ea2cf1256fbdd41e79229ada3b3cc7bd5e51e08a5872f9542a25872a059d24b5e10f545eea3fbaddbdf2982ea41b517a2ea733e3e9dae6ea6266ac0ef
7
+ data.tar.gz: 282d1fd97e08e9dfcaba3b9f0b061fdedeac8e5eebdf0c3780330a129440c367b9c90941f664a40418f6535c0b78dca1b9e1a8f90c334ced7795c35c058e256e
data/CHANGELOG.adoc ADDED
@@ -0,0 +1,23 @@
1
+ // REMINDER: After changing this file, copy it to doc/modules/ROOT/pages/changelog.adoc so the published documentation stays in sync. Antora cannot include files that live outside the doc/ component.
2
+ = Changelog
3
+
4
+ All notable changes to `asciidoctor-autoterm` are documented here.
5
+
6
+ == 1.0.3 (2026-07-15)
7
+
8
+ * Ship LICENSE, README.adoc, and CHANGELOG.adoc in the gem; earlier gems contained only the `lib/` sources despite the gemspec declaring the MIT license
9
+ * No code changes
10
+
11
+ == 1.0.2 (2026-06-08)
12
+
13
+ * Repair index paren truncation: AsciiDoc stores `((Full Term (Abbr)))` as "Full Term (Abbr" because the parser matches the first `))`. `repair_index_term_parens` now restores the missing `)` in the regular Index section by appending it to any term name that ends with an unclosed `(`
14
+ * Remove phantom Terminology and Index entries produced by documentation examples: backtick spans do not prevent indexterm processing in asciidoctor-pdf, so live `((indexterm))` examples in index.adoc were indexed; examples now use `+...+` inline passthrough
15
+ * Fix a duplicate CSS entry caused by "Cascading Style Sheets" (plural) diverging from the singular form used in the terminology table
16
+
17
+ == 1.0.1 (2026-06-08)
18
+
19
+ * Fix `collect_terms` dropping every term with an abbreviation: the `((Full Term (Abbr)))` syntax matches the first `))`, storing the term without a closing `)`, but the previous regex required one; the trailing `)` is now optional
20
+
21
+ == 1.0.0 (2026-06-07)
22
+
23
+ * Initial gem release: gemspec and `lib/` layout (`table_roles`, `converter`, `antora_processor`), with rewritten installation documentation and an inline index term demonstration
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 白一百 baiyibai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.adoc ADDED
@@ -0,0 +1,91 @@
1
+ = Antora Asciidoctor Automatic Terminology Generator Extension
2
+
3
+ This extension automatically generates a _Terminology_ section for Asciidoctor-PDF documents using Asciidoctor's built-in https://docs.asciidoctor.org/asciidoc/latest/sections/user-index/[Index] feature.
4
+
5
+ https://baiyibai-antora.gitlab.io
6
+
7
+ This extension achieves three main goals:
8
+
9
+ . To ensure abbreviations are used consistently throughout documentation using the indexterm markup. +
10
+ This encourages authors to fully spell out a term on the first instance, and then use an abbreviated term in subsequent instances.
11
+ . Eliminate manual work.
12
+ . [Optional] Provide additional externally-curated, and centrally-maintained, definitions via a table with the `.terminology` role in the document AST.
13
+
14
+ [#section-asciidoctor-pdf-standalone-usage-instructions]
15
+ == Asciidoctor-PDF Standalone Usage Instructions
16
+
17
+ Complete these steps to use this extension:
18
+
19
+ . Clone this repository, or acquire the `autogen-terminology.rb` and `add-table-roles.rb` files along with the `pdf-themes/table-roles-theme.yml` file.
20
+ . Create an Asciidoctor document using the index terms.
21
+ . Include a table with the `.terminology` role containing definitions. +
22
+ See xref:terminology-definitions.adoc[] for an example of the markup. +
23
+ The table should be included in your document using the `include` directive with tags:
24
+ +
25
+ [source,asciidoc]
26
+ ----
27
+ include::terminology-definitions.adoc[tags=terminology]
28
+ ----
29
+ +
30
+ To control whether custom definitions are used, set the document attribute:
31
+ +
32
+ [source,asciidoc]
33
+ ----
34
+ :terminology-use-definitions: true
35
+ ----
36
+ +
37
+ [NOTE]
38
+ ====
39
+ - When custom terminology definitions are disabled (`:terminology-use-definitions: false` or not set), only index terms with abbreviations in parentheses (e.g., `((Application Programming Interface (API)))`) are included in the terminology section.
40
+ - When enabled (`:terminology-use-definitions: true`), the table with `.terminology` role will be parsed from the AST and hidden from the rendered output using the table role extension and theme.
41
+ - The `:terminology-use-definitions:` attribute defaults to `false` if not specified.
42
+ ====
43
+ +
44
+ . [[add-two-sections, Add Two Sections]][Asciidoctor-PDF Users] Create two sections at the end of the document, assigning one the `[type=terminology]` block attribute:
45
+ +
46
+ [source]
47
+ ----
48
+ include::antora-asciidoctor-autoterm.adoc[tag=auto-terminology-markup]
49
+ ----
50
+ +
51
+ [NOTE]
52
+ The title of the sections is not fixed.
53
+ +
54
+ . Copy the `pdf-themes/table-roles-theme.yml` file or create a theme that hides tables with the `.terminology` role.
55
+ . Render the document with this command:
56
+ +
57
+ [source,bash]
58
+ ----
59
+ asciidoctor-pdf -r ./add-table-roles.rb -r ./autogen-terminology.rb \
60
+ -a pdf-theme=table-roles -a pdf-themesdir=pdf-themes \
61
+ antora-asciidoctor-autoterm.adoc
62
+ ----
63
+
64
+ == Antora Assembler w/Asciidoctor-PDF Usage Instructions
65
+
66
+ Antora Assembler users require an additional extension to add the Terminology and the Index, complete these steps:
67
+
68
+ . Complete the steps in <<section-asciidoctor-pdf-standalone-usage-instructions>> until <<add-two-sections>>. +
69
+ Skip that step and instead add the file xref:antora-assembler-add-terminology-and-index.rb[] to execution directory.
70
+ .. To remove section numbering, uncomment out the specified lines.
71
+ . Add `-r add-table-roles.rb`, `-r antora-assembler-add-terminology-and-index.rb`, and `-r autogen-terminology.rb` to the `antora-assembler.yml`'s `build/command` section, or use `require_relative` for each file.
72
+ . Add the PDF theme attributes: `-a pdf-theme=table-roles -a pdf-themesdir=pdf-themes` (adjust paths as needed)
73
+ . Add two document attributes to either the `antora.yml` or `antora-assembler.yml` file:
74
+ +
75
+ ** `include-terminology: true`
76
+ ** `include-index: true`
77
+ +
78
+ [NOTE]
79
+ ====
80
+ Enable/disable those attributes as desired.
81
+ ====
82
+ +
83
+ . Render the Antora project.
84
+
85
+ === Antora Assembler Background
86
+
87
+ More information on using the Index with Antora Assembler is available at these links:
88
+
89
+ * https://antora.zulipchat.com/#narrow/channel/282400-users/topic/Possible.20to.20have.20a.20site-wide.20catchword.20index/near/446306647[^]
90
+ * https://gitlab.com/antora/antora-assembler/-/issues/51[^]
91
+
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Autoterm
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-autoterm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - baiyibai
@@ -45,6 +45,9 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - CHANGELOG.adoc
49
+ - LICENSE
50
+ - README.adoc
48
51
  - lib/asciidoctor-autoterm.rb
49
52
  - lib/asciidoctor/autoterm/antora_processor.rb
50
53
  - lib/asciidoctor/autoterm/converter.rb