Giter VIP home page Giter VIP logo

code-cookbook's Introduction

Haxe Code Cookbook

Build Status

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.

Structure

  • The actual code snippets 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.

Contributing snippets

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

Formatting snippets

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.
  • tag the snippet using [tags]: / "tag1,tag2" (no spaces). Try to use an existing tag.
  • mention the author / sources at the bottom of the page.
  • if possible, link to related pages in the Haxe Manual / API documentation
  • if you want to use images, upload them in the <assets/includes/img> folder.

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 Test {
      // Code here
    }
    ```
   ## Usage
    ```haxe
    class Test {
      // Code here
    }
    ```
    > More on this topic: <http://haxe.org/manual/class-field.html>
    > Author: [Name](http://github.com/usename)
  

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 hxtemplo
haxelib install markdown

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.