Skip to content

Commit

Permalink
feat(ci): setup (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvng authored Feb 3, 2024
1 parent 7765344 commit ea651dd
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on: [push]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
RUSTFLAGS: --deny warnings

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- uses: swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo build
- run: cargo check
- run: cargo lint --all-targets
- run: cargo test
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# jrsx

A JSX-like superset of [Askama][1].
![CI](https://github.com/cvng/jrsx/actions/workflows/ci.yml/badge.svg?branch=main)

A clean `JSX` syntax for your [Askama][1] templates.

<table>
<tr><td>Before:</td></tr>
<tr><td>

```html
{%- import "hello.html" as hello_scope -%}
{%- import "child.html" as child_scope -%}

{% call hello_scope::hello(name) %}
{% call hello_scope::hello(name=name) %}
{% call hello_scope::hello(name="world") %}
{% call child_scope::child() %}Super!{% endcall %}
```
</td></tr>
<tr><td>After:</td></tr>
<tr><td>

```html
<Hello name />
<Hello name=name />
<Hello name="world" />
<Child>Super!</Child>
```
</td></tr>
</table>

[1]: https://djc.github.io/askama
1 change: 1 addition & 0 deletions parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ fn skip_till<'a, O>(
) -> impl FnMut(&'a str) -> ParseResult<'a, (&'a str, O)> {
enum Next<O> {
IsEnd(O),
#[allow(dead_code)]
NotEnd(char),
}
let mut next = alt((map(end, Next::IsEnd), map(anychar, Next::NotEnd)));
Expand Down
1 change: 1 addition & 0 deletions rewriter/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ fn skip_till<'a, O>(
) -> impl FnMut(&'a str) -> ParseResult<'a, (&'a str, O)> {
enum Next<O> {
IsEnd(O),
#[allow(dead_code)]
NotEnd(char),
}
let mut next = alt((map(end, Next::IsEnd), map(anychar, Next::NotEnd)));
Expand Down

0 comments on commit ea651dd

Please sign in to comment.