joshuamccall.com
| joshmccall221
| joshmccall
Writing Articles with Plop
This gitbook uses Plop to scaffold new articles. Here's how to create a new article:
Quick Start
npm run new
What You'll Be Asked
Plop will prompt you for three pieces of information:
- link? - The URL or reference link for your article (can be left blank)
- Article name? - The name of your article (required)
- Draft? - Whether this is a draft (y/n)
What Gets Created
When you run npm run new, plop will:
- Create a new article file in
articles/.md - Create a summary entry file in
plop/:plop/article_.md(if not a draft)plop/draft_.md(if marked as draft)
Building Your SUMMARY.md
After creating articles, run the build process to update your table of contents:
npm run go
This command will:
- Recreate SUMMARY.md
- Collect all article entries from
plop/article_*files - Collect all draft entries from
plop/draft_*files - Append them to SUMMARY.md
- Clean up the temporary plop files
- Build the gitbook
- Copy keybase.txt to docs
- Show git status
Complete Workflow Example
# Create a new article
<!-- toc -->
- [Answer the prompts:](#answer-the-prompts)
- [link? https://example.com/my-article](#link-httpsexamplecommy-article)
- [Article name? My Awesome Article](#article-name-my-awesome-article)
- [Draft? n](#draft-n)
- [Build and update everything](#build-and-update-everything)
- [Serve locally to preview](#serve-locally-to-preview)
<!-- tocstop -->
npm run new
# Answer the prompts:
# link? https://example.com/my-article
# Article name? My Awesome Article
# Draft? n
# Build and update everything
npm run go
# Serve locally to preview
npm run serve
Development Commands
npm run serve- Serve the gitbook locallynpm run build- Build the gitbook to ./docsnpm run new- Create a new article with plopnpm run go- Full build process (summary + build + cleanup)