You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactored plugin to use Docusaurus native plugin APIs, removing the need for users to manually copy theme files. Users now only need to add the plugin to their config - components are automatically bundled and loaded.
Changes:
- Added getThemePath() to provide theme components from plugin
- Restructured directories: src/theme → theme, src/components → components
- Updated component imports to use relative paths
- Version bump to 2.0.0 (breaking change)
- Added .gitignore for node_modules and dev files
- Updated README with zero-config installation and v1.x migration guide
Tested in production: 58 markdown files processed, dropdown working, .md URLs accessible.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Visit any docs page - you should see the "Open Markdown" dropdown in the header!
166
148
149
+
## Migration from v1.x
150
+
151
+
If you're upgrading from v1.x where you manually copied theme files:
152
+
153
+
### 1. Remove Manually Copied Files
154
+
155
+
```bash
156
+
# Remove the manually copied theme file
157
+
rm -rf src/theme/Root.js
158
+
159
+
# Remove the manually copied component
160
+
rm -rf src/components/MarkdownActionsDropdown/
161
+
```
162
+
163
+
### 2. Update the Plugin
164
+
165
+
```bash
166
+
npm update docusaurus-markdown-source-plugin
167
+
```
168
+
169
+
### 3. Keep Your Custom CSS
170
+
171
+
The CSS styles in `src/css/custom.css` remain unchanged - no action needed.
172
+
173
+
### 4. Rebuild
174
+
175
+
```bash
176
+
npm run build
177
+
npm run serve
178
+
```
179
+
180
+
**Note:** The plugin now bundles all components internally. If you had customizations to the copied files, you'll need to use Docusaurus's [swizzling](https://docusaurus.io/docs/swizzling) feature to override them.
181
+
167
182
## How It Works
168
183
169
184
1.**Build Time**: The plugin processes all markdown files in `docs/` during build:
@@ -333,18 +348,19 @@ You can customize the dropdown appearance by overriding these CSS classes in you
333
348
334
349
### Dropdown Not Appearing
335
350
336
-
1.**Check path configuration**: Ensure the component checks for the correct path. If your docs are at `/documentation/` instead of `/docs/`, edit `src/components/MarkdownActionsDropdown/index.js`:
1.**Check plugin installation**: Ensure the plugin is in your `docusaurus.config.js` plugins array.
352
+
353
+
2.**Rebuild your site**: After installing, run `npm run build` to ensure the plugin is loaded.
354
+
355
+
3.**Check browser console**: Look for any errors that might indicate component loading issues.
340
356
341
-
2.**Verify Root.js is being used**: Check browser console for errors. The file should be at `src/theme/Root.js`.
357
+
4.**Verify path configuration**: The default path is `/docs/`. If your docs use a different path (e.g., `/documentation/`), you may need to swizzle the component and customize it.
0 commit comments