Skip to content

poetry book command line interface

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

poetry-book/poetry-book-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poetry book cli

Crates.io CI unsafe forbidden

Poetry-book Command line interface.

Create a latex poetry book starting from poems written in plain text files.

Install

$ cargo install poetry-book-cli

Usage

USAGE:
    poetry-book-cli <book-dir>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <book-dir>    The path of the book directory

Directory

The directory structure that contains the input of the program looks like this:

.
├── book.json
├── poems/
│   ├── A Silvia
│   ├── La ginestra.txt
│   └── L'infinito
└── Preface.txt

book.json

book.json file has the following format:

{
    "author": "Giacomo Leopardi",
    "title": "Leopardi's poetry book",
    "toc_title": "Table of Contents",
    "language": "Italian",
    "preface": "Preface.txt",
    "poem_formatting": {
        "centered_verse": "average"
    },
    "poems": [
        "La ginestra.txt",
        "L'infinito",
        "A Silvia"
    ]
}
  • author: book author
  • title: book title
  • toc_title: table of contents title (optional)
  • language: language of the poems (optional)
  • preface: filename of the preface (optional). The preface (without extension) is used as preface title.
  • poem_formatting: how poems should be formatted (optional)
    • centered_verse: Determine which verse will be centered. There are two options:
      • longest: The verse with the longest length (default)
      • average: A verse with a number of 'x' equal to the average length among all verses
  • poems: ordered list of poems filename. The filename (without extension) is used as poem title.

Poems

Poems are just plain text files, with an empty line between stanzas. The name of the file (without extension) is the poem title, the content of the file is the poem body.

Preface

Preface is just a plain text file, with an empty line between paragraphs. The name of the file (without extension) is the preface title, the content of the file is the preface body.

Output

When you run the executable, the output is places in the out/ directory.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

poetry book command line interface

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages