Reuse content¶
You can use the pymdownx.snippets Markdown extension to include Markdown and other content in a page. For example, you can include common admonitions from a central location. Another common use is to centralize link definitions and abbreviations. When you need to make a change, you can update the definition in one place instead of changing many pages.
This is a clear benefit, but it is important that you can inspect included content and its uses without trawling through the entire project. At the same time, you may want to see the assembled page in your editing environment without having to start a build. Zensical Studio supports both.
Example project
This workflow uses the project in zensical-example-project.zip; the same reuse features work in any project.
Navigate to included content¶
Cmd/Ctrl-click the path after a snippet include (--8<--), or use Go to DefinitionF12. Zensical Studio opens up the snippet file and, if there is a fragment identifier, places the cursor on the corresponding fragment.
Note how the annotation above the fragment says that it is referenced three times in the project. Clicking on this annotation opens an overlay that allows you to preview the locations where the snippet is used. You can double-click on one of them to open the location.
Preview pages with snippets¶
Zensical Studio's Markdown preview resolves snippet includes, even nested ones. Instead of seeing your page with the snippet syntax and having to switch to a different editor, you can see what the end result of the snippet resolution is: a complete rendered page.
Take workspace-settings.md, for example. It includes both an admonition about admin rights and a "Need help" section at the end. If you open the Markdown preview and navigate to the locations of the snippet includes, you will see that the included content is rendered in the page.
Find reuse connections¶
The Connections panel shows you where a snippet is included within a page or within another snippet. This lets you navigate to the places where the snippet is used:


