Skip to main content

No project description provided

Project description

Nanodoc

Nanodoc is a minimalist document bundler designed for small-scale documentation needs like hints, prompts, or reminders. It combines multiple text files into a single document with neat formatting.

Features

  • Combines multiple text files into a single document
  • Adds clear title separators between pages
  • Supports optional line numbering (per file or global)
  • Can generate a table of contents
  • Flexible file selection methods
  • Customizable header styles and sequence numbering

Usage

Basic usage:

nanodoc file1.txt file2.txt

With line numbering and TOC:

nanodoc -n file1.txt file2.txt              # Per-file line numbering
nanodoc -nn file1.txt file2.txt             # Global line numbering
nanodoc -nn --toc file1.txt file2.txt       # Global numbering with TOC

File Selection Options

Nanodoc is flexible in how you specify the files to bundle:

  1. Individual files: Provide file paths as arguments

    nanodoc welcome.txt guide.txt reference.txt
    
  2. Directories: Include all .txt and .md files in a directory

    nanodoc docs/
    
  3. Bundle files: Create a text file containing a list of file paths

    nanodoc my-bundle.txt
    

    Where my-bundle.txt contains:

    intro.txt
    chapter1.md
    appendix.txt
    

Command Line Options

  • -v, --verbose: Enable verbose output with detailed logging
  • -n: Add per-file line numbering (01, 02, etc.)
  • -nn: Add global line numbering (001, 002, etc.)
  • --toc: Generate a table of contents at the beginning
  • --no-header: Hide file headers completely
  • --header-seq=TYPE: Add sequence numbers to headers (numerical, letter, or roman)
  • --header-style=STYLE: Change header style (nice [default], filename, or path)
  • -h, --help: Display help information

Example Output

########################## welcome.txt #######################################
This is the content of welcome.txt
With multiple lines
Of helpful information

########################## guide.txt ########################################
The guide contains more detailed information
About how to use the application
With step-by-step instructions

With line numbering (-n):

########################## welcome.txt #######################################
   1: This is the content of welcome.txt
   2: With multiple lines
   3: Of helpful information

########################## guide.txt ########################################
   1: The guide contains more detailed information
   2: About how to use the application
   3: With step-by-step instructions

Header Styles

Nanodoc offers several header style options (with "nice" being the default):

Filename style:

welcome.txt

This is the content of welcome.txt

Path style:

/path/to/welcome.txt

This is the content of welcome.txt

Nice style (default):

Welcome (welcome.txt)

This is the content of welcome.txt

These styles can be combined with sequence numbering (--header-seq=numerical|letter|roman) to create headers like i. Welcome (welcome.txt).

The table of contents entries will use the same style as the headers, providing a consistent look throughout the document.

Installation

pip install nanodoc
# or
git clone https://github.com/yourusername/nanodoc.git
cd nanodoc
pip install -e .

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanodoc-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanodoc-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file nanodoc-0.1.0.tar.gz.

File metadata

  • Download URL: nanodoc-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for nanodoc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4de66326d9005d649066335ce5b16c9448ec31c11000b6f454921ca316a55ac9
MD5 9d2b6419120c3c2847e38797e6ee2b64
BLAKE2b-256 2fce6985fe97e7ad6e55f6b761d026d0a4b35958e4d34f682a383755563c525f

See more details on using hashes here.

File details

Details for the file nanodoc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nanodoc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for nanodoc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b38ef2ffe3b3113f38c81cbb64aa2ff6dd681a9968e0a40f59ff371736a8ca4
MD5 65b39e8c0391783d9e0e78f8104df100
BLAKE2b-256 a2cc8aabab5cc2088c6403e692d73d5ca3fa6bd80dbb3ae5c4fed83a8cfb2883

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page