README file from
GithubTesting Guide for Obsidian Sample Plugin with Markdown to HTML Conversion md2html
Prerequisites
-
Python must be installed and available in your PATH
- To verify: Open a terminal/command prompt and run
python --versionorpython3 --version - If you get an error, install Python from https://www.python.org/downloads/
- On Windows, make sure to check "Add Python to PATH" during installation
- To verify: Open a terminal/command prompt and run
-
Obsidian Developer Mode enabled
- Settings → About → Toggle "Developer mode" ON
Installation
- The plugin should already be built (you just ran
npm run buildsuccessfully) - In Obsidian:
- Settings → Community plugins
- Click "Open plugins folder"
- Verify you see the
obsidian-sample-pluginfolder - Go back to Community plugins
- Toggle "Sample Plugin" ON
Testing Steps
1. Basic Conversion Test
- Open any Markdown note in your vault (or create a new one)
- run
npm run devon the plugin before opening the folder forgot to say it before (for testing purpose bro aparum adhu ae varum) - Press
Ctrl+Pto open the command palette - Type "Convert current Markdown to HTML" and select it
- You should see a notice like: 📄 Exported to HTML: [path/to/your/file.html]
2. Verify Output
- Check that an HTML file was created:
- If you didn't set an export folder: same folder as your Markdown file
- If you set an export folder: in that specified folder this one works well bro we can add in pipline later for vercel deployments.
- Open the HTML file in a web browser to verify:
- The Markdown was converted correctly
- The selected theme (light/dark/blue) is applied
3. Test Settings
- Go to Obsidian Settings → "Sample Plugin" in the left sidebar
- Try changing:
- Export Theme (Light/Dark/Blue)
- Export Folder (leave empty or set a path)
- Close settings and run the conversion command again
- Verify the output reflects your changes
4. Test Error Handling
- Try running the command when no Markdown file is open
- You should see: "Please open a Markdown file first."
- Try renaming or deleting
md2html.pytemporarily - Run the command and check for appropriate error notice
Expected Behavior
Success Case
- Notice: 📄 Exported to HTML: [full/path/to/file.html]
- HTML file created in specified location
- File contains properly formatted HTML with selected theme CSS
Error Cases
- No Markdown open: "Please open a Markdown file first."
- Python not found: "❌ Error spawning Python: [error details]"
- Conversion fails: "❌ Conversion failed (code [number]). See console for details."
Configuration
Settings are stored in:
.obsidian/plugins/obsidian-sample-plugin/data.json
Example:
{
"exportTheme": "dark",
"exportPath": "D:/MyExports"
}
Troubleshooting
"Spawn python ENOENT" Error
This means Python wasn't found in your system PATH. Solutions:
- Install Python from https://www.python.org/downloads/
- On Windows, reinstall and check "Add Python to PATH"
- On Mac/Linux, ensure python3 is installed and in PATH
- Restart Obsidian after installing Python
No Notice Appears
- Open DevTools in Obsidian (
Ctrl+Shift+IorCmd+Option+I) - Check the Console tab for error messages
- Verify the plugin is enabled in Community plugins
HTML File Not Created
- Check the notice for the output path
- Verify that folder exists and is writable
- Check Console for any Python script errors
Notes
- The plugin uses your system's Python installation
- First run may take a moment as it locates the Python executable
- Subsequent conversions should be faster
- The plugin works with any valid Markdown file
- HTML output includes full HTML document with embedded CSS theme
Enjoy converting your Markdown notes to beautiful HTML files! 🚀