Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hyperlinking from schema docs (schemas-only): https://github.com/… #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/suma/schema_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ def output_extensions
"xml"
end

# #.gsub(/[\n\r]{2,}/, '')
# can't use
# :lutaml-express-index: schemas; #{path_to_schema_yaml};
# because that kills any possibility of this file hyperlinking to other schemas
def to_adoc(path_to_schema_yaml)
<<~HEREDOC
= #{@schema.id}
:lutaml-express-index: schemas; #{path_to_schema_yaml};
:lutaml-express-index: schemas; ../../schemas-srl.yml
:bare: true
:mn-document-class: iso
:mn-output-extensions: xml,html
Expand All @@ -79,14 +81,17 @@ def to_adoc(path_to_schema_yaml)
----
{% for schema in context.schemas %}

{% if schema.id == "#{@id}" %}

[[#{@id}]]
[%unnumbered,type=express]
== #{@id} #{schema_anchors.gsub(%r{//[^\r\n]+}, "").gsub(/[\n\r]+/, "").gsub(/^[\n\r]/, "")}

[source%unnumbered]
--
{{ schema.formatted }}
{{ schema.formatted_hyperlinked }}
--
{% endif %}
{% endfor %}
----

Expand Down
Loading