Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daymxn/khtml
Lightweight HTML5 DSL written in pure Kotlin!
https://github.com/daymxn/khtml
documentation dsl functional gradle hacktoberfest hacktoberfest-2022 hacktoberfest2022 html html5 jvm kotlin lightweight modular
Last synced: 3 months ago
JSON representation
Lightweight HTML5 DSL written in pure Kotlin!
- Host: GitHub
- URL: https://github.com/daymxn/khtml
- Owner: daymxn
- License: apache-2.0
- Created: 2022-07-26T01:38:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-05T00:09:31.000Z (over 2 years ago)
- Last Synced: 2024-04-17T22:58:54.168Z (10 months ago)
- Topics: documentation, dsl, functional, gradle, hacktoberfest, hacktoberfest-2022, hacktoberfest2022, html, html5, jvm, kotlin, lightweight, modular
- Language: Kotlin
- Homepage: https://khtml.daymxn.com/
- Size: 156 KB
- Stars: 6
- Watchers: 2
- Forks: 5
- Open Issues: 95
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
![GitHub release (latest by date)](https://img.shields.io/github/v/release/daymxn/kHTML?style=flat-square)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/daymxn/kHTML/main?style=flat-square)
![GitHub issues](https://img.shields.io/github/issues/daymxn/kHTML?style=flat-square)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/daymxn/kHTML?style=flat-square)
![GitHub](https://img.shields.io/github/license/daymxn/kHTML?style=flat-square)
# kHTMLSuper light-weight HTML5 DSL written in pure Kotlin!
Learn how to use kHTML by reading our wiki [here.](https://khtml.daymxn.com/en/overview/)
## Example
```kotlin
fun makeUserDisplay(users: List) =
html {
body {
this write users.map { userEntry(it) }
}
}fun userEntry(name: String) =
div {
p {
this write "Hello! My name is $name"
}
}
```## Installation
Unfortunately, kHTML artifacts are not currently available on maven central. The reasoning for this can be found [here.](https://github.com/daymxn/kHTML/issues/1)
For the time being, you can pull kHTML artifacts from GitHub Packages.
**_Gradle_**
```kotlin
implementation("com.daymxn:khtml:1.0.0")
```**_Maven_**
```xmlcom.daymxn
khtml
1.0.0```
## Notable features
- 1:1 Mapping between HTML elements and Kotlin classes
- Easily compile kHTML elements to string representations of HTML5
- Functional element creation support
- Fully documented API
- Modular API to allow easy extendability
- Lightweight DSL## Roadmap
- Add unit tests
- Add support for additional common HTML5 elements
- Extend elements to offer _all_ props typically offered from their HTML counterpart## Getting Started
[Basics](https://khtml.daymxn.com/en/getting%20started/basics/)
[Adding Text](https://khtml.daymxn.com/en/getting%20started/text/)
[Functional Elements](https://khtml.daymxn.com/en/getting%20started/functional-elements/)
[More Functional Elements](https://khtml.daymxn.com/en/getting%20started/functional-elements-again/)
[Configuring Elements](https://khtml.daymxn.com/en/getting%20started/configuring-elements/)
[Adding custom Tags](https://khtml.daymxn.com/en/getting%20started/adding-custom-tags/)
## Contributing
Contributions are always welcome!
See [contributing.md](/contributing.md) for ways to get started.
## License
[Apache 2.0](/LICENSE)