mirror of
https://github.com/hanzoskill/substack-formatter.git
synced 2026-10-30 21:10:22 +00:00
2.6 KiB
2.6 KiB
Substack Article Formatter
Transform plain text into professional Substack format. Ensures proper HTML formatting so bold/italic/headers work correctly when pasted into Substack editor.
โจ Key Features
- Clean formatting for better readability
- Proper HTML output that Substack editor recognizes
- Copy-paste ready with formatting preserved
- Minimal or standard formatting options
๐ Quick Start
# Basic formatting
python3 formatter.py "Your content here"
# With specific structure
python3 formatter.py "Your content here" micro-story
# Format and copy to clipboard (Linux)
python3 formatter.py "Your content here" | python3 copy_to_substack.py
๐ Copy-Paste Process
- Format your content using the formatter
- Copy as HTML using the copy script
- Paste into Substack - formatting preserved automatically!
Linux/WSL:
# Install dependencies
sudo apt install pandoc xclip # Ubuntu/Debian
sudo pacman -S pandoc xclip # Arch
# Format and copy
python3 formatter.py "Your text" > output.html
python3 copy_to_substack.py "$(cat output.html)"
macOS:
brew install pandoc
# Use pbcopy instead of xclip (modify copy script as needed)
๐ฏ Formatting Options
Standard Formatting
Clean paragraph structure with proper HTML tags
Minimal Formatting
Pure spacing improvements with exact content preservation
๐ Files
formatter.py- Main formatting enginecopy_to_substack.py- HTML clipboard utilitytest_formatter.py- Test all formatsexamples.md- Before/after examplesSKILL.md- Complete documentation
๐งช Testing
# Test all formatting types
python3 test_formatter.py
# Test specific format
python3 formatter.py "Your content" micro-story
๐ง Integration with Bot
Just tell Bot:
"Format this for Substack: [your content]"
Or be specific:
"Format this for Substack as a micro-story: [your content]"
The skill handles:
- Viral pattern application
- HTML conversion
- Copy instructions
- Formatting verification
โ ๏ธ Technical Notes
Why HTML conversion is needed: Substack editor treats raw markdown as plain text. The solution is converting to HTML and copying as text/html format so Substack recognizes the formatting.
Dependencies:
pandoc- Markdown to HTML conversionxclip(Linux) - Clipboard management with MIME typespbcopy(macOS) - Alternative clipboard tool
๐ฏ Philosophy
Format for readability, preserve your voice. This tool improves visual presentation while keeping your message and personality intact.