-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#41 new collection of macroses:
lutaml_table_package
, `lutaml_table…
…_class`, `lutaml_table_enum`, `lutaml_table_data_type`, lookup xmi entities in the document by their name
- Loading branch information
1 parent
ba23df1
commit 8abbbf0
Showing
25 changed files
with
1,458 additions
and
1,137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/metanorma/plugin/lutaml/lutaml_table_class_inline_macro.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Metanorma | ||
module Plugin | ||
module Lutaml | ||
class LutamlTableClassInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor | ||
include LutamlDiagramBase | ||
|
||
use_dsl | ||
named :lutaml_table_class | ||
|
||
def process(parent, _target, attrs) | ||
entity_key = ['class', attrs["package"], attrs["name"]].compact.join(":") | ||
return if parent.document.attributes['lutaml_entity_id'].nil? | ||
xmi_id = parent.document.attributes['lutaml_entity_id'][entity_key] | ||
return unless xmi_id | ||
|
||
%Q(<xref target="section-#{xmi_id}"></xref>) | ||
end | ||
end | ||
end | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
lib/metanorma/plugin/lutaml/lutaml_table_data_type_inline_macro.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Metanorma | ||
module Plugin | ||
module Lutaml | ||
class LutamlTableDataTypeInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor | ||
include LutamlDiagramBase | ||
|
||
use_dsl | ||
named :lutaml_table_data_type | ||
|
||
def process(parent, _target, attrs) | ||
entity_key = ['data_type', attrs["package"], attrs["name"]].compact.join(":") | ||
return if parent.document.attributes['lutaml_entity_id'].nil? | ||
xmi_id = parent.document.attributes['lutaml_entity_id'][entity_key] | ||
return unless xmi_id | ||
|
||
%Q(<xref target="section-#{xmi_id}"></xref>) | ||
end | ||
end | ||
end | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
lib/metanorma/plugin/lutaml/lutaml_table_enum_inline_macro.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Metanorma | ||
module Plugin | ||
module Lutaml | ||
class LutamlTableEnumInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor | ||
include LutamlDiagramBase | ||
|
||
use_dsl | ||
named :lutaml_table_enum | ||
|
||
def process(parent, _target, attrs) | ||
entity_key = ['enum', attrs["package"], attrs["name"]].compact.join(":") | ||
return if parent.document.attributes['lutaml_entity_id'].nil? | ||
xmi_id = parent.document.attributes['lutaml_entity_id'][entity_key] | ||
return unless xmi_id | ||
|
||
%Q(<xref target="section-#{xmi_id}"></xref>) | ||
end | ||
end | ||
end | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
lib/metanorma/plugin/lutaml/lutaml_table_package_inline_macro.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module Metanorma | ||
module Plugin | ||
module Lutaml | ||
class LutamlTablePackageInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor | ||
include LutamlDiagramBase | ||
|
||
use_dsl | ||
named :lutaml_table_package | ||
|
||
def process(parent, _target, attrs) | ||
return if parent.document.attributes['lutaml_entity_id'].nil? | ||
xmi_id = parent.document.attributes['lutaml_entity_id'][attrs["package"]] | ||
return unless xmi_id | ||
|
||
%Q(<xref target="section-#{xmi_id}"></xref>) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.