Skip to content

JMAlego/phyb

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

PHyB: Python Hypertext Builder

PHyB (/fɪb/) is a simple (cursed) hypertext builder/processor using python in less than 200 lines of code.

Requirements

You need python 3.6+ for PHyB to work.

Usage

To run PHyB on a single file use:

./phyb ./website/index.phb ./build/index.html

To run PHyB on a folder use:

./phyb ./website/ ./build/

The usage string currently looks like this:

usage: phyb [-h] [-v] INPUT_PATH [OUTPUT_PATH]

PHyB: Python Hypertext Builder.

positional arguments:
  INPUT_PATH
  OUTPUT_PATH

optional arguments:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit

Examples

Here's an example simple page:

{!
from datetime import date
!}
<!doctype html>
<html>

  <head>
    <title>Simple little page.</title>
  </head>

  <body>
    <p>This page was generated on {$ date.today() $}.</p>
  </body>

</html>

Which would produce the following output (well if the date was 2020-03-09):

<!doctype html>
<html>

  <head>
    <title>Simple little page.</title>
  </head>

  <body>
    <p>This page was generated on 2020-03-09.</p>
  </body>

</html>

Extra

PHyB is currently used to generate my website polyomino.xyz.

About

Simple (cursed) static website generation with python in less than 200 lines of code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages