Skip to content
notwitheringPublic

About

lightweight static file preprocessor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

31 Commits

Folders and files

Repository files navigation

graft

graft is a lightweight hackable static file preprocessor

it takes static files with include or templating commands, and outputs the same static files but with the commands resolved. so include commands are replaced with other files, extend commands will template into other files, etc.

without graft, you might have many HTML (or other) files with repeated sections, all of which must be updated manually. with graft, you can include files into other files using commands like <g-include header.html />. after compilation, itll be just like you copy and pasted that file

examples

graft is probably most useful for making websites following DRY principles. see examples/website

but its not only for websites, it can be used for anything static, such as txt files. see examples/txt-filesand examples/custom-commands

for more examples see the examples directory

opionated parts

  • the preset package is an opinionated map-based implementation of graft, but it is still very capable, every example in examples directory uses it, but it is suggested to write your own implementation to your use case if you need more flexibility
  • token/syntaxes.go only contains map-based syntax definitions, maybe i should include some string based ones

notes

i havent made a full scale website to test it with yet but soon ill be starting a project which will use this, and ill probably find bugs that i will fix

btw if you have any questions, make an issue

About

lightweight static file preprocessor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages