Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/konapun/bauplan
A general-purpose templating system for PHP
https://github.com/konapun/bauplan
Last synced: 23 days ago
JSON representation
A general-purpose templating system for PHP
- Host: GitHub
- URL: https://github.com/konapun/bauplan
- Owner: konapun
- Created: 2014-10-31T23:02:07.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-30T00:00:25.000Z (almost 9 years ago)
- Last Synced: 2024-10-16T17:54:37.566Z (2 months ago)
- Language: PHP
- Size: 106 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bauplan
Bauplan is a modular, general-purpose templating system for PHP (like so, so many others). The goal of this project is mainly to play around with creating a simple language from scratch and end with a usable product.## Syntax
The BNF grammar for Bauplan is located [here](bnf/grammar.bnf). Logic is mainly performed through user-definable directives which eliminates the need for logic operations in the core language.###Example
$$PREPROCESSOR-DIRECTIVE EXAMPLE
;;(
This is a block comment. This example shows a bauplan grammar which is
parseable by the current version.
;;)
*(template-identifier {
directive1: "directive argument 1", "directive argument 2", 3
| directive2: "one argument"
| directive-with-no-args
}
@(section { ;; this is an inline comment
section-directive-example
}
"this is the section body"
)
$(var-1 {value: "test" | readonly}) ;; a variable
)The PHP API into Bauplan provides a number of different operations depending on the data type (template, section, variable, etc.)
## Project status
- [x] Create grammar
- [x] Implement lexer
- [x] Implement parser
- [ ] Implement core language on top of AST, including PHP API
- [ ] Define directives
- [ ] Usable product