Support for table of contents
We just added support for table of contents. This functionality is designed to make navigating markdown documents effortless, by dynamically building a TOC based on your document's headings. Now, readers can quickly locate and access sections, enhancing both readability and organization.
How It Works
The TOC feature scans for H1, H2, and H3 headings and creates a structured table of contents to match your document’s layout. To enable this feature, simply add the [TOC]
tag to your markdown file where you want the TOC to appear, and let the editor do the rest.
This TOC functionality works seamlessly across both .txt and .md files. When you include [TOC]
in these formats, we’ll generate a rendered TOC, making navigation smoother on any markdown-compatible platform.
Here is an example of how to use this new special tag:
Table of Contents Example
Overview
This is a sample markdown document created to demonstrate how titles with different heading levels (H1, H2, H3) appear in a markdown file. The purpose is to help generate a Table of Contents (TOC) based on these structured headings.
Markdown files are often used for documentation, and structuring them with different heading levels can help in organizing content effectively.
Getting Started
To begin with markdown, you simply need a text editor that supports it. Many popular editors, like VS Code, have built-in markdown support and plugins to preview or export markdown files.
Markdown syntax is straightforward and easy to learn. You can add headers, lists, tables, links, and even code blocks with just a few symbols.
Basic Markdown Syntax
Markdown syntax is built around simplicity. Here are some basics:
- Headers: Use
#
symbols to denote headers. - Lists: Use
-
for unordered lists or1.
for ordered lists. - Bold and Italics: Use
**bold**
or_italics_
for emphasis.
Advanced Topics
Once you’re familiar with the basics, you can start exploring more advanced markdown features like embedding images, creating tables, and adding HTML elements directly into your markdown file.
Embedding Images
To embed images, use the following syntax: ![alt text](URL)
. This is helpful for creating visually rich documents without relying on complex formatting.
Creating Tables
Creating tables in markdown is simple. Here’s a quick example:
Header 1 | Header 2 |
---|---|
Row 1 | Row 2 |
Conclusion
Markdown is a flexible, lightweight markup language that is widely used for documentation. With the right structure, you can easily create a Table of Contents that helps readers navigate long documents.