@mgks/docmd 0.3.2 → 0.3.4
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/.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/images/docmd-preview.png +0 -0
package/docs/theming/icons.md
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Using Icons"
|
|
3
|
-
description: "How to use Lucide icons in your docmd site navigation and content."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Using Icons
|
|
7
|
-
|
|
8
|
-
`docmd` allows you to add visual flair and improve navigation clarity with SVG icons from the [Lucide icon library](https://lucide.dev/).
|
|
9
|
-
|
|
10
|
-
## Icons in Navigation
|
|
11
|
-
|
|
12
|
-
You can specify an icon for each navigation item (including parent categories) in your config file using the `icon` property:
|
|
13
|
-
|
|
14
|
-
```javascript
|
|
15
|
-
// ...
|
|
16
|
-
navigation: [
|
|
17
|
-
{ title: 'Home', path: '/', icon: 'home' },
|
|
18
|
-
{
|
|
19
|
-
title: 'User Guides',
|
|
20
|
-
icon: 'book-open', // Icon for the category
|
|
21
|
-
children: [
|
|
22
|
-
{ title: 'Installation', path: '/user-guides/installation', icon: 'download' },
|
|
23
|
-
{ title: 'First Steps', path: '/user-guides/first-steps', icon: 'footprints' },
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
{ title: 'API Reference', path: '/api-reference', icon: 'code' }
|
|
27
|
-
]
|
|
28
|
-
// ...
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**How it Works:**
|
|
32
|
-
* The `icon` value (e.g., `'home'`, `'book-open'`) uses kebab-case notation that maps to Lucide icon names.
|
|
33
|
-
* During build, `docmd` converts these names to the appropriate Lucide icon SVGs.
|
|
34
|
-
* The navigation template renders these icons inline for optimal performance.
|
|
35
|
-
|
|
36
|
-
## Available Icons
|
|
37
|
-
|
|
38
|
-
`docmd` uses the [Lucide](https://lucide.dev/) icon library, which provides a comprehensive set of beautiful, consistent open-source icons.
|
|
39
|
-
|
|
40
|
-
To see all available icons and their names:
|
|
41
|
-
1. Visit the [Lucide Icons Gallery](https://lucide.dev/icons/)
|
|
42
|
-
2. When you find an icon you want to use, note its name (shown below each icon)
|
|
43
|
-
3. Use the kebab-case version of the name in your config (e.g., `arrow-up-right` instead of `ArrowUpRight`)
|
|
44
|
-
|
|
45
|
-
**Common Icon Examples:**
|
|
46
|
-
* Navigation: `home`, `book-open`, `file-text`, `settings`, `users`
|
|
47
|
-
* Actions: `download`, `upload-cloud`, `play`, `external-link`
|
|
48
|
-
* UI Elements: `sun`, `moon`, `menu`, `x`, `search`
|
|
49
|
-
* Indicators: `alert-circle`, `check-circle`, `info`
|
|
50
|
-
* Directional: `chevron-right`, `chevron-down`, `arrow-left`
|
|
51
|
-
|
|
52
|
-
## Icon Styling
|
|
53
|
-
|
|
54
|
-
Lucide icons in `docmd` are styled using CSS. They are rendered as inline SVGs with appropriate classes for targeting:
|
|
55
|
-
|
|
56
|
-
```css
|
|
57
|
-
/* Example styling for navigation icons */
|
|
58
|
-
.sidebar-nav .lucide-icon {
|
|
59
|
-
width: 1.2em;
|
|
60
|
-
height: 1.2em;
|
|
61
|
-
margin-right: 0.5em;
|
|
62
|
-
vertical-align: middle;
|
|
63
|
-
stroke-width: 2px; /* Adjust line thickness */
|
|
64
|
-
stroke: currentColor; /* Use current text color */
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* Example of targeting a specific icon */
|
|
68
|
-
.sidebar-nav .icon-home {
|
|
69
|
-
color: #3498db; /* Blue color for home icon */
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
The icons have the following CSS classes you can target:
|
|
74
|
-
- `.lucide-icon` - Applied to all Lucide icons
|
|
75
|
-
- `.icon-{name}` - Applied to specific icons, e.g., `.icon-home`
|
|
76
|
-
|
|
77
|
-
You can add these styles to your custom CSS file specified in `theme.customCss` in your configuration.
|
|
78
|
-
|
|
79
|
-
## Using Icons in Content
|
|
80
|
-
|
|
81
|
-
To use icons directly in your Markdown content, you'll need to use HTML with inline SVGs. You can copy SVG code directly from the [Lucide website](https://lucide.dev/) and paste it into your Markdown.
|
|
82
|
-
|
|
83
|
-
```html
|
|
84
|
-
<!-- Example of inline SVG in Markdown -->
|
|
85
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info">
|
|
86
|
-
<circle cx="12" cy="12" r="10"></circle>
|
|
87
|
-
<path d="M12 16v-4"></path>
|
|
88
|
-
<path d="M12 8h.01"></path>
|
|
89
|
-
</svg> This is a note with an info icon.
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
A future version of `docmd` might provide shortcodes or other simplified ways to use icons directly in Markdown content.
|
package/docs/theming/index.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Theming Your docmd Site"
|
|
3
|
-
description: "Learn how to customize the appearance of your docmd site, including themes, modes, custom styles, and icons."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Theming Your docmd Site
|
|
7
|
-
|
|
8
|
-
`docmd` allows for extensive customization of your documentation site's appearance, ensuring it aligns with your branding and provides an optimal user experience.
|
|
9
|
-
|
|
10
|
-
## Core Theming Concepts:
|
|
11
|
-
|
|
12
|
-
* **[Available Themes](/theming/available-themes/):** Choose from pre-built themes to quickly change the overall look and feel.
|
|
13
|
-
* **[Light & Dark Mode](/theming/light-dark-mode/):** Understand how to set the default color mode and enable user toggling.
|
|
14
|
-
* **[Custom CSS & JS](/theming/custom-css-js/):** Inject your own CSS and JavaScript files for fine-grained control over styling and functionality.
|
|
15
|
-
* **[Using Icons](/theming/icons/):** Enhance navigation and content with SVG icons.
|
|
16
|
-
* **CSS Variables:** The default theme (`default`) is built using CSS variables, making it easier to tweak common properties like colors and fonts via your custom CSS.
|
|
17
|
-
* **Syntax Highlighting:** Code block themes are provided for both light and dark modes via `highlight.js` stylesheets, adapting to the current color mode.
|
|
18
|
-
|
|
19
|
-
The goal is to provide a good-looking, accessible site out-of-the-box, with straightforward ways to adapt it to your specific needs.
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Light & Dark Mode"
|
|
3
|
-
description: "How to configure and manage light and dark themes in your docmd documentation."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Light & Dark Mode
|
|
7
|
-
|
|
8
|
-
`docmd` provides built-in support for light and dark color schemes to enhance readability and user experience. Users can choose their preferred viewing mode, which improves accessibility and reduces eye strain in different lighting conditions.
|
|
9
|
-
|
|
10
|
-
## Setting the Default Theme
|
|
11
|
-
|
|
12
|
-
You can set the default theme for your site in the config file:
|
|
13
|
-
|
|
14
|
-
```javascript
|
|
15
|
-
module.exports = {
|
|
16
|
-
// ... other config ...
|
|
17
|
-
theme: {
|
|
18
|
-
name: 'default', // or 'sky', 'ruby', 'retro'
|
|
19
|
-
defaultMode: 'dark', // Can be 'light' or 'dark'
|
|
20
|
-
enableModeToggle: true, // Enable the toggle button in the UI
|
|
21
|
-
positionMode: 'bottom', // 'top' or 'bottom' - where to show the toggle
|
|
22
|
-
},
|
|
23
|
-
// ...
|
|
24
|
-
};
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
* `defaultMode: 'light'`: The site will initially render with the light color scheme.
|
|
28
|
-
* `defaultMode: 'dark'`: The site will initially render with the dark color scheme.
|
|
29
|
-
* `enableModeToggle: true`: Shows a toggle button for users to switch modes.
|
|
30
|
-
* `positionMode: 'bottom'`: Places the toggle button at the bottom of the sidebar (default).
|
|
31
|
-
* `positionMode: 'top'`: Places the toggle button in the page header (top right).
|
|
32
|
-
|
|
33
|
-
If `defaultMode` is not specified, it defaults to `'light'`.
|
|
34
|
-
|
|
35
|
-
## How It Works
|
|
36
|
-
|
|
37
|
-
The theme is controlled by a `data-theme` attribute on the `<body>` tag of your HTML pages:
|
|
38
|
-
* `<body data-theme="light">` for light mode.
|
|
39
|
-
* `<body data-theme="dark">` for dark mode.
|
|
40
|
-
|
|
41
|
-
For the `sky` theme, the values would be `sky-light` and `sky-dark`.
|
|
42
|
-
|
|
43
|
-
CSS variables in the theme files define colors, backgrounds, fonts, etc., for both modes:
|
|
44
|
-
|
|
45
|
-
```css
|
|
46
|
-
/* Example from main.css */
|
|
47
|
-
:root {
|
|
48
|
-
--bg-color: #ffffff;
|
|
49
|
-
--text-color: #333333;
|
|
50
|
-
/* ... other light theme variables ... */
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
body[data-theme="dark"] {
|
|
54
|
-
--bg-color: #1a1a1a;
|
|
55
|
-
--text-color: #e0e0e0;
|
|
56
|
-
/* ... other dark theme variables ... */
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
body {
|
|
60
|
-
background-color: var(--bg-color);
|
|
61
|
-
color: var(--text-color);
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## User Preference Toggle
|
|
66
|
-
|
|
67
|
-
When `enableModeToggle` is set to `true`, a toggle button appears that allows users to switch between light and dark modes. The position of this button is controlled by the `positionMode` setting:
|
|
68
|
-
|
|
69
|
-
```javascript
|
|
70
|
-
theme: {
|
|
71
|
-
defaultMode: 'light',
|
|
72
|
-
enableModeToggle: true, // Shows the toggle button
|
|
73
|
-
positionMode: 'bottom', // 'bottom' (sidebar) or 'top' (header)
|
|
74
|
-
},
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Toggle Button Positions
|
|
78
|
-
|
|
79
|
-
- **`positionMode: 'bottom'`** (default): The toggle button appears at the bottom of the sidebar
|
|
80
|
-
- **`positionMode: 'top'`**: The toggle button appears in the page header (top right corner)
|
|
81
|
-
|
|
82
|
-
The toggle button uses Lucide icons (`sun` and `moon`) to indicate the current mode and what will happen when clicked.
|
|
83
|
-
|
|
84
|
-
### User Preference Persistence
|
|
85
|
-
|
|
86
|
-
When a user selects a theme, their preference is saved in their browser's `localStorage` so it persists across sessions and page loads. The implementation uses the following logic:
|
|
87
|
-
|
|
88
|
-
1. Check if the user has a saved preference in `localStorage`
|
|
89
|
-
2. If not, use the `defaultMode` from the configuration
|
|
90
|
-
3. When the user clicks the toggle button, update both the display and the stored preference
|
|
91
|
-
|
|
92
|
-
## Syntax Highlighting Themes
|
|
93
|
-
|
|
94
|
-
`docmd` also includes separate stylesheets for code block syntax highlighting that are compatible with light and dark modes:
|
|
95
|
-
|
|
96
|
-
* `highlight-light.css` for light mode
|
|
97
|
-
* `highlight-dark.css` for dark mode
|
|
98
|
-
|
|
99
|
-
The correct syntax highlighting theme is loaded automatically based on the current theme mode. When the user toggles the mode, the appropriate syntax highlighting theme is also switched dynamically.
|
|
100
|
-
|
|
101
|
-
## Customizing Theme Colors
|
|
102
|
-
|
|
103
|
-
You can customize the colors for both light and dark modes by adding custom CSS to your project. See [Custom CSS & JS](/theming/custom-css-js/) for more information.
|
|
104
|
-
|
|
105
|
-
```css
|
|
106
|
-
/* Example of overriding theme colors in your custom CSS */
|
|
107
|
-
:root {
|
|
108
|
-
--link-color: #0077cc; /* Custom link color for light mode */
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
body[data-theme="dark"] {
|
|
112
|
-
--link-color: #4da6ff; /* Custom link color for dark mode */
|
|
113
|
-
}
|
|
114
|
-
```
|
|
Binary file
|