How to enable Markdown editor to write document content in AnQiCMS?

Calendar 👁️ 50

As an expert well-versed in the operation of AnQiCMS (AnQiCMS), I am glad to provide you with a detailed explanation of how to enable and fully utilize the Markdown editor to create and manage your document content in AnQiCMS.In the digital age, Markdown, with its concise and efficient features, has become a tool for content creators.AnQiCMS fully understands its value and has introduced a Markdown editor in the new version, greatly enhancing the flexibility and convenience of content editing.

Enable Markdown editor in Anqi CMS

To start using AnQiCMS's Markdown editor, you need to make simple settings in the system background first.This step is the key to activating the Markdown feature.

Go to the AnQiCMS admin interface. In the left navigation menu, find and click on "Admin Settings", then select "Content Settings".In the content settings page, you will find an option to enable or disable the Markdown editor.Make sure to enable this option. After completing the settings, save the changes, and your AnQiCMS system will be ready to support Markdown content creation.

Apply Markdown default style on the web page

After enabling the Markdown editor, to make your Markdown content appear beautiful and readable on the website frontend, especially for documents with elements such as code blocks and quotations, it is recommended that you introduce a set of Markdown styles.The GitHub Flavored Markdown (GFM) style is currently widely accepted and has excellent visual effects.

You can quickly apply these styles by introducing CDN resources. Usually, this needs to be done in the template of your website.base.htmlfile (or any template file that serves as the basis for all pages) of the<head>Add a line of code inside the tag. For example, you can add the following link to introduce GitHub Markdown style:

<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 way, your Markdown content will automatically have a professional formatting style similar to GitHub.

Display of mathematical formulas correctly on the web

For documents that need to display mathematical formulas, while Markdown editors themselves can recognize formula syntax, to correctly render these formulas on the web, it is still necessary to use special JavaScript libraries.MathJax is a powerful math typesetting engine that can convert LaTeX, MathML, and other formats of mathematical formulas into high-quality web display effects.

To enable the rendering of mathematical formulas in AnQiCMS, you also need to enable it in the website template'sbase.htmlfile (or your general template file)<head>Add a CDN reference script for MathJax inside the tag:

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

After adding this script, you can write mathematical formulas in Markdown (such as using$$...$$or$...$The package) can be correctly parsed and displayed on the front-end page.

Display of flow chart correctly on the web

In addition to mathematical formulas, your document may also need to include flowcharts or sequence diagrams to express complex logic more intuitively.Mermaid is a Markdown-based chart drawing tool that allows you to create various charts through a concise text syntax.

In order to support Mermaid flowchart display on the AnQiCMS front-end, you need tobase.htmlfile (or your general template file)<head>Add Mermaid's CDN script reference inside the tag. Please note that Mermaid requirestype="module"Script type:

<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 imports the Mermaid library and initializes it so that it can automatically render the flowchart defined in Markdown when the page loads.

Use Markdown for content creation

Once the Markdown editor and its related rendering features are enabled, you can enjoy the convenience of Markdown in multiple content creation areas of AnQiCMS. This includes but is not limited to:

  • Document contentWhen creating or editing articles, products, and other documents, the document content field will support Markdown syntax.
  • Category content: When editing categories, the description or details can also be written in Markdown.
  • Single page contentWhen creating single pages such as "About Us", "Contact Us", and so on, the page content can be written in Markdown.
  • Label content: When adding detailed descriptions to tags, you can also use Markdown.

AnQiCMS's Markdown editor will automatically convert Markdown syntax to HTML when you save the content and display it on the front-end page. In cases where you need to manually control Markdown rendering in the template, such as for specific content fields, you can do so through the template tags byrender=trueExplicitly trigger the Markdown to HTML conversion, or throughrender=falsePrevent automatic conversion to allow for finer control.

For example, inarchiveDetailwithin the tag, document contentContentThis field can control rendering:

{# markdown 转 html #}
<div>文档内容:{% archiveDetail archiveContent with name="Content" render=true %}{{archiveContent|safe}}</div>
{# 不进行markdown转换 #}
<div>文档内容:{% archiveDetail archiveContent with name="Content" render=false %}{{archiveContent|safe}}</div>

By following these steps, AnQiCMS users can fully utilize the advantages of Markdown, creating and managing website content more efficiently and in a more structured manner, while ensuring professional and feature-rich visual effects are presented on the frontend.


Frequently Asked Questions (FAQ)

1. Why did I turn on the Markdown editor but still can't see the rendering effect of mathematical formulas or flow charts on the document details page?

After the Markdown editor is turned on, AnQiCMS will convert Markdown content to HTML in the background. However, rendering mathematical formulas and flowcharts requires the front-end browser to load specific JavaScript libraries to parse the specific tags in the HTML (such as$$...$$orgraph TD;),and convert it into a visual image. You need to follow the instructions in the chapters "Correct display of mathematical formulas on the web" and "Correct display of flowcharts on the web" in the article, and add the CDN scripts of MathJax and Mermaid to the template of your website.<head>Tag inside.

2. I am using a custom theme, where can I find it?base.htmlFile to add CDN script?

The root directory of template files in AnQiCMS is/template. Your custom theme will usually have an independent folder in this directory, such as/template/yourtheme/)base.htmlThe file is generally a common layout file for your theme, it may be directly located in the theme root directory, or in the public code directory (such asyourtheme/bash.htmloryourtheme/partial/header.htmlThen it is referenced by other templates).You need to find and edit the HTML file that serves as the page basis according to the specific structure of your theme.

3. Will the old HTML content be affected after enabling the Markdown editor?

I don't know. The Markdown editor mainly affects the content you enter using Markdown syntax when you create or edit.For existing pure HTML content, AnQiCMS will treat it as ordinary HTML and will not attempt to convert it to Markdown before rendering. Therefore, you do not need to worry about old content being incorrectly parsed or damaged.Markdown features are incremental, aiming to provide a new way of content creation.

Related articles

How to insert images, videos, or use the asset library in AnQiCMS documents?

As an expert in AnQiCMS website operation, I know that high-quality, rich media content is the core to attract and retain users.In AnQiCMS, whether it is to insert images, videos, or efficiently use the material library, the system provides intuitive and powerful tools.Next, I will elaborate on how to perform these operations in AnQiCMS to ensure your content is both vivid and attractive. ### Multimedia Insertion in Content Editor The AnQiCMS content editor is the main interface for you to publish articles, product, or page content.

2025-11-06

What advanced editing features does the AnQiCMS document content editor provide?

As a senior CMS website operator, I know that an efficient and powerful content editor is the key to the successful operation of a website.The AnQi CMS content editor is not just a text input tool, it integrates rich visual editing capabilities, intelligent creative assistance, refined SEO management, and flexible content structure customization, aiming to comprehensively improve the efficiency and quality of content production and publication.

2025-11-06

How does the AnQiCMS document introduction automatically generate when not manually filled in?

As a user of AnQiCMS (AnQiCMS) who is proficient in content operation, I know that high-quality content is the cornerstone of website success.The content must be engaging and also consider search engine optimization (SEO), and the document summary (Meta Description) is an indispensable part of it.It directly affects the user's click intention on the search engine results page.However, during the process of content creation and publication, we sometimes encounter a problem: how does AnQi CMS handle it if the document summary is not filled in manually?

2025-11-06

What is the word limit for the AnQiCMS document introduction?

As a senior content expert who deeply understands the operation of AnQiCMS, I know that the value of the document is not only in the breadth of content, but also in its accurate and efficient guidance to readers.About the **word limit of AnQiCMS documents, this is not a simple fixed number, but needs to be considered comprehensively based on the target audience of the document, the nature of its content, and its specific role in the user journey.The Anqi CMS project itself emphasizes the characteristics of

2025-11-06

How can mathematical formulas and flowcharts be displayed correctly in AnQiCMS documents?

As an expert who deeply understands the operation of AnQiCMS (AnQiCMS), I will give you a detailed explanation of how to correctly display mathematical formulas and flowcharts in AnQiCMS.AnQi CMS has added support for Markdown editors in the new version, which greatly enriches the form of content creation, making it possible to insert complex mathematical formulas and intuitive flowcharts in articles.

2025-11-06

What is the relationship between AnQiCMS documents and categories, and content models?

AnQiCMS is an enterprise-level CMS system dedicated to providing an efficient, customizable, and scalable content management solution.The core advantage lies in the exquisite process of content creation, editing, publishing, and optimization, which helps website operators effectively attract and retain users.The implementation of this ability is inseparable from the close and flexible association between the 'Document', 'Category', and 'Content Model' in AnQiCMS.Understanding the collaborative working mechanism among them is the key to efficiently operate AnQiCMS for content management.

2025-11-06

How to set or automatically extract thumbnails for documents in AnQiCMS?

As an experienced CMS website operation person in the security industry, I know the key role of thumbnails in content display and user experience.A meticulously set or automatically generated thumbnail, which not only effectively attracts readers' attention and increases click-through rate, but also helps with search engine optimization, making your content stand out among numerous pieces of information.AnQi CMS provides flexible and powerful thumbnail management functions, whether it is manual selection or intelligent extraction and unified processing, it can meet your needs for efficient operation.

2025-11-06

What impact does AnQiCMS custom URL have on the static rules of documents?

As an experienced website operator who deeply understands the operation of AnQiCMS, I know that the URL structure has a crucial impact on the SEO performance and user experience of the website.The combination of the Custom URL feature provided by Anqi CMS and the pseudo-static rules is the powerful tool that allows us to refine our website operations and enhance the value of our content.Now, I will elaborate on how the custom URL of Anqi CMS affects its document pseudo-static rules.

2025-11-06