Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/deepnight/presskit

Static press kit generator for Haxe
https://github.com/deepnight/presskit

game-development haxe presskit

Last synced: 28 days ago
JSON representation

Static press kit generator for Haxe

Awesome Lists containing this project

README

        

# Presskit for Haxe

Presskit is a simple Haxe library that generates static HTML presskits from either XML or JSON source files.

- Use either XML (recommended) or JSON to feed a HTML template.
- Everything can be customized.
- Basic **Markdown** is supported: **bold**, *italic*, ~~striked~~, [links](#nope), lists and nested lists.

You can see an example of a generated presskit here:

https://deepnight.net/files/presskit/nuclearBlaze/

# Installation

You need [Haxe](https://haxe.org) to run this library.

Install the lib:
```
haxelib install presskit
```

# Usage

## Method 1 - Use the existing default HTML template

Generate an empty Presskit file in your prefered format.

**XML (recommended):**
```
haxelib run presskit -extract myPresskit.xml
```

**JSON:**
```
haxelib run presskit -extract myPresskit.json
```
*Why is XML recommended over JSON in 2021 you might wonder? Simply because the ouput is an HTML file, and XML format is more convenient for this exact purpose.*

Now just edit your presskit file and fill in the fields.

When you're ready to generate your HTML presskit page, run the following command:

```
haxelib run presskit -html myPresskit.xml [-zip]
```

The `-html` indicates to switch to HTML generation mode.

The optional `-zip` argument will generate a ZIP archive and add a "Download everything as ZIP" to the HTML page.

## Method 2 - Create your own HTML template first

### Custom HTML template

Create some HTML file containing variables named like `%productName%`. It's a good idea to start from the existing [default HTML template](tpl/default.html). Don't forget to grab the CSS along with it.

```html


Factsheet



Product name

%productName%

Developer

%companyName%



```

Run this command to extract all variables (eg. `%productName%`) and build a XML or JSON out of it:

```xml

```

### Syntax of HTML template variables

Your variable names can contain `/` (slashes) to create some hierarchy in your presskit file:
```html


%product/name%



%product/desc%


```

**XML:**
```xml


```

There are a few special **reserved** variable names for your template:

- `%zip/status%`: this will contain either "on" or "off", depending on the `-zip` argument being used or not. This is used to add a CSS class to the "Download ZIP" button, to either show or hide it.
- `%zip/path%`: relative path to the generated ZIP file.

### Build your final HTML presskit

You can then fill this file, and build your HTML final presskit using:

```
haxelib run presskit -html myPresskitFile.xml myCustomTemplate.html
```

# Example

HTML template:
```html

[...]



%game/title% (by %company/name%)


%game/desc%

Website: %game/url%


```

Its corresponding XML:
```xml

Nuclear Blaze

[Steam page](https://store.steampowered.com/app/1662480)


A **unique** 2D firefighting game from the creator of **[Dead Cells](https://deadcells.com)**, with all the devastating backdrafts, exploding walls and sprinklers you could expect.

- This game is cool,
- Another bullet point,
- And a last one.

Deepnight Games

```

Or JSON:
```JSON
{
"game": {
"title": "Nuclear Blaze",
"url": "[Steam page](https://store.steampowered.com/app/1662480)",
"desc": [
'',
'A **unique** 2D firefighting game from the creator of **[Dead Cells](...)**, with all the devastating backdrafts, exploding walls and sprinklers you could expect.',

'- This game is cool',
'- Another bullet point',
'- And a last one'
]
},
"company": {
"name": "Deepnight Games"
}
}
```