From 59ca054dbf3369e398c5fb893b93718fbed0bd76 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Sun, 8 Sep 2019 00:26:06 +0200 Subject: [PATCH] Show setting description if no article exists Turns out that italics can't be shown though. Too bad, so it won't be easy to see any more whether or not an article exists... --- CuraSettingsGuide.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CuraSettingsGuide.py b/CuraSettingsGuide.py index 94ce206d7..9fc8eac25 100644 --- a/CuraSettingsGuide.py +++ b/CuraSettingsGuide.py @@ -136,7 +136,10 @@ def _getArticle(self, article_id) -> List[List[str]]: with open(markdown_file, encoding="utf-8") as f: markdown_str = f.read() except OSError: #File doesn't exist or is otherwise not readable. - markdown_str = "There is no article on this topic." + if article_id in self._container_stack.getAllKeys(): + markdown_str = self._container_stack.getProperty(article_id, "description") #Use the setting description as fallback. + else: + markdown_str = "There is no article on this topic." images_path = os.path.join(os.path.dirname(__file__), "resources", "articles") find_images = re.compile(r"!\[(.*)\]\((.+)\)")