Terminal-Based Writing
Terminal-Based Writing: From Termux to Professional Docs
(A Beginner’s Guide to WordGrinder + Pandoc)
Do you love writing in the terminal but need professional-looking PDFs or Word files? This guide will show you how to:
- Write in Termux using
wordgrinder(a simple terminal word processor). - Convert to Markdown for flexibility.
- Generate beautiful PDFs/DOCX files using
pandoc.
No complex setups—just clear, step-by-step instructions. Let’s begin!
Step 1: Install Termux & Tools
(Skip if you already have Termux!)
- Install Termux (Android terminal emulator).
- Update packages:
pkg update && pkg upgrade - Install WordGrinder (terminal word processor) and Pandoc (document converter):
pkg install wordgrinder pandoc
Step 2: Write in WordGrinder
WordGrinder is a lightweight word processor with bold, italics, and underlines.
Basic Commands
- Open a new file:
wordgrinder my_note.zws - Shortcuts:
Ctrl+S→ SaveCtrl+B→ BoldCtrl+I→ ItalicsCtrl+Q→ Quit
📌 Tip: Save files as .zws (WordGrinder format) or .txt.
Step 3: Convert to Markdown
Pandoc works best with Markdown (.md), so let’s convert:
Export from WordGrinder to
.txt:- Open your file:
wordgrinder my_note.zws - Press
F4→ ChooseExport to text→ Save asmy_note.txt.
- Open your file:
Convert
.txtto.md:pandoc my_note.txt -o my_note.md(Now you have a Markdown file!)
Step 4: Make Beautiful PDFs & Word Files
Pandoc can turn .md into PDFs, Word docs, and more.
A. Convert to DOCX (Microsoft Word)
pandoc my_note.md -o my_note.docx
B. Convert to PDF (With Nice Formatting)
- Install
texlivefor PDF support:pkg install texlive - Generate a PDF:
pandoc my_note.md -o my_note.pdf
📌 Bonus: Add a title, author, and date by editing my_note.md:
---
title: "My Awesome Note"
author: "Your Name"
date: "2024-03-15"
---
# This is my note!
**Bold text** and *italics* work!
Step 5: Automate Everything (Optional)
Tired of typing commands? Use a simple script!
- Create
convert.sh:#!/bin/bash wordgrinder "$1" --export-to-txt "${1%.*}.txt" pandoc "${1%.*}.txt" -o "${1%.*}.md" pandoc "${1%.*}.md" -o "${1%.*}.pdf" echo "Done! PDF generated." - Make it executable:
chmod +x convert.sh - Run it:
./convert.sh my_note.zws
Final Thoughts
Now you can:
✅ Write in Termux (no internet needed!).
✅ Convert notes to Markdown.
✅ Generate PDFs & Word files instantly.
Try it out and let me know how it works for you! 🚀
📖 Want more? Check out:
Happy writing! ✍️
Did this help you? Share your thoughts in the comments! 👇
Comments
Post a Comment