-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45a3a10
commit 29f5780
Showing
5 changed files
with
136 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Check | ||
"on": | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: denoland/setup-deno@v1 | ||
- name: Format | ||
run: deno fmt && git diff-index --quiet HEAD | ||
- name: Lint | ||
run: deno lint && git diff-index --quiet HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Publish | ||
"on": | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: {} | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: denoland/setup-deno@v1 | ||
- name: Publish package | ||
run: deno publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.unstable": true, | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[markdown]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
}, | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
}, | ||
"files.eol": "\n" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,81 @@ | ||
# htx | ||
An HTML rendering library in JSX. | ||
# [@fartlabs/htx](https://jsr.io/@fartlabs/htx) | ||
|
||
[![GitHub Actions][GitHub Actions badge]][GitHub Actions] | ||
|
||
Render HTML components with JSX. | ||
|
||
## API documentation | ||
|
||
Generated API documentation is available at <https://jsr.io/@fartlabs/htx>. | ||
|
||
## Getting started | ||
|
||
### Deno | ||
|
||
Let's learn how to get started with rtx by creating a simple router in Deno. | ||
|
||
1\. [Install Deno](https://docs.deno.com/runtime/manual). | ||
|
||
2\. Start a new Deno project. | ||
|
||
```sh | ||
deno init | ||
``` | ||
|
||
3\. Add `@fartlabs/jsonx` and `@fartlabs/htx` as project dependencies. | ||
|
||
```sh | ||
deno add @fartlabs/jsonx @fartlabs/htx | ||
``` | ||
|
||
4\. Add the following values to your `deno.json(c)` file. | ||
|
||
```json | ||
{ | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "@fartlabs/jsonx" | ||
} | ||
} | ||
``` | ||
|
||
5\. Add a file ending in `.[j|t]sx` to your project. For example, `main.tsx`. | ||
|
||
```tsx | ||
import { a } from "@fartlabs/htx"; | ||
|
||
const html = <a href="https://example.com">Hello, world!</a>; | ||
|
||
Deno.writeTextFileSync("index.html", html); | ||
``` | ||
|
||
6\. Compile your HTML by running the `.[j|t]sx` file. | ||
|
||
```sh | ||
deno run --allow-net main.tsx | ||
``` | ||
|
||
Resulting `index.html`: | ||
|
||
```html | ||
<a href="https://example.com">Hello, world!</a> | ||
``` | ||
|
||
## Contribute | ||
|
||
### Style | ||
|
||
Run `deno fmt` to format the code. | ||
|
||
Run `deno lint` to lint the code. | ||
|
||
--- | ||
|
||
Developed with ❤️ [**@FartLabs**](https://github.com/FartLabs) | ||
|
||
[JSR]: https://jsr.io/@fartlabs/htx | ||
[JSR badge]: https://jsr.io/badges/@fartlabs/htx | ||
[JSR score]: https://jsr.io/@fartlabs/htx/score | ||
[JSR score badge]: https://jsr.io/badges/@fartlabs/htx/score | ||
[GitHub Actions]: https://github.com/FartLabs/htx/actions/workflows/check.yaml | ||
[GitHub Actions badge]: https://github.com/FartLabs/htx/actions/workflows/check.yaml/badge.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |