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:

  1. Write in Termux using wordgrinder (a simple terminal word processor).
  2. Convert to Markdown for flexibility.
  3. 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!)

  1. Install Termux (Android terminal emulator).
  2. Update packages:
    pkg update && pkg upgrade
    
  3. 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 → Save
    • Ctrl+B → Bold
    • Ctrl+I → Italics
    • Ctrl+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:

  1. Export from WordGrinder to .txt:

    • Open your file:
      wordgrinder my_note.zws
      
    • Press F4 → Choose Export to text → Save as my_note.txt.
  2. Convert .txt to .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)

  1. Install texlive for PDF support:
    pkg install texlive
    
  2. 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!

  1. 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."
    
  2. Make it executable:
    chmod +x convert.sh
    
  3. 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

Popular posts from this blog

Markdown Quick Tutorial

To install Jupyter Notebook on Ubuntu (Linux)