Skip to content

Commit

Permalink
Update package version and improve documentation
Browse files Browse the repository at this point in the history
This commit updates the version of the package from '1.0.3' to '1.0.4' and makes several improvements to the documentation in the readme file.

The readme changes include clearer examples of how to use the Handlebars library and update installation instructions. The description of the library has been rephrased to emphasize its focus on backend generation. A detailed example has also been added to demonstrate the available features of the library.

Moreover, two binary files, 'small.jpg' and 'social.jpg', have been updated, but the specific changes to these files are not detailed in the diff.
  • Loading branch information
elliotberry committed Feb 22, 2024
1 parent 36b26f9 commit 0065fe6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shitty-handlebars",
"version": "1.0.3",
"version": "1.0.4",
"main": "./index.js",
"type": "module",
"scripts": {
Expand Down Expand Up @@ -37,7 +37,6 @@
"package.json",
"README.md"
],

"author": "elliot",
"license": "The Unlicense",
"devDependencies": {
Expand Down
47 changes: 26 additions & 21 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Shitty Handlebars

![](./small.jpg)
Shitty Handlebars is a shitty library that provides a subpar implementation of the popular Handlebars templating engine, but it has no dependencies and it's focusedf more towards backend generation. My use-case: cloudflare worker dynamic html routes.
Shitty Handlebars is a shitty library that provides a subpar implementation of the popular Handlebars templating engine, BUT it has no dependencies and it's gotta focus on backend generation. My use-case: cloudflare worker dynamic html routes.

## Features
- Conditional Rendering (#if): Implements simple conditional statements.
Expand All @@ -12,37 +12,42 @@ Shitty Handlebars is a shitty library that provides a subpar implementation of t

## Installation

To install Shitty Handlebars, you probably can't use yarn unless i remember to upload it. Here's how you would install it if i do:
```shell
yarn add @elliotberry/shitty-handlebars
yarn add elliotberry/shitty-handlebars
```
## Usage
## Example

Using Shitty Handlebars is straightforward. Simply require the library and start creating shitty templates.
Using Shitty Handlebars is straightforward. Here's the kitchen sink of available features:

```javascript
import sb from "shitty-handlebars"

const template = '<h1>Hello, {{name}}!</h1>';
const data = { name: 'Shitty Handlebars' };

const renderedTemplate = sb(template, data);
A template example:

console.log(renderedTemplate);
```
<h1>Hello, {{name}}!</h1>
{{#if isATurtle}}<h3>Turtle confirmed.</h3>{{/if}}
{{#traits}}<strong>{{this}}</strong>{{/traits}}
```
Some data:

## Known Issues

- What I don't know can't hurt me
```javascript
const data = {
name: 'Mitch McConnell',
isATurtle: true,
traits: ['old', 'turtle-like']
};
```
Finally, the script:

## Contributing
```javascript
import shb from "shitty-handlebars"

Contributions to Shitty Handlebars are not encouraged nor desired. However, if you insist on making this library even shittier, you can fork the repository, make your changes, and submit a pull request. Please be aware that pull requests will be rejected.
const template = `<h1>Hello, {{name}}!{{#if isATurtle}}<h3>Turtle confirmed.</h3>{{/if}}{{#traits}}<strong>{{this}}</strong>{{/traits}}`;
const data = { name: 'Mitch McConnell', isATurtle: true, traits: ['old', 'turtle-like']};

## License
const renderedTemplate = shb(template, data);

This project is licensed under the **WTFPL** (Do What the Fuck You Want to Public License). See the [LICENSE](LICENSE) file for more details.
console.log(renderedTemplate);
```

## Acknowledgments

Shitty Handlebars would not be possible without the inspiration and support from the developers who strive to create robust and reliable software. That's not me, though.
Thanks, AI.
Binary file modified small.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified social.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0065fe6

Please sign in to comment.