How to enable Markdown editor in AnQiCMS background content settings to support mathematical formulas and flowcharts?

Calendar 👁️ 65

As an experienced website operation expert, I am more than happy to elaborate on how to enable the Markdown editor in the AnQiCMS backend content settings, support mathematical formulas and flowcharts, and help you create high-quality content more efficiently.


Unlock AnQiCMS content creation new dimension: easily enable Markdown, mathematical formulas and flowcharts

In the era where content is king, efficient and expressive content creation tools are particularly important.For AnQiCMS users, whether it is to write technical tutorials, publish product descriptions, or share academic knowledge, being able to flexibly use Markdown syntax, clearly present mathematical formulas, and intuitively draw flowcharts can undoubtedly greatly enhance the professionalism and attractiveness of the content.AnQiCMS is well aware of this need and has provided good support for the Markdown editor in the new version.This article will guide you in detail on how to enable these powerful features, giving your content creation a powerful boost.

First step: Enable Markdown editor in AnQiCMS backend

The process of turning on the Markdown editor is very intuitive. Please log in to the AnQiCMS management background and follow the path below:

First, click on the left-hand navigation bar titledBackend settings Next, select from the dropdown menu titledContent settings On the "Content Settings" page, you will find a field namedEnable Markdown EditorOption. Please check or switch it to 'On' status.

After completing this operation, when you enter the "Content ManagementThis means you can start writing content using Markdown syntax, including titles, lists, code blocks, links, images, etc., the editor will automatically preview the rendering effect for you in real time, greatly improving writing efficiency and consistency in layout.

Step 2: Integrate front-end rendering support for mathematical formulas and flow charts

Although the AnQiCMS backend has enabled the Markdown editor and can parse Markdown syntax into HTML, to make the browser correctly display complex mathematical formulas (such as LaTeX syntax) and flowcharts (such as Mermaid syntax), it is still necessary to introduce the corresponding JavaScript libraries for client-side rendering on the website front-end. This usually involves modifying some of the website template files, especially those responsible for the common parts of the page (such as the header or footer).base.htmlfile.

You need to enter the AnQiCMS template file directory to make these changes. According to the AnQiCMS template making conventions, the root directory of the template is usually located/templatebelow, whilebase.htmlFiles are generally the basic templates used by all pages. You can find and edit it through FTP tools or the 'Template Design' feature of AnQiCMS backend.

Please add the following code snippet tobase.htmlthe file<head>inside the tag. Typically, the inclusion of JavaScript libraries is placed in</body>Before the tag can optimize the page loading speed, but considering that mathematical formulas and flowcharts may need to be parsed when the page is loaded, put them in<head>and make use ofasyncThe attribute can ensure timely loading and rendering.

  1. Introduce the default Markdown style (optional but recommended):Although AnQiCMS has already converted Markdown content to HTML, to achieve a more aesthetically pleasing and GitHub-style display, you can introduce a set of CSS styles.

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
    

    This code will introduce GitHub-style Markdown rendering CSS, making your Markdown content display uniformly and beautifully on the front end.cdnjs.cloudflare.comIt is a commonly used public CDN that can accelerate resource loading.

  2. Integrated MathJax (MathJax):MathJax is a powerful JavaScript rendering engine that can render mathematical formulas in TeX, LaTeX, MathML, and other formats with high-quality typesetting.

    <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
    

    By introducing the MathJax script, your page will be able to recognize and render mathematical formulas in Markdown. For example, by using a single dollar sign$to enclose text as$E=mc^2$It will be rendered as an inline formula, using double dollar signs$$to enclose text as$$ \sum_{i=1}^{n} i = \frac{n(n+1)}{2} $$It will be rendered as a block-level formula.

  3. Integrated flowchart (Mermaid):Mermaid is a JavaScript-based chart and diagram tool that uses a Markdown-like text definition to quickly generate flowcharts, sequence diagrams, Gantt charts, and more.

    <script type="module">
        import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
        mermaid.initialize({ startOnLoad: true });
    </script>
    

    This script will introduce the Mermaid library.Once integrated, you can draw flowcharts in Markdown content using a specific text format.

    ```mermaid
    graph TD;
        A-->B;
        B-->C;
        C-->D;
    ```
    

    Mermaid will automatically parse and render it into a visual flowchart.

