1 unstable release
0.0.1 | Jun 24, 2024 |
---|
#6 in #shopify
145KB
2.5K
SLoC
Liquid Grammar Pest
Pest grammar for parsing Shopify Liquid
- ⬆️ Top of Document
- 🏗️ Requirements
- ⚡ Quick Start
- 🧰 Usage
- 🗒 Notes
- 📈 Contributing
- 📇 Attribution
- ⚖️ Licensing
Requirements
This repository requires Rust language/compiler to build from source
As of last update to this ReadMe file, the recommended method of installing Rust is via the installer script...
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Quick Start
This repository is a Rust library, define it as a dependency within a project
Cargo.toml
file...
Cargo.toml
(snip)
[dependencies]
pest = "2.7.10"
liquid_grammar_pest = "0.0.1"
Check Rust -- Doc -- Specifying Dependencies for details about defining dependencies.
Then include within a source file via use
statement...
src/main.rs
use liquid_grammar_pest::{LiquidParser, Rule};
use pest::Parser;
Usage
Check the tests/
and examples/
files for sample code.
Notes
This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.
This repository is focused on providing grammar and, through Pest, tokenizer only. It is up to crate consumers to implement interpreter, error customization, or any additional features.
Contributing
Options for contributing to liquid-grammar-pest and rust-utilities
Forking
Start making a Fork of this repository to an account that you have write permissions for.
- Add remote for fork URL. The URL syntax is
git@github.com:<NAME>/<REPO>.git
...
cd ~/git/hub/rust-utilities/liquid-grammar-pest
git remote add fork git@github.com:<NAME>/liquid-grammar-pest.git
- Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/rust-utilities/liquid-grammar-pest
git commit -F- <<'EOF'
:bug: Fixes #42 Issue
**Edits**
- `<SCRIPT-NAME>` script, fixes some bug reported in issue
EOF
git push fork main
Note, the
-u
option may be used to setfork
as the default remote, eg.git push -u fork main
however, this will also default thefork
remote for pulling from too! Meaning that pulling updates fromorigin
must be done explicitly, eg.git pull origin main
- Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is
https://github.com/<NAME>/<REPO>/pull/new/<BRANCH>
Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.
Sponsor
Thanks for even considering it!
Via Liberapay you may
on a
repeating basis.
Regardless of if you're able to financially support projects such as liquid-grammar-pest that rust-utilities maintains, please consider sharing projects that are useful with others, because one of the goals of maintaining Open Source repositories is to provide value to the community.
Attribution
License
This project is licensed based on use-case
Commercial and/or proprietary use
If a project is either commercial or (||
) proprietary, then please
contact the author for pricing and licensing options to make use of code and/or
features from this repository.
Non-commercial and FOSS use
If a project is both non-commercial and (&&
) published with a license
compatible with AGPL-3.0, then it may utilize code from this repository under
the following terms.
Pest grammar for parsing Shopify Liquid
Copyright (C) 2024 S0AndS0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
... For further details review full length version of AGPL-3.0 License.
Dependencies
~2–2.8MB
~57K SLoC