From 58258443dcbef44efbf254d84a993d24a5249b6f Mon Sep 17 00:00:00 2001 From: Rashif Ray Rahman Date: Sat, 15 Nov 2025 01:09:10 +0600 Subject: [PATCH 1/2] fix: AsciiDoc sectioning and misplaced captions - some table captions were coming up as orphan text in the next sections - subsection styling did not look right, requiring one more depth level - get rid of unnecessary whitespaces as the rendered doc has too much --- dqgen/resources/asciidoc_templates/instance.jinja2 | 5 ++--- dqgen/resources/asciidoc_templates/main.jinja2 | 3 --- dqgen/resources/asciidoc_templates/property.jinja2 | 5 ++--- .../resources/asciidoc_templates/reified_property.jinja2 | 5 ++--- dqgen/resources/asciidoc_templates/static/macros.adoc | 8 ++------ dqgen/resources/asciidoc_templates/statistics.jinja2 | 5 +---- 6 files changed, 9 insertions(+), 22 deletions(-) diff --git a/dqgen/resources/asciidoc_templates/instance.jinja2 b/dqgen/resources/asciidoc_templates/instance.jinja2 index f7a668f..37d6124 100644 --- a/dqgen/resources/asciidoc_templates/instance.jinja2 +++ b/dqgen/resources/asciidoc_templates/instance.jinja2 @@ -7,7 +7,7 @@ {% call mc.render_fetch_results(content, error) %} {% set compress_uris = simplify_uri_columns_in_tabular(data_frame=content,namespace_inventory=namespaces,error_fail=False) %} {% endraw %} -== {{ operation|title }} {{ class_name }}s +=== {{ operation|title }} {{ class_name }}s The table below lists the {{ operation }} *{{ cls }}* @@ -17,5 +17,4 @@ The table below lists the {{ operation }} *{{ cls }}* {% raw %} {% endcall %} {% endif %} - {% endraw %} - +{% endraw %} diff --git a/dqgen/resources/asciidoc_templates/main.jinja2 b/dqgen/resources/asciidoc_templates/main.jinja2 index 7abb31b..9a86e8d 100644 --- a/dqgen/resources/asciidoc_templates/main.jinja2 +++ b/dqgen/resources/asciidoc_templates/main.jinja2 @@ -3,7 +3,6 @@ {% import "macros.adoc" as mc %} {% block content %} {% endraw %} - This report is automatically generated from the {% raw %}{{ conf.dataset_name }}{% endraw %} RDF dataset on {% raw %}{{ conf.timestamp }}{% endraw %} and aims at presenting the difference between two versions of an RDFS/OWL vocabulary following the {% raw %}{{ conf.application_profile }}{% endraw %} application profile. @@ -42,8 +41,6 @@ and aims at presenting the difference between two versions of an RDFS/OWL vocabu {% endfor %} {% raw %} == Prefixes - {{ mc.render_namespaces(namespaces.namespaces_as_dict()) }} {% endblock %} {% endraw %} - diff --git a/dqgen/resources/asciidoc_templates/property.jinja2 b/dqgen/resources/asciidoc_templates/property.jinja2 index 85a0ba4..5634dd0 100644 --- a/dqgen/resources/asciidoc_templates/property.jinja2 +++ b/dqgen/resources/asciidoc_templates/property.jinja2 @@ -7,7 +7,7 @@ {% call mc.render_fetch_results(content, error) %} {% set compress_uris = simplify_uri_columns_in_tabular(data_frame=content,namespace_inventory=namespaces,error_fail=False) %} {% endraw %} -=== {{ operation|title }} {{ property_name }} +==== {{ operation|title }} {{ property_name }} The table below lists the {{ operation }} *{{ property }}* @@ -17,5 +17,4 @@ The table below lists the {{ operation }} *{{ property }}* {% raw %} {% endcall %} {% endif %} - {% endraw %} - +{% endraw %} diff --git a/dqgen/resources/asciidoc_templates/reified_property.jinja2 b/dqgen/resources/asciidoc_templates/reified_property.jinja2 index 6177bd7..e01745e 100644 --- a/dqgen/resources/asciidoc_templates/reified_property.jinja2 +++ b/dqgen/resources/asciidoc_templates/reified_property.jinja2 @@ -7,7 +7,7 @@ {% call mc.render_fetch_results(content, error) %} {% set compress_uris = simplify_uri_columns_in_tabular(data_frame=content,namespace_inventory=namespaces,error_fail=False) %} {% endraw %} -=== {{ operation|title }} reified {{ property_name }} +==== {{ operation|title }} reified {{ property_name }} The table below lists the {{ operation }} *{{ property }} / {{ object_property }}* @@ -17,5 +17,4 @@ The table below lists the {{ operation }} *{{ property }} / {{ object_property } {% raw %} {% endcall %} {% endif %} - {% endraw %} - +{% endraw %} diff --git a/dqgen/resources/asciidoc_templates/static/macros.adoc b/dqgen/resources/asciidoc_templates/static/macros.adoc index 6019175..0f3fd58 100644 --- a/dqgen/resources/asciidoc_templates/static/macros.adoc +++ b/dqgen/resources/asciidoc_templates/static/macros.adoc @@ -21,10 +21,10 @@ {% endif %} {%- endmacro %} - {% macro pandas_table(df, caption, column_labels={}) -%} {% if (df is defined) and (df is not none) %} {% set df = df.fillna(value="") %} +.{{ caption }} [cols="{{ df.columns|length }}*", options="header"] |=== {% for column in df.columns %} @@ -47,8 +47,6 @@ {% endfor %} |=== - -.{{ caption }} {% else %} {{ render_error("How did you get here? did you forget to use 'render_fetch_results' macro?") }} {% endif %} @@ -63,6 +61,7 @@ {% endmacro %} {% macro render_namespaces(namesapces_dist) %} +.Prefixes [cols="1,3", options="header"] |=== |Namespace @@ -74,7 +73,4 @@ {% endfor %} |=== - -.Prefixes {% endmacro %} - diff --git a/dqgen/resources/asciidoc_templates/statistics.jinja2 b/dqgen/resources/asciidoc_templates/statistics.jinja2 index 36ad493..5993789 100644 --- a/dqgen/resources/asciidoc_templates/statistics.jinja2 +++ b/dqgen/resources/asciidoc_templates/statistics.jinja2 @@ -2,7 +2,6 @@ {% import "macros.adoc" as mc %} {% endraw %} == Statistics - {% for class_key , class_data in data_source.items() %} === {{ class_data.label }} {% if class_data.description is not undefined %} @@ -52,6 +51,4 @@ {% endfor %} {% endfor %} |=== - - {% endfor %} - +{% endfor %} From 7057bc9709cd05594ebd985ca210a7351334f933 Mon Sep 17 00:00:00 2001 From: Rashif Ray Rahman Date: Sat, 15 Nov 2025 01:38:10 +0600 Subject: [PATCH 2/2] refactor: remove unimportant descriptions before tables in AsciiDoc --- dqgen/resources/asciidoc_templates/instance.jinja2 | 5 ----- dqgen/resources/asciidoc_templates/property.jinja2 | 5 ----- dqgen/resources/asciidoc_templates/reified_property.jinja2 | 5 ----- 3 files changed, 15 deletions(-) diff --git a/dqgen/resources/asciidoc_templates/instance.jinja2 b/dqgen/resources/asciidoc_templates/instance.jinja2 index 37d6124..de27817 100644 --- a/dqgen/resources/asciidoc_templates/instance.jinja2 +++ b/dqgen/resources/asciidoc_templates/instance.jinja2 @@ -8,11 +8,6 @@ {% set compress_uris = simplify_uri_columns_in_tabular(data_frame=content,namespace_inventory=namespaces,error_fail=False) %} {% endraw %} === {{ operation|title }} {{ class_name }}s - -The table below lists the {{ operation }} *{{ cls }}* - -*Query identifier:* {{ query_file }} - {{ "{{" }} mc.pandas_table(content, "{{ operation|title }} {{ class_name }}s") {{ "}}" }} {% raw %} {% endcall %} diff --git a/dqgen/resources/asciidoc_templates/property.jinja2 b/dqgen/resources/asciidoc_templates/property.jinja2 index 5634dd0..e206ef2 100644 --- a/dqgen/resources/asciidoc_templates/property.jinja2 +++ b/dqgen/resources/asciidoc_templates/property.jinja2 @@ -8,11 +8,6 @@ {% set compress_uris = simplify_uri_columns_in_tabular(data_frame=content,namespace_inventory=namespaces,error_fail=False) %} {% endraw %} ==== {{ operation|title }} {{ property_name }} - -The table below lists the {{ operation }} *{{ property }}* - -*Query identifier:* {{ query_file }} - {{ "{{" }} mc.pandas_table(content, "{{ operation|title }} {{ property_name }}") {{ "}}" }} {% raw %} {% endcall %} diff --git a/dqgen/resources/asciidoc_templates/reified_property.jinja2 b/dqgen/resources/asciidoc_templates/reified_property.jinja2 index e01745e..31a5ae1 100644 --- a/dqgen/resources/asciidoc_templates/reified_property.jinja2 +++ b/dqgen/resources/asciidoc_templates/reified_property.jinja2 @@ -8,11 +8,6 @@ {% set compress_uris = simplify_uri_columns_in_tabular(data_frame=content,namespace_inventory=namespaces,error_fail=False) %} {% endraw %} ==== {{ operation|title }} reified {{ property_name }} - -The table below lists the {{ operation }} *{{ property }} / {{ object_property }}* - -*Query identifier:* {{ query_file }} - {{ "{{" }} mc.pandas_table(content, "{{ operation|title }} reified {{ property_name }}") {{ "}}" }} {% raw %} {% endcall %}