Skip to content

Commit

Permalink
Show setting description if no article exists
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
Ghostkeeper committed Sep 7, 2019
1 parent 0f4d996 commit 59ca054
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CuraSettingsGuide.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"!\[(.*)\]\((.+)\)")
Expand Down

0 comments on commit 59ca054

Please sign in to comment.