@mgks/docmd 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/package.json +28 -24
- package/src/templates/layout.ejs +16 -6
- package/src/templates/no-style.ejs +5 -1
- package/src/templates/partials/theme-init.js +20 -16
- package/src/templates/toc.ejs +1 -1
- package/.gitattributes +0 -2
- package/.github/CODE_OF_CONDUCT.md +0 -48
- package/.github/CONTRIBUTING.md +0 -129
- package/.github/FUNDING.yml +0 -15
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -58
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -27
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -16
- package/.github/SECURITY.md +0 -18
- package/.github/workflows/deploy-docmd.yml +0 -45
- package/.github/workflows/npm-publish.yml +0 -49
- package/assets/css/welcome.css +0 -6
- package/assets/images/preview-dark-1.webp +0 -0
- package/assets/images/preview-dark-2.webp +0 -0
- package/assets/images/preview-dark-3.webp +0 -0
- package/assets/images/preview-dark-welcome.png +0 -0
- package/assets/images/preview-light-1.webp +0 -0
- package/assets/images/preview-light-2.webp +0 -0
- package/assets/images/preview-light-3.webp +0 -0
- package/docs/cli-commands.md +0 -108
- package/docs/comparison.md +0 -56
- package/docs/configuration.md +0 -289
- package/docs/content/containers/buttons.md +0 -88
- package/docs/content/containers/callouts.md +0 -154
- package/docs/content/containers/cards.md +0 -93
- package/docs/content/containers/changelogs.md +0 -128
- package/docs/content/containers/collapsible.md +0 -89
- package/docs/content/containers/index.md +0 -35
- package/docs/content/containers/nested-containers.md +0 -329
- package/docs/content/containers/steps.md +0 -175
- package/docs/content/containers/tabs.md +0 -228
- package/docs/content/custom-containers.md +0 -24
- package/docs/content/frontmatter.md +0 -84
- package/docs/content/images.md +0 -205
- package/docs/content/index.md +0 -19
- package/docs/content/markdown-syntax.md +0 -309
- package/docs/content/mermaid.md +0 -723
- package/docs/content/no-style-example.md +0 -112
- package/docs/content/no-style-pages.md +0 -226
- package/docs/content/search.md +0 -68
- package/docs/contributing.md +0 -101
- package/docs/deployment.md +0 -120
- package/docs/getting-started/basic-usage.md +0 -89
- package/docs/getting-started/index.md +0 -21
- package/docs/getting-started/installation.md +0 -75
- package/docs/index.md +0 -168
- package/docs/overview.md +0 -63
- package/docs/plugins/analytics.md +0 -75
- package/docs/plugins/index.md +0 -70
- package/docs/plugins/seo.md +0 -127
- package/docs/plugins/sitemap.md +0 -87
- package/docs/recipes/custom-fonts.md +0 -43
- package/docs/recipes/favicon.md +0 -38
- package/docs/recipes/index.md +0 -12
- package/docs/recipes/landing-page.md +0 -46
- package/docs/theming/assets-management.md +0 -126
- package/docs/theming/available-themes.md +0 -77
- package/docs/theming/custom-css-js.md +0 -79
- package/docs/theming/icons.md +0 -92
- package/docs/theming/index.md +0 -19
- package/docs/theming/light-dark-mode.md +0 -114
- package/src/assets/css/docmd-highlight-dark.css +0 -1
- package/src/assets/css/docmd-highlight-light.css +0 -1
- package/src/assets/css/docmd-main.css +0 -1608
- package/src/assets/css/docmd-theme-retro.css +0 -868
- package/src/assets/css/docmd-theme-ruby.css +0 -629
- package/src/assets/css/docmd-theme-sky.css +0 -618
- package/src/assets/favicon.ico +0 -0
- package/src/assets/images/docmd-logo-dark.png +0 -0
- package/src/assets/images/docmd-logo-light.png +0 -0
- package/src/assets/images/docmd-logo.png +0 -0
- package/src/assets/images/docmd-preview.png +0 -0
- package/src/assets/js/docmd-image-lightbox.js +0 -74
- package/src/assets/js/docmd-main.js +0 -249
- package/src/assets/js/docmd-mermaid.js +0 -205
- package/src/assets/js/docmd-search.js +0 -218
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Custom Containers"
|
|
3
|
-
description: "Enhance your documentation with special components like callouts, cards, and steps using docmd's custom container syntax."
|
|
4
|
-
noStyle: true
|
|
5
|
-
components:
|
|
6
|
-
meta: false
|
|
7
|
-
favicon: true
|
|
8
|
-
css: false
|
|
9
|
-
theme: false
|
|
10
|
-
scripts: false
|
|
11
|
-
customHead: |
|
|
12
|
-
<script>
|
|
13
|
-
window.location.href = "https://docmd.mgks.dev/content/containers/";
|
|
14
|
-
document.addEventListener("DOMContentLoaded", function () {
|
|
15
|
-
window.location.href = "https://docmd.mgks.dev/content/containers/";
|
|
16
|
-
});
|
|
17
|
-
</script>
|
|
18
|
-
bodyClass: "no-style-example"
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
<div class="container">
|
|
22
|
-
Redirecting...<br/>
|
|
23
|
-
/custom-containers have moved to /containers now <a href="https://docmd.mgks.dev/content/containers/">Visit New Custom Containers Page</a>
|
|
24
|
-
</div>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Frontmatter"
|
|
3
|
-
description: "How to use YAML frontmatter to define page metadata in your docmd Markdown files."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Frontmatter
|
|
7
|
-
|
|
8
|
-
Every Markdown (`.md`) file that `docmd` processes **must** begin with YAML frontmatter. Frontmatter is a block of YAML (YAML Ain't Markup Language) enclosed by triple-dashed lines (`---`) at the very beginning of your file. It's used to set metadata for each page.
|
|
9
|
-
|
|
10
|
-
## Basic Structure
|
|
11
|
-
|
|
12
|
-
```yaml
|
|
13
|
-
---
|
|
14
|
-
title: "My Awesome Page Title"
|
|
15
|
-
description: "A concise and informative description for this page, used for SEO and potentially in listings."
|
|
16
|
-
# You can add other custom fields here if needed for your templates or logic
|
|
17
|
-
order: 1 # Example: for custom sorting if you implement such logic
|
|
18
|
-
tags:
|
|
19
|
-
- guide
|
|
20
|
-
- advanced
|
|
21
|
-
---
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Required Fields
|
|
25
|
-
|
|
26
|
-
* **`title`** (String, Required)
|
|
27
|
-
* **Purpose:** This is the primary title of the page.
|
|
28
|
-
* **Usage:**
|
|
29
|
-
* Used for the HTML `<title>` tag (e.g., `Page Title : Site Title`).
|
|
30
|
-
* Often used as the main heading (`<h1>`) on the page by default (though themes can customize this).
|
|
31
|
-
* Used as the display text for links in the navigation sidebar if the path matches.
|
|
32
|
-
* **Example:** `title: "Installation Guide"`
|
|
33
|
-
|
|
34
|
-
## Optional Fields (Recommended)
|
|
35
|
-
|
|
36
|
-
* **`description`** (String, Optional)
|
|
37
|
-
* **Purpose:** A brief summary of the page's content.
|
|
38
|
-
* **Usage:**
|
|
39
|
-
* Used for the HTML `<meta name="description">` tag, which is important for search engine optimization (SEO) and search result snippets.
|
|
40
|
-
* **Example:** `description: "Learn how to install and configure the XYZ widget."`
|
|
41
|
-
|
|
42
|
-
## Custom Fields
|
|
43
|
-
|
|
44
|
-
You can include any other custom fields in your frontmatter. These fields won't be used by `docmd`'s core functionality directly but can be accessed if you decide to customize EJS templates or write plugins in the future.
|
|
45
|
-
|
|
46
|
-
Examples of custom fields you *might* add (these are not built-in features):
|
|
47
|
-
|
|
48
|
-
* `author`: "Jane Doe"
|
|
49
|
-
* `date`: "2023-10-26"
|
|
50
|
-
* `order`: 2 (For custom sorting of pages within a section, if you implement logic for it)
|
|
51
|
-
* `draft`: true (To mark a page as a draft, if you implement logic to exclude drafts from builds)
|
|
52
|
-
* `tags`: ["tag1", "tag2"]
|
|
53
|
-
* `permalink`: "https://example.com/your-canonical-url/" (Sets the canonical URL for SEO purposes)
|
|
54
|
-
|
|
55
|
-
## Page-Specific Behavior Fields
|
|
56
|
-
|
|
57
|
-
* **`toc`** (Boolean, Optional)
|
|
58
|
-
* **Purpose:** Controls the visibility of the "On This Page" table of contents sidebar.
|
|
59
|
-
* **Default:** `true` (TOC is visible if the page has headings).
|
|
60
|
-
* **Usage:** Set to `false` to completely hide the TOC sidebar for a specific page. This is useful for landing pages or pages with minimal content.
|
|
61
|
-
* **Example:** `toc: false`
|
|
62
|
-
|
|
63
|
-
## Example Usage
|
|
64
|
-
|
|
65
|
-
Consider a file named `docs/guides/installation.md`:
|
|
66
|
-
|
|
67
|
-
```markdown
|
|
68
|
-
---
|
|
69
|
-
title: "Installation Steps"
|
|
70
|
-
description: "A step-by-step guide to installing our application on various platforms."
|
|
71
|
-
order: 1
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
# Application Installation
|
|
75
|
-
|
|
76
|
-
This guide will walk you through installing our application...
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
In this example:
|
|
80
|
-
* The browser tab will show "Installation Steps : Your Site Title".
|
|
81
|
-
* The `<meta name="description">` will be set.
|
|
82
|
-
* The `order: 1` field is available if you later want to sort "guides" pages by this value.
|
|
83
|
-
|
|
84
|
-
Using frontmatter consistently ensures your pages are well-defined, SEO-friendly, and integrate smoothly with `docmd`'s navigation and theming systems.
|
package/docs/content/images.md
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Images"
|
|
3
|
-
description: "Learn how to add and customize images in your docmd documentation"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Images in docmd
|
|
7
|
-
|
|
8
|
-
Adding images to your documentation enhances visual understanding and makes your content more engaging. This guide covers everything you need to know about using images in docmd.
|
|
9
|
-
|
|
10
|
-
## Basic Image Syntax
|
|
11
|
-
|
|
12
|
-
The standard Markdown syntax for images works in docmd:
|
|
13
|
-
|
|
14
|
-
```markdown
|
|
15
|
-

|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Where:
|
|
19
|
-
- `Alt text` is the alternative text displayed if the image cannot be loaded
|
|
20
|
-
- `/path/to/image.jpg` is the path to your image file
|
|
21
|
-
- `"Optional title"` is a tooltip shown when hovering over the image (optional)
|
|
22
|
-
|
|
23
|
-
## Image Organization
|
|
24
|
-
|
|
25
|
-
We recommend organizing your images in a dedicated directory structure:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
docs/
|
|
29
|
-
└── images/
|
|
30
|
-
├── getting-started/
|
|
31
|
-
│ └── installation.png
|
|
32
|
-
├── features/
|
|
33
|
-
│ └── example.jpg
|
|
34
|
-
└── logo.svg
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Referencing Images
|
|
38
|
-
|
|
39
|
-
### Relative Paths
|
|
40
|
-
|
|
41
|
-
Use relative paths to reference images within your documentation:
|
|
42
|
-
|
|
43
|
-
```markdown
|
|
44
|
-

|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Absolute Paths
|
|
48
|
-
|
|
49
|
-
For images stored in your site's assets directory:
|
|
50
|
-
|
|
51
|
-
```markdown
|
|
52
|
-

|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Image Styling
|
|
56
|
-
|
|
57
|
-
docmd provides several ways to style your images using attribute syntax:
|
|
58
|
-
|
|
59
|
-
### Image Alignment
|
|
60
|
-
|
|
61
|
-
You can align images using special class names:
|
|
62
|
-
|
|
63
|
-
```markdown
|
|
64
|
-
{.align-left}
|
|
65
|
-
{.align-center}
|
|
66
|
-
{.align-right}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Image Size
|
|
70
|
-
|
|
71
|
-
Control image dimensions with size classes:
|
|
72
|
-
|
|
73
|
-
```markdown
|
|
74
|
-
{.size-small}
|
|
75
|
-
{.size-medium}
|
|
76
|
-
{.size-large}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Or specify custom dimensions:
|
|
80
|
-
|
|
81
|
-
```markdown
|
|
82
|
-
{width=300 height=200}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Image Borders and Shadows
|
|
86
|
-
|
|
87
|
-
Add borders or shadows to your images:
|
|
88
|
-
|
|
89
|
-
```markdown
|
|
90
|
-
{.with-border}
|
|
91
|
-
{.with-shadow}
|
|
92
|
-
{.with-border .with-shadow}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Note: Make sure there's a space between multiple classes in the attribute syntax.
|
|
96
|
-
|
|
97
|
-
### Responsive Images
|
|
98
|
-
|
|
99
|
-
All images in docmd are responsive by default, automatically scaling to fit their container.
|
|
100
|
-
|
|
101
|
-
## Image Captions
|
|
102
|
-
|
|
103
|
-
Add captions to your images using the figure syntax:
|
|
104
|
-
|
|
105
|
-
```markdown
|
|
106
|
-
<figure>
|
|
107
|
-
<img src="/path/to/image.jpg" alt="Description of image">
|
|
108
|
-
<figcaption>This is the caption for the image</figcaption>
|
|
109
|
-
</figure>
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
## Image Galleries and Lightbox
|
|
113
|
-
|
|
114
|
-
docmd includes built-in lightbox functionality for image galleries. When users click on an image in a gallery, it opens in a full-screen lightbox view.
|
|
115
|
-
|
|
116
|
-
### Basic Gallery
|
|
117
|
-
|
|
118
|
-
Create simple image galleries by grouping images in a grid layout:
|
|
119
|
-
|
|
120
|
-
```markdown
|
|
121
|
-
<div class="image-gallery">
|
|
122
|
-
<img src="/path/to/image1.jpg" alt="Image 1">
|
|
123
|
-
<img src="/path/to/image2.jpg" alt="Image 2">
|
|
124
|
-
<img src="/path/to/image3.jpg" alt="Image 3">
|
|
125
|
-
</div>
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Gallery with Captions
|
|
129
|
-
|
|
130
|
-
For galleries with captions, use figure elements inside the gallery:
|
|
131
|
-
|
|
132
|
-
```markdown
|
|
133
|
-
<div class="image-gallery">
|
|
134
|
-
<figure>
|
|
135
|
-
<img src="/path/to/image1.jpg" alt="Image 1">
|
|
136
|
-
<figcaption>Caption for Image 1</figcaption>
|
|
137
|
-
</figure>
|
|
138
|
-
<figure>
|
|
139
|
-
<img src="/path/to/image2.jpg" alt="Image 2">
|
|
140
|
-
<figcaption>Caption for Image 2</figcaption>
|
|
141
|
-
</figure>
|
|
142
|
-
</div>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Zoom Effect
|
|
146
|
-
|
|
147
|
-
Add a zoom effect to gallery images when hovering:
|
|
148
|
-
|
|
149
|
-
```markdown
|
|
150
|
-
<div class="image-gallery zoom">
|
|
151
|
-
<img src="/path/to/image1.jpg" alt="Image 1">
|
|
152
|
-
<img src="/path/to/image2.jpg" alt="Image 2">
|
|
153
|
-
</div>
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### Individual Lightbox Images
|
|
157
|
-
|
|
158
|
-
You can also enable lightbox functionality for individual images:
|
|
159
|
-
|
|
160
|
-
```markdown
|
|
161
|
-
{.lightbox}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Image Optimization Best Practices
|
|
165
|
-
|
|
166
|
-
For optimal performance:
|
|
167
|
-
|
|
168
|
-
1. **Use appropriate formats**:
|
|
169
|
-
- JPEG for photographs
|
|
170
|
-
- PNG for images with transparency
|
|
171
|
-
- SVG for icons and logos
|
|
172
|
-
- WebP for better compression (with fallbacks)
|
|
173
|
-
|
|
174
|
-
2. **Optimize file sizes**:
|
|
175
|
-
- Compress images before adding them to your documentation
|
|
176
|
-
- Consider using tools like ImageOptim, TinyPNG, or Squoosh
|
|
177
|
-
|
|
178
|
-
3. **Provide responsive images**:
|
|
179
|
-
- Use the HTML `<picture>` element for advanced responsive image scenarios
|
|
180
|
-
|
|
181
|
-
4. **Specify dimensions**:
|
|
182
|
-
- Always include width and height attributes to prevent layout shifts
|
|
183
|
-
|
|
184
|
-
## Examples
|
|
185
|
-
|
|
186
|
-
### Basic Image
|
|
187
|
-
|
|
188
|
-

|
|
189
|
-
|
|
190
|
-
### Image with Border and Shadow
|
|
191
|
-
|
|
192
|
-
{.with-border .with-shadow}
|
|
193
|
-
|
|
194
|
-
### Responsive Image Gallery
|
|
195
|
-
|
|
196
|
-
<div class="image-gallery">
|
|
197
|
-
<figure>
|
|
198
|
-
<img src="/assets/images/docmd-preview.png" alt="Feature 1">
|
|
199
|
-
<figcaption>Feature One</figcaption>
|
|
200
|
-
</figure>
|
|
201
|
-
<figure>
|
|
202
|
-
<img src="/assets/images/docmd-preview.png" alt="Feature 2">
|
|
203
|
-
<figcaption>Feature Two</figcaption>
|
|
204
|
-
</figure>
|
|
205
|
-
</div>
|
package/docs/content/index.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Content"
|
|
3
|
-
description: "Learn how to write and format content in docmd"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Content in docmd
|
|
7
|
-
|
|
8
|
-
docmd uses Markdown files to create beautiful documentation. This section covers everything you need to know about writing content:
|
|
9
|
-
|
|
10
|
-
## Available Guides
|
|
11
|
-
|
|
12
|
-
- [**Frontmatter**](/content/frontmatter/) - Learn how to add metadata to your pages
|
|
13
|
-
- [**Markdown Syntax**](/content/markdown-syntax/) - Basic and advanced Markdown features
|
|
14
|
-
- [**Images**](/content/images/) - How to add and style images in your documentation
|
|
15
|
-
- [**Mermaid Diagrams**](/content/mermaid/) - Create beautiful diagrams and flowcharts with Mermaid
|
|
16
|
-
- [**Custom Containers**](/content/custom-containers/) - Special content blocks like callouts and cards
|
|
17
|
-
- [**noStyle Pages**](/content/no-style-pages/) - Create custom standalone pages with complete HTML control
|
|
18
|
-
|
|
19
|
-
Choose a topic from the sidebar to get started.
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Markdown Syntax Guide"
|
|
3
|
-
description: "Learn how to use Markdown syntax to format your documentation in docmd."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Markdown Syntax
|
|
7
|
-
|
|
8
|
-
`docmd` uses `markdown-it` under the hood, which is a highly extensible and standards-compliant Markdown parser. It supports CommonMark syntax by default, along with some useful extensions like GitHub Flavored Markdown (GFM) tables and strikethrough.
|
|
9
|
-
|
|
10
|
-
## Common Elements
|
|
11
|
-
|
|
12
|
-
You can use all standard Markdown elements:
|
|
13
|
-
|
|
14
|
-
* **Headings:**
|
|
15
|
-
```markdown
|
|
16
|
-
# Heading 1
|
|
17
|
-
## Heading 2
|
|
18
|
-
### Heading 3
|
|
19
|
-
...
|
|
20
|
-
###### Heading 6
|
|
21
|
-
```
|
|
22
|
-
* **Paragraphs:** Just type text. Separate paragraphs with a blank line.
|
|
23
|
-
* **Emphasis:**
|
|
24
|
-
```markdown
|
|
25
|
-
*This text will be italic.*
|
|
26
|
-
_This will also be italic._
|
|
27
|
-
|
|
28
|
-
**This text will be bold.**
|
|
29
|
-
__This will also be bold.__
|
|
30
|
-
|
|
31
|
-
***This text will be bold and italic.***
|
|
32
|
-
```
|
|
33
|
-
* **Lists:**
|
|
34
|
-
* **Unordered:**
|
|
35
|
-
```markdown
|
|
36
|
-
* Item 1
|
|
37
|
-
* Item 2
|
|
38
|
-
* Nested Item 2a
|
|
39
|
-
* Nested Item 2b
|
|
40
|
-
+ Item 3 (using +)
|
|
41
|
-
- Item 4 (using -)
|
|
42
|
-
```
|
|
43
|
-
* **Ordered:**
|
|
44
|
-
```markdown
|
|
45
|
-
1. First item
|
|
46
|
-
2. Second item
|
|
47
|
-
3. Third item
|
|
48
|
-
1. Nested ordered item
|
|
49
|
-
```
|
|
50
|
-
* **Links:**
|
|
51
|
-
```markdown
|
|
52
|
-
[Link Text](https://www.example.com)
|
|
53
|
-
[Link with Title](https://www.example.com "Link Title")
|
|
54
|
-
[Relative Link to another page](../section/other-page/)
|
|
55
|
-
```
|
|
56
|
-
*Note: For internal links to other documentation pages, use relative paths to the `.md` files. `docmd` will convert these to the correct HTML paths during the build.*
|
|
57
|
-
|
|
58
|
-
* **Images:**
|
|
59
|
-
```markdown
|
|
60
|
-

|
|
61
|
-
```
|
|
62
|
-
*Place images in your `docs/` directory (e.g., `docs/images/`) or a similar assets folder that gets copied to your `site/` output.*
|
|
63
|
-
|
|
64
|
-
* **Blockquotes:**
|
|
65
|
-
```markdown
|
|
66
|
-
> This is a blockquote.
|
|
67
|
-
> It can span multiple lines.
|
|
68
|
-
```
|
|
69
|
-
* **Horizontal Rules:**
|
|
70
|
-
```markdown
|
|
71
|
-
---
|
|
72
|
-
***
|
|
73
|
-
___
|
|
74
|
-
```
|
|
75
|
-
* **Inline Code:**
|
|
76
|
-
```markdown
|
|
77
|
-
Use `backticks` for inline code like `variableName`.
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Code Blocks & Syntax Highlighting
|
|
81
|
-
|
|
82
|
-
`docmd` uses `highlight.js` for automatic syntax highlighting of fenced code blocks. Specify the language after the opening triple backticks:
|
|
83
|
-
|
|
84
|
-
```javascript
|
|
85
|
-
function greet(name) {
|
|
86
|
-
console.log(`Hello, ${name}!`);
|
|
87
|
-
}
|
|
88
|
-
greet('docmd user');
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
```python
|
|
92
|
-
def hello():
|
|
93
|
-
print("Hello from Python!")
|
|
94
|
-
|
|
95
|
-
hello()
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
```html
|
|
99
|
-
<div>
|
|
100
|
-
<p>This is some HTML.</p>
|
|
101
|
-
</div>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
```css
|
|
105
|
-
body {
|
|
106
|
-
font-family: sans-serif;
|
|
107
|
-
color: #333;
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
npm install -g docmd
|
|
113
|
-
docmd init my-docs
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
If you don't specify a language, `highlight.js` will attempt to auto-detect it, or it will be rendered as plain preformatted text.
|
|
117
|
-
|
|
118
|
-
## Tables (GFM Style)
|
|
119
|
-
|
|
120
|
-
You can create tables using GitHub Flavored Markdown syntax:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
| Header 1 | Header 2 | Header 3 |
|
|
124
|
-
| :------- | :------: | -------: |
|
|
125
|
-
| Align L | Center | Align R |
|
|
126
|
-
| Cell 1 | Cell 2 | Cell 3 |
|
|
127
|
-
| Cell 4 | Cell 5 | Cell 6 |
|
|
128
|
-
```
|
|
129
|
-
Renders as:
|
|
130
|
-
|
|
131
|
-
| Header 1 | Header 2 | Header 3 |
|
|
132
|
-
| :------- | :------: | -------: |
|
|
133
|
-
| Align L | Center | Align R |
|
|
134
|
-
| Cell 1 | Cell 2 | Cell 3 |
|
|
135
|
-
| Cell 4 | Cell 5 | Cell 6 |
|
|
136
|
-
|
|
137
|
-
## Strikethrough (GFM Style)
|
|
138
|
-
|
|
139
|
-
Wrap text with two tildes (`~~`) for strikethrough:
|
|
140
|
-
```bash
|
|
141
|
-
This is ~~strikethrough~~ text.
|
|
142
|
-
```
|
|
143
|
-
Renders as: This is ~~strikethrough~~ text.
|
|
144
|
-
|
|
145
|
-
## HTML
|
|
146
|
-
|
|
147
|
-
Because `markdown-it` is configured with `html: true`, you can embed raw HTML directly in your Markdown files. However, use this sparingly, as it can make your content less portable and harder to maintain.
|
|
148
|
-
|
|
149
|
-
```html
|
|
150
|
-
<div style="color: blue;">
|
|
151
|
-
This is a blue div rendered directly from HTML.
|
|
152
|
-
</div>
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
For most formatting needs, standard Markdown and `docmd`'s [Custom Containers](/content/custom-containers/) should suffice.
|
|
156
|
-
|
|
157
|
-
# Advanced Markdown Capabilities
|
|
158
|
-
|
|
159
|
-
Beyond the basic syntax, `docmd` supports a variety of advanced Markdown features to help you create richer documentation.
|
|
160
|
-
|
|
161
|
-
## Example Callout
|
|
162
|
-
|
|
163
|
-
::: callout info
|
|
164
|
-
This is a real callout example to test container rendering. Callouts are great for highlighting important information.
|
|
165
|
-
:::
|
|
166
|
-
|
|
167
|
-
::: callout warning
|
|
168
|
-
**Warning!** Be careful when using advanced features, ensure they are properly documented.
|
|
169
|
-
:::
|
|
170
|
-
|
|
171
|
-
## GFM (GitHub Flavored Markdown)
|
|
172
|
-
|
|
173
|
-
docmd supports GitHub Flavored Markdown extensions including:
|
|
174
|
-
|
|
175
|
-
- **Task Lists** - Create interactive checklists:
|
|
176
|
-
```markdown
|
|
177
|
-
- [x] Completed task
|
|
178
|
-
- [ ] Incomplete task
|
|
179
|
-
- [ ] Another item
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Renders as:
|
|
183
|
-
- [x] Completed task
|
|
184
|
-
- [ ] Incomplete task
|
|
185
|
-
- [ ] Another item
|
|
186
|
-
|
|
187
|
-
- **Autolinked References** - URL and email addresses are automatically linked:
|
|
188
|
-
```markdown
|
|
189
|
-
Visit https://docmd.mgks.dev for more information.
|
|
190
|
-
Contact support@example.com for help.
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
- **Emoji** - Use emoji shortcodes:
|
|
194
|
-
```markdown
|
|
195
|
-
I :heart: documentation! :rocket: :smile:
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
Renders emoji symbols like: I ❤️ documentation! 🚀 😄
|
|
199
|
-
|
|
200
|
-
## Custom Attributes (IDs and Classes)
|
|
201
|
-
|
|
202
|
-
You can add custom IDs and CSS classes to headers, images, and links using curly braces `{}`.
|
|
203
|
-
|
|
204
|
-
### Custom IDs
|
|
205
|
-
By default, `docmd` generates IDs for headers automatically. You can override this:
|
|
206
|
-
|
|
207
|
-
```markdown
|
|
208
|
-
## My Header {#custom-id}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Custom Classes
|
|
212
|
-
Add styling classes to elements:
|
|
213
|
-
|
|
214
|
-
```markdown
|
|
215
|
-
## Styled Header {.text-center .text-red}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### Links and Buttons
|
|
219
|
-
Create buttons using standard links and classes:
|
|
220
|
-
|
|
221
|
-
```markdown
|
|
222
|
-
[Download Now](/download){.btn .btn-primary}
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### Images
|
|
226
|
-
Control image styling directly:
|
|
227
|
-
|
|
228
|
-
```markdown
|
|
229
|
-
{width="100%" .shadow-lg}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Footnotes
|
|
233
|
-
|
|
234
|
-
You can add footnotes to your content for references or additional information[^1].
|
|
235
|
-
|
|
236
|
-
```markdown
|
|
237
|
-
Here's a statement that needs citation[^1].
|
|
238
|
-
|
|
239
|
-
[^1]: This is the footnote content.
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
Multiple footnotes can be used throughout your document[^2], and the definitions can be collected at the bottom.
|
|
243
|
-
|
|
244
|
-
[^1]: This is the first footnote reference.
|
|
245
|
-
[^2]: This is the second footnote with more information.
|
|
246
|
-
|
|
247
|
-
## Definition Lists
|
|
248
|
-
|
|
249
|
-
Some Markdown parsers support definition lists:
|
|
250
|
-
|
|
251
|
-
```markdown
|
|
252
|
-
Term
|
|
253
|
-
: Definition for the term.
|
|
254
|
-
: Another definition for the same term.
|
|
255
|
-
|
|
256
|
-
Another Term
|
|
257
|
-
: Definition of another term.
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
Term
|
|
261
|
-
: Definition for the term.
|
|
262
|
-
: Another definition for the same term.
|
|
263
|
-
|
|
264
|
-
Another Term
|
|
265
|
-
: Definition of another term.
|
|
266
|
-
|
|
267
|
-
## Abbreviations
|
|
268
|
-
|
|
269
|
-
You can define abbreviations in your Markdown (depending on plugin support):
|
|
270
|
-
|
|
271
|
-
```markdown
|
|
272
|
-
*[HTML]: Hyper Text Markup Language
|
|
273
|
-
*[W3C]: World Wide Web Consortium
|
|
274
|
-
|
|
275
|
-
HTML is defined by the W3C standards.
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
*[HTML]: Hyper Text Markup Language
|
|
279
|
-
*[W3C]: World Wide Web Consortium
|
|
280
|
-
|
|
281
|
-
HTML is defined by the W3C standards.
|
|
282
|
-
|
|
283
|
-
## Math Expressions
|
|
284
|
-
|
|
285
|
-
If enabled with the appropriate plugins, you can include mathematical expressions using LaTeX syntax:
|
|
286
|
-
|
|
287
|
-
```markdown
|
|
288
|
-
Inline math: $E=mc^2$
|
|
289
|
-
|
|
290
|
-
Block math:
|
|
291
|
-
$$
|
|
292
|
-
\frac{d}{dx}e^x = e^x
|
|
293
|
-
$$
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
## Container Extensions
|
|
297
|
-
|
|
298
|
-
Beyond standard Markdown, docmd provides custom containers for enhanced formatting.
|
|
299
|
-
These are detailed in the [Custom Containers](/content/custom-containers/) guide, and include:
|
|
300
|
-
|
|
301
|
-
::: callout info
|
|
302
|
-
Use containers for callouts, cards, and steps to structure your documentation.
|
|
303
|
-
:::
|
|
304
|
-
|
|
305
|
-
## Conclusion
|
|
306
|
-
|
|
307
|
-
Markdown provides a powerful yet simple way to write and format documentation. With docmd's extensions and customizations, you can create rich, beautiful documentation that's easy to maintain.
|
|
308
|
-
|
|
309
|
-
For more examples and practical applications, check the rest of the documentation or browse the source of this page by viewing its Markdown file.
|