metanorma-standoc 1.6.0 → 1.6.5
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 +4 -4
- data/.github/workflows/rake.yml +66 -0
- data/README.adoc +1 -3
- data/lib/asciidoctor/standoc/base.rb +8 -16
- data/lib/asciidoctor/standoc/basicdoc.rng +32 -0
- data/lib/asciidoctor/standoc/cleanup.rb +52 -4
- data/lib/asciidoctor/standoc/cleanup_block.rb +41 -4
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +14 -0
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +25 -0
- data/lib/asciidoctor/standoc/cleanup_inline.rb +6 -2
- data/lib/asciidoctor/standoc/cleanup_ref.rb +18 -25
- data/lib/asciidoctor/standoc/cleanup_terms.rb +3 -0
- data/lib/asciidoctor/standoc/converter.rb +61 -3
- data/lib/asciidoctor/standoc/front.rb +9 -3
- data/lib/asciidoctor/standoc/front_contributor.rb +34 -10
- data/lib/asciidoctor/standoc/isodoc.rng +29 -44
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +45 -63
- data/lib/asciidoctor/standoc/macros_terms.rb +82 -0
- data/lib/asciidoctor/standoc/ref.rb +24 -36
- data/lib/asciidoctor/standoc/ref_sect.rb +16 -8
- data/lib/asciidoctor/standoc/section.rb +5 -9
- data/lib/asciidoctor/standoc/table.rb +12 -0
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +86 -0
- data/lib/liquid/custom_blocks/with_json_nested_context.rb +18 -0
- data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +19 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +6 -3
- data/spec/asciidoctor-standoc/base_spec.rb +127 -8
- data/spec/asciidoctor-standoc/blocks_spec.rb +8 -8
- data/spec/asciidoctor-standoc/cleanup_sections_spec.rb +1514 -0
- data/spec/asciidoctor-standoc/cleanup_spec.rb +450 -1554
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +22 -31
- data/spec/asciidoctor-standoc/lists_spec.rb +10 -1
- data/spec/asciidoctor-standoc/macros_json2text_spec.rb +1 -1
- data/spec/asciidoctor-standoc/macros_lutaml_spec.rb +80 -0
- data/spec/asciidoctor-standoc/macros_plantuml_spec.rb +307 -0
- data/spec/asciidoctor-standoc/macros_spec.rb +378 -169
- data/spec/asciidoctor-standoc/macros_yaml2text_spec.rb +1 -1
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +8 -8
- data/spec/asciidoctor-standoc/refs_spec.rb +350 -101
- data/spec/asciidoctor-standoc/section_spec.rb +11 -11
- data/spec/asciidoctor-standoc/table_spec.rb +86 -0
- data/spec/asciidoctor-standoc/validate_spec.rb +26 -0
- data/spec/fixtures/diagram_definitions.lutaml +22 -0
- data/spec/fixtures/test.exp +121 -0
- data/spec/spec_helper.rb +33 -0
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +156 -4
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +49 -233
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -58
- data/spec/vcr_cassettes/isobib_get_123_1.yml +27 -119
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +361 -0
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -58
- data/spec/vcr_cassettes/isobib_get_124.yml +11 -57
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +276 -158
- metadata +61 -14
- data/.github/workflows/macos.yml +0 -41
- data/.github/workflows/ubuntu.yml +0 -45
- data/.github/workflows/windows.yml +0 -43
- data/lib/asciidoctor/standoc/base_structured_text_preprocessor.rb +0 -123
- data/lib/asciidoctor/standoc/json2_text_preprocessor.rb +0 -44
- data/lib/asciidoctor/standoc/yaml2_text_preprocessor.rb +0 -46
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "asciidoctor/standoc/base_structured_text_preprocessor"
|
4
|
-
|
5
|
-
module Asciidoctor
|
6
|
-
module Standoc
|
7
|
-
class Json2TextPreprocessor < BaseStructuredTextPreprocessor
|
8
|
-
# search document for block `yaml2text`
|
9
|
-
# after that take template from block and read file into this template
|
10
|
-
# example:
|
11
|
-
# [yaml2text,foobar.yaml]
|
12
|
-
# ----
|
13
|
-
# === {item.name}
|
14
|
-
# {item.desc}
|
15
|
-
#
|
16
|
-
# {item.symbol}:: {item.symbol_def}
|
17
|
-
# ----
|
18
|
-
#
|
19
|
-
# with content of `foobar.yaml` file equal to:
|
20
|
-
# - name: spaghetti
|
21
|
-
# desc: wheat noodles of 9mm diameter
|
22
|
-
# symbol: SPAG
|
23
|
-
# symbol_def: the situation is message like spaghetti at a kid's
|
24
|
-
#
|
25
|
-
# will produce:
|
26
|
-
# === spaghetti
|
27
|
-
# wheat noodles of 9mm diameter
|
28
|
-
#
|
29
|
-
# SPAG:: the situation is message like spaghetti at a kid's meal
|
30
|
-
|
31
|
-
def initialize(config = {})
|
32
|
-
super
|
33
|
-
@config[:block_name] = "json2text"
|
34
|
-
end
|
35
|
-
|
36
|
-
protected
|
37
|
-
|
38
|
-
def content_from_file(document, file_path)
|
39
|
-
JSON.parse(File.read(relative_file_path(document, file_path),
|
40
|
-
encoding: "UTF-8"))
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "asciidoctor/standoc/base_structured_text_preprocessor"
|
4
|
-
|
5
|
-
module Asciidoctor
|
6
|
-
module Standoc
|
7
|
-
class Yaml2TextPreprocessor < BaseStructuredTextPreprocessor
|
8
|
-
# search document for block `yaml2text`
|
9
|
-
# after that take template from block and read file into this template
|
10
|
-
# example:
|
11
|
-
# [yaml2text,foobar.yaml]
|
12
|
-
# ----
|
13
|
-
# === {item.name}
|
14
|
-
# {item.desc}
|
15
|
-
#
|
16
|
-
# {item.symbol}:: {item.symbol_def}
|
17
|
-
# ----
|
18
|
-
#
|
19
|
-
# with content of `foobar.yaml` file equal to:
|
20
|
-
# - name: spaghetti
|
21
|
-
# desc: wheat noodles of 9mm diameter
|
22
|
-
# symbol: SPAG
|
23
|
-
# symbol_def: the situation is message like spaghetti at a kid's
|
24
|
-
#
|
25
|
-
# will produce:
|
26
|
-
# === spaghetti
|
27
|
-
# wheat noodles of 9mm diameter
|
28
|
-
#
|
29
|
-
# SPAG:: the situation is message like spaghetti at a kid's meal
|
30
|
-
|
31
|
-
def initialize(config = {})
|
32
|
-
super
|
33
|
-
@config[:block_name] = "yaml2text"
|
34
|
-
end
|
35
|
-
|
36
|
-
protected
|
37
|
-
|
38
|
-
def content_from_file(document, file_path)
|
39
|
-
YAML.safe_load(
|
40
|
-
File.read(relative_file_path(document, file_path),
|
41
|
-
encoding: "UTF-8"),
|
42
|
-
[Date, Time])
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|