Donebase.htmlAfter modifying and saving the file, you may need to clear the AnQiCMS system cache to ensure the changes take effect (usually there is an 'Update Cache' button in the background).

Step 3: Create freely in the document content

Now, your AnQiCMS website is fully prepared to support Markdown, mathematical formulas, and flowcharts!

You can start creating in any Markdown editor (such as in 'Content Management' under 'Document Management' or 'Page Management').

  • Markdown Basic Syntax:Use freely#Create a title,*or-Create a list,**文本**Bold,_文本_Italic,`代码`Inline code,
  • Mathematical formula:
    • Inline formula:Use$Enclose the formula, for example$x^2 + y^2 = r^2$.
    • Block-level formula:Use$$Enclose the formula, for example:markdown $$ \left( \sum_{k=1}^n a_k b_k \right)^2 \le \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) $$
  • Flowchart:
    • Define the chart type in the code block using Mermaid syntax (for example:graph TDRepresents a flowchart from top to bottom), then define the node and connection relationships.
    ```mermaid
    graph LR
        A[开始] --> B{决策};
        B -- 是 --> C[执行操作];
        B -- 否 --> D[结束];
        C --> D;
    ```
    
    The editor will automatically recognize these syntaxes and render them on the page.

By following these steps, your AnQiCMS content creation experience will be significantly improved, allowing you to publish clear and professionally laid out content, as well as easily handle complex information with a strong technical component and the need for graphical assistance, greatly enriching the form of content expression and meeting the needs of a wider range of users.


Frequently Asked Questions (FAQ)

  1. I have enabled the Markdown editor in the background and added the frontend rendering script, but why are my mathematical formulas or flowcharts still not displaying?First, make sure that your frontend rendering script is placed correctly inbase.htmlof<head>Within the tag, and the CDN resources (MathJax, Mermaid) can be accessed normally (check the browser console for any failed resource loading errors). Secondly, please confirm that the syntax you are using in Markdown is completely compliant with the specifications of MathJax (TeX/LaTeX) and Mermaid, for example, MathJax usually requires using$or$$Enclose the formula, the Mermaid chart needs to be placed in `mermaidIn the code block.Finally, in the AnQiCMS backend, when the Markdown editor is enabled, the system will automatically convert Markdown to HTML.These frontend scripts are responsible for further parsing specific tags in HTML (such as the tags required by MathJax and Mermaid), if the CMS fails to generate these tags correctly during the conversion of Markdown, the frontend scripts will also be unable to recognize them.Generally, if the official provided Mermaid and MathJax syntax is followed, AnQiCMS can correctly generate the corresponding tags.

  2. Can I use custom Markdown styles instead of GitHub styles?Of course you can. You just need tobase.htmlto introducegithub-markdown-cssof<link>tag and replace it with your own CSS file link, or in thelinkAfter the tag, introduce your custom CSS, and you can override the default style by using CSS selectors.AnQiCMS itself is a Markdown to HTML structure converter, you can completely control the display effects of these HTML elements through custom CSS.

  3. How do you manage images or videos inserted in the Markdown editor?AnQiCMS's Markdown editor usually provides a convenient interface for uploading images or files.When you upload images or videos through this interface, they will be stored in the "Page Resources" -> "Image Resource Management" (or Attachment Management) of AnQiCMS.The editor will generate the corresponding Markdown syntax link (for example,

Related articles

How to modify the website name and logo in the AnQiCMS backend?

As a senior website operations expert, I am well aware that a website's name and brand identity, like a company's business card, directly affects the first impression and brand recognition of the website by users.In AnQiCMS (AnQiCMS) such a system that emphasizes user experience and efficient management, modifying the website name and logo is a fundamental and crucial operation.It not only makes your website more personalized, but also ensures that the brand information keeps up with the times.AnQi CMS with its simple and efficient architecture and powerful customizability

2025-11-06

How to perform database information and backend account initialization settings after AnQiCMS installation?

## AnQiCMS installation completed? Don't hurry! This database and backend initialization guide will help you quickly start your website operation journey Congratulations!Successfully installed AnQiCMS, marking the first step of your content management journey.AnQiCMS as an enterprise-level content management system developed based on the Go language, with its high efficiency, security, and ease of use, is becoming the preferred choice for an increasing number of small and medium-sized enterprises and content operation teams.However, the installation is just the beginning, and the correct initialization settings for database information and background accounts must be performed

2025-11-06

How to check port occupation situation when AnQiCMS background cannot be accessed on a Linux server?

As an experienced website operation expert, I am well aware of AnQiCMS's excellent performance in providing efficient and customizable content management solutions.AnQiCMS leverages the high concurrency features and concise, efficient architecture of the Go language, bringing great convenience to many small and medium-sized enterprises and content operation teams.However, even the most excellent system is bound to encounter some "small incidents" during operation, such as the sudden unavailability of the background, which often causes operators to be at a loss. Today

2025-11-06

How to troubleshoot errors if the AnQiCMS program fails to start and the background cannot be accessed?

As an experienced website operations expert, I am well aware of the anxiety of not being able to access the website backend.AnQiCMS (AnQiCMS) takes advantage of the efficient characteristics and simple architecture of the Go language, bringing us great convenience.However, even the most excellent system may encounter 'little插曲' when starting.When the AnQiCMS program fails to start, leading to inaccessibility of the backend, how should we systematically investigate the error and quickly restore the website to normal operation?Don't panic, let's go step by step, pinpointing the problem as accurately as a surgeon.

2025-11-06

How to configure AnQiCMS to automatically download remote images, filter external links, or convert to Webp format?

As an experienced website operations expert, I know that website performance, user experience, and SEO are the foundation of success in the increasingly fierce online environment.Content handling of images and link management is often a key detail that determines these factors.AnQiCMS (AnQiCMS), as an enterprise-level content management system developed based on the Go language, provides very powerful and flexible configuration options in this aspect, allowing operators to easily meet these challenges.Today, let's delve into how to intelligently configure the automatic download of content images in AnQiCMS

2025-11-06

What thumbnail processing methods and size settings does the AnQiCMS backend provide?

In website operation, image content is undoubtedly a key element in attracting visitors and enhancing user experience.How to display these images efficiently and beautifully, especially their thumbnails, is crucial for the website's loading speed and overall layout.AnQiCMS as a practical content management system, fully understands this, and therefore provides a flexible and powerful thumbnail processing mechanism in the background, allowing operators to finely manage the display effects of images according to the actual needs of the website.How does AnQiCMS handle image thumbnails In the AnQiCMS backend

2025-11-06

How to batch regenerate all thumbnails uploaded to the AnQiCMS website?

As an experienced website operations expert, I am well aware of how important the management of website images is for user experience and SEO optimization.Thumbnail, which plays a crucial role in the visual presentation of websites, its size, proportion, and loading speed can directly affect the first impression and page performance of users.The AnQiCMS (AnQiCMS) provides very user-friendly features in terms of image management, including a convenient batch thumbnail regeneration mechanism.

2025-11-06

How to set up and manage multi-level website navigation on AnQiCMS backend?

## AnQiCMS Multi-level Website Navigation: A Detailed Management Guide from Backend Settings to Front-end Display In today's rapidly changing digital world, a well-structured and easy-to-navigate website is crucial for improving user experience and search engine optimization (SEO).AnQiCMS is an efficient and flexible enterprise-level content management system that understands the importance of navigation and provides an intuitive and feature-rich backend management tool to help operators easily build and maintain multi-level website navigation.

2025-11-06