Skip to content

lguzzon-scratchbook/code-cookbook

 
 

Repository files navigation

Haxe Code Cookbook

Build Status

Sources for the Haxe Code Cookbook site, a community driven resource website for learning Haxe in practise.

The repository contains a static website generator, which converts markdown articles into a website. The project is being developed here on GitHub, feel free to contribute Haxe related code snippets and tutorials.

Structure

Contributing articles

Please add/edit the articles (markdown files) in the assets folder and do a pull request.

Formatting

It would be nice if you keep the formatting of the code in the same style as used already:

  • Braces on same line.
  • Two-space indentation.
  • No type-hints for local variables and function return unless it's instructive.
  • Type-hints for fields.
  • Type-hints for function arguments unless it's very obvious.
  • Judicious use of extra line-breaks to avoid ugly automatic breaks (check the output).
Other remarks
  • The first heading is used in the navigation. Keep this title short.
  • The first paragraph is used as description. Describe what the content of the article is about.
  • Tag the article using [tags]: / "tag1,tag2" (no spaces). Try to use an existing tag.
  • Mention the author / sources at the bottom of the page.
  • If you want to include a try.haxe.org code snippet use [tryhaxe](http://try.haxe.org/embed/76f24).
  • If you want to include a YouTube video use [youtube](https://www.youtube.com/watch?v=dQw4w9WgXcQ).
  • If possible, link to related pages in the Haxe Manual / API documentation.
  • If you want to use images or other includes, create a folder called assets in the same directory as the article and link to that.

This would be a typical template to use. Use ```haxe for syntax highlighting:

[tags]: / "class,array,json,building-fields"

# Title of the page

Description and explanation of the code.

## Implementation
```haxe
class Main {
  // Code here
}
```

## Usage
```haxe
class Test {
  // Code here
}
```

> More on this topic: 
> 
> * [Class field in Haxe Manual](https://haxe.org/manual/class-field.html)
> 
> Author: [Name](https://github.com/username)

Running a local copy

To run the project you need Haxe.

Call build-site.bat to re-generate the output files.

Contributing to the generator

You need Haxe 3.2+ installed.

The static site generator source depends on hxtemplo and markdown. Install from haxelib:

haxelib install CodeCookBook.hxml

The CSS files are compressed using less. Install from npm:

npm install -g less
npm install -g less-plugin-clean-css

Releases

No releases published

Packages

No packages published

Languages

  • Haxe 63.6%
  • CSS 24.2%
  • JavaScript 8.7%
  • Shell 3.5%