Sources for the Haxe Code Cookbook site
This project contains a static website generator, it is mixing templates and markdown files into plain HTML files.
- The actual articles are in assets/content/cookbook, organized per folder.
- The template files are in assets/content/.
- The static files (css, js, images) files are in assets/includes/.
- The Haxe source files of the generator are in src/.
- The website-generated content will output in
output
.
Please add/edit the articles (markdown files) in the assets folder and do a pull request.
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)
- 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 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]: / "enum,pattern-matching,macro,macro-function" # 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: <https://haxe.org/manual/class-field.html> > > Author: [Name](https://github.com/username)
To run the project you need Haxe.
Call build-site.bat
to re-generate the output files.
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