In AnQi CMS, the addition of the Markdown editor undoubtedly brings great convenience to content creation, especially for users who need to write technical documents, academic papers, or complex instructions. The ability to directly insert mathematical formulas (MathJax) and flowcharts (Mermaid) is a feature that adds even more luster.However, whether additional CDN resources are needed to support the display of these advanced Markdown elements is a consideration many users will have before using them.

In simple terms, when you input a complex mathematical formula, such as$$ \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} $$or a Mermaid flowchart code block, likemermaid graph TD; A-->B; B-->C;The CMS will store it as plain text content in the database.When the user accesses the page containing this content through a browser, the browser still receives the original Markdown text.If the page does not load the corresponding JavaScript library to “translate” and “draw” these special syntaxes, the user will only see the original Markdown code, not the rendered formulas or charts.

This is where CDN resources come into play.MathJax and Mermaid are mature open-source JavaScript libraries that need to be loaded into the user's browser to perform rendering tasks.To ensure that these libraries can be loaded quickly and stably by users worldwide, it is highly recommended to introduce the service of Content Delivery Network (CDN).CDN distributes resources across various server nodes globally, allowing users to retrieve the required files from the nearest server, significantly speeding up loading times and enhancing website stability and user experience.

AnQi CMS is very flexible, it does not force-bond specific versions of MathJax or Mermaid libraries, but provides guidance for integrating external CDNs. This means that you only need to add it to the common template file of the website (usuallybase.html) of<head>or<body>Tag inside, add a few lines according to the examples provided in the official documentation to include the MathJax and Mermaid libraries.<script>or<link>Tag it.These tags will point to the corresponding library files hosted on CDNs, such as resources from well-known CDN service providers like jsDelivr or Cloudflare.In this way, your website can "tell" the user's browser where to download these necessary rendering scripts.

After enabling the Markdown editor, to ensure that these advanced features are presented perfectly, simply enable the Markdown editor in the AnQi CMS backend global settings, and then follow the instructions to add the corresponding CDN reference code in your template file.This is a one-time setting, after which, all Markdown content containing MathJax or Mermaid syntax will be correctly rendered.Although technically you can download these JavaScript library files to your own server for local hosting, considering the advantages of CDNs in terms of loading speed, bandwidth optimization, and global access, using a CDN is undoubtedly the better choice and can significantly enhance the professionalism and user satisfaction of your website.

Common Questions (FAQ)

What are the implications if I do not add CDN references for MathJax and Mermaid in the template?If your website content includes MathJax or Mermaid syntax but you have not referenced the corresponding CDN resources in the template, users will not be able to see the rendered mathematical formulas or flowcharts when accessing these pages.They will only see the original Markdown syntax text, which will severely affect the reading experience and professionalism of the content.

2. Can I download the MathJax and Mermaid library files to my local server for hosting?

3. Is it complex to add CDN references for MathJax and Mermaid in the AnQi CMS?At all not complicated.The Anqi CMS provides clear guidance for this.base.html),to the few lines of CDN provided in the official documentation<script>or<link>Copy the tag code and paste it into the template file<head>or<body>before the end tag. This is a very simple copy and paste operation, no in-depth programming knowledge is required.