Skip to content

!!Bang!! - A text processor and static website generator. Bang lets you put holes through text files!

License

Notifications You must be signed in to change notification settings

BreadMakesYouFull/Bang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

!!BANG!!

A text processor / static website generator.

💥 Put holes through text files 💥

Preview

Bang comprises of a minimal markup language, and a short python script. For processing text replacements in modular files.

Language: Python, Bang markup

Licence: MIT

Learn more:

Requires

  • python 3
  • bash

Quickstart

# Process example files and open in web browser
./run.sh

Bang markup syntax

keyword definitions

Assignment Operators:

!    - for assigning a word or line of text to a !!keyword!!
!!   - for assigning file contents to a !!keyword!!
!!!  - for assigning the return value of a shell commmand to a !!keyword!!

keyword replacement

Keywords are enclosed in exclamation marks !!, a.k.a double bangs

!!keyword!!

This allows us to replace text with variables:

/* style.css */

* {
  background-color: !!bg_colour!!;
  colour: !!color!!;
  font-family: !!font!!;
}

And for text files to be modular:

<!-- index.html -->
!!html_start!!
!!head!!
!!body!!
!!html_end!!

Process individual files

Process a text file:

./bang.sh markup.bang in/example.txt > out/example.txt

Process a webpage:

./bang.sh markup.bang in/index.html > out/index.html

Process multiple files

You can chain standard bash utilities for processing multiple files.

See run.sh

Extra notes

This version, v2.0.0, is a much simplified re-implementation. You can still access v1.0.0 here

"broken glass 2" by Nesster is licensed under CC BY 2.0

About

!!Bang!! - A text processor and static website generator. Bang lets you put holes through text files!

Resources

License

Stars

Watchers

Forks

Packages

No packages published