Skip to content

JerryHue/paper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paper-cli

⚠ This project is not actively maintained. See: https://github.com/Andrewnt219/paper-csharp

Static site generator (SSG) made with Rust.

Sample website: https://paper-sample.vercel.app/

To start running:

  1. Install Rust

  2. Run

$ cargo run -- --help

USAGE:
    paper.exe [OPTIONS]

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

OPTIONS:
    -i, --input <FILE>...             Path to file(s)
    -o, --output <FILE>               Path to output file
    -s, --stylesheet <URL or FILE>    Link to stylesheet

Implemented optional features

🎉 Generate index.html

The index file includes paths to all the generated html files (recursively)

$ cargo run -- -i dir-with-nested-dirs-and-files

🌟 Pass in stylesheet's file OR url as a CLI arg

Content of .css files are bundled into all the generated .html files

$ cargo run -- -i page.txt --stylesheet ./my-style.css

🎉 Keep source folder structure

If a directory is passed as --input, dist keeps the structure of the source dir

$ cargo run -- -i sample-dir

├── sample-dir
├── Cargo.toml
├── sample-dir
│   ├── sub-dir-1
│   └── sub-dir-2
│       └── page-1.txt
├── dist
│   ├─ sample-dir
│       ├── sub-dir-1
│       └── sub-dir-2
│           └── page-1.html

🌟 Parse title

Title is the first line of the file, followed by 2 empty lines

🌟 Pass in output dir as argument

Specify a different output directory, default is dist

🎉 Parse Markdown #-like headers from <h1> to <h6>

Markdown syntax supports HTML headers from <h1> to <h6> as # all the way to ######, respectively.

$ cargo run -- -i sample.txt --output pages

Releases

No releases published

Packages

No packages published

Languages

  • Rust 97.9%
  • HTML 1.7%
  • CSS 0.4%