From 3e96eaa1c99b5b6973655fb0f6177d1f20d082d7 Mon Sep 17 00:00:00 2001 From: Rob Vesse Date: Wed, 27 Sep 2023 14:35:09 +0100 Subject: [PATCH] Don't use linebreaks filter in Markdown templates (#64) The Markdown Django templates were using the linebreaks filter on some of the content. This filter wraps content using

and
. However this means that if the ontology was using Markdown in their comments this would not get rendered as most Markdown renderers don't apply rendering inside of HTML block elements like

. It was also unnecessary since Markdown renderers already use line breaks to suitably render paragraphs. This was most applicable for descriptions of things since those are the places were ontology authors were most likely to want to use Markdown to explain the intended usage of their ontology concepts. By removing the use of this filter the ontology descriptions are output as-is in the generated Markdown files allowing any Markdown in them to be rendered by whatever Markdown renderer the user ultimately chooses. --- ontospy/gendocs/media/templates/markdown/markdown_classinfo.md | 2 +- .../gendocs/media/templates/markdown/markdown_conceptinfo.md | 2 +- .../gendocs/media/templates/markdown/markdown_individualinfo.md | 2 +- ontospy/gendocs/media/templates/markdown/markdown_propinfo.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ontospy/gendocs/media/templates/markdown/markdown_classinfo.md b/ontospy/gendocs/media/templates/markdown/markdown_classinfo.md index 4a9edc4..f1266cd 100755 --- a/ontospy/gendocs/media/templates/markdown/markdown_classinfo.md +++ b/ontospy/gendocs/media/templates/markdown/markdown_classinfo.md @@ -40,7 +40,7 @@ {{each.uri}} #### Description -{{each.bestDescription()|linebreaks|default("--")}} +{{each.bestDescription()|default("--")}} {% if each.ancestors() %} diff --git a/ontospy/gendocs/media/templates/markdown/markdown_conceptinfo.md b/ontospy/gendocs/media/templates/markdown/markdown_conceptinfo.md index 858a1d3..bba6296 100755 --- a/ontospy/gendocs/media/templates/markdown/markdown_conceptinfo.md +++ b/ontospy/gendocs/media/templates/markdown/markdown_conceptinfo.md @@ -40,7 +40,7 @@ {{each.uri}} #### Description -{{each.bestDescription()|linebreaks|default("--")}} +{{each.bestDescription()|default("--")}} {% if each.ancestors() %} diff --git a/ontospy/gendocs/media/templates/markdown/markdown_individualinfo.md b/ontospy/gendocs/media/templates/markdown/markdown_individualinfo.md index 38ba4ca..1dd1af1 100755 --- a/ontospy/gendocs/media/templates/markdown/markdown_individualinfo.md +++ b/ontospy/gendocs/media/templates/markdown/markdown_individualinfo.md @@ -13,7 +13,7 @@ {{each.uri}} #### Description -{{each.bestDescription()|linebreaks|default("--")}} +{{each.bestDescription()|default("--")}} {% if each.instance_of %} diff --git a/ontospy/gendocs/media/templates/markdown/markdown_propinfo.md b/ontospy/gendocs/media/templates/markdown/markdown_propinfo.md index 27869f8..cceaa9c 100755 --- a/ontospy/gendocs/media/templates/markdown/markdown_propinfo.md +++ b/ontospy/gendocs/media/templates/markdown/markdown_propinfo.md @@ -40,7 +40,7 @@ {{each.uri}} #### Description -{{each.bestDescription()|linebreaks|default("--")}} +{{each.bestDescription()|default("--")}} {% if each.ancestors() %} #### Inherits from ({{ each.ancestors()|length }})