Keep the article as a normal .md file, make every reader-facing link and image portable, preview it in StackDraft, fix the compatibility warnings, and copy the title and rich-text body into Substack separately.
StackDraft runs locally in your browser. No account or upload required.
Keep the article source publishable
A repository article should be understandable without your editor state. Use standard Markdown where possible, store supporting images in a deliberate location, and avoid links that only work from the current checkout. This makes the source useful in code review and reduces surprises in the publishing handoff.
Do not put credentials, unpublished internal URLs, customer identifiers, or machine-specific paths in examples. A Git diff is an excellent final privacy review because it shows exactly what changed in the article and its assets.
content/
agent-loop.md
images/
agent-loop.png
samples/
agent-loop.tsFix relative links and local images
| Source reference | Works locally? | Publishing action |
|---|---|---|
| ./images/diagram.png | Yes | Upload the image or use a public asset URL |
| ../src/example.ts | Yes | Link to a public repository URL and stable revision |
| http://localhost:3000 | Only on your machine | Replace with the production URL or explain it as a local example |
| #section-name | Usually | Confirm the final Substack heading creates the expected anchor |
| https://example.com/docs | Yes | Check that the destination is public and current |
Publish from VS Code in seven steps
- 01
Write and preview the Markdown
Use VS Code’s preview to catch malformed headings, lists, links, fences, and tables while the draft is still in the repository.
- 02
Run the code you show
Test commands and examples from a clean enough environment to catch omitted imports, stale flags, and output that no longer matches the prose.
- 03
Review the diff
Scan for secrets, internal references, accidental changes, oversized assets, and language that only makes sense to repository collaborators.
- 04
Load the .md file into StackDraft
Drag the file into the app and compare the rendered article with the intended outline. The draft remains in the browser.
- 05
Resolve publishing checks
Fix missing alt text, local asset paths, long code, wide tables, heading jumps, and diagrams that need static rendering.
- 06
Copy title and body
Put the title in Substack’s title field, paste the prepared body into the editor, and confirm every generated asset arrives.
- 07
Send a test email
Validate the actual reader experience: mobile width, code readability, link destinations, image descriptions, and dark-mode contrast.
Use source control as an editorial tool
- Keep article edits separate from unrelated product changes when possible.
- Review prose and code examples in the same commit so they cannot silently diverge.
- Use descriptive image filenames and include the editable diagram source.
- Check changed URLs instead of assuming an old link is still public.
- Ask a reviewer to follow the instructions, not just proofread them.
- Tag or record the source revision associated with the published article.
Prepare technical blocks for the inbox
A Markdown preview shows what a capable web renderer can do; it does not show what an email client will preserve. Convert Mermaid blocks to PNG, reduce tables to a few columns, shorten code, and use plain-language explanations around every complex artifact.
StackDraft uses GitHub Flavored Markdown for tables, highlights fenced code, renders Mermaid locally, and warns about patterns that tend to fail in publishing. Use the preview as an intermediate quality gate, then use Substack’s test email as the final one.
Repository-to-newsletter checklist
- The Markdown passes the project’s formatter or lint rules, if any.
- Every code example has been tested and trimmed for the article.
- No secret, internal hostname, customer data, or personal path appears in the diff.
- Relative links and images have a publishing destination.
- The article has one H1 and a coherent heading outline.
- Tables, code, and diagrams fit a phone-width reading experience.
- The Substack title and body are separated correctly.
- A real test email passes before the post is scheduled or sent.
Frequently asked questions
Can I paste VS Code’s Markdown preview into Substack?
Sometimes basic formatting transfers, but editor previews are not designed as publishing converters. Use a dedicated rich-text copy step and check tables, code, images, and diagrams in the final Substack draft.
Will relative image paths work in Substack?
No. A path such as ./images/chart.png refers to your local project or repository context. Upload the file to Substack or replace the path with a suitable public asset URL.
Should the published post link to main or a commit?
Use a commit, tag, or release when the article depends on exact code. Use the main documentation URL when readers should always see the latest maintained instructions.
Can StackDraft open a .md file?
Yes. You can drag in a Markdown file or choose one with the file picker, then preview and prepare it locally in the browser.
Sources and further reading
Turn the Markdown draft into clean Substack copy.
Preview the post, catch fragile blocks, and copy the title and body separately.
Open StackDraft free