Giter Site home page Giter Site logo

haxemanual's Introduction

Build Status

Contributions / Information for authors

For contributions please edit the .md files in content/.

The manual is separated into chapters. Each chapter resides in its own .md file. The syntax is Markdown for the most part, with some special comments mixed in.

Markdown syntax

Standard syntax can be used freely (and in moderation).

Sections and labels

On https://haxe.org/manual, the manual is separated into individual pages. Each page has its own URL and represents a section. Every section has a title and a label. For backward compatibility and flexibility in titles, the label of a section is not directly based on its title.

As an example, the "Property" section has the label class-field-property (which you can see in its URL).

To give a section a label:
<!--label:here-is-the-label-->
## Here is the title

The nesting level of a section depends on the heading level (number of # characters in the title):

  • ## denotes a chapter, only one per .md file
  • ### denotes a section
  • #### denotes a subsection
  • ##### denotes a paragraph (when used without the label tag) or a subsubsection (when used with a label tag)

Links to sections

To reference another section, use the regular Markdown link syntax with the label in place of the URL.

To reference a section:
Please see the [hello world](introduction-hello-world) section.

Haxe code assets (CI-tested)

The Haxe files in the assets/ directory form the majority of the Haxe code samples that are included in the manual. All of these files are automatically tested with Travis CI for all Haxe targets. For the testing procedures and rules, see tests/RunTravis.hx.

On haxe.org, the code samples can be seen included in the sections for a comfortable reading experience. In the .md sources, however, the Haxe files are only referenced with a link to avoid code duplication.

When creating new code assets, please make sure to use haxe-formatter on the file before committing it. The configuration file hxformat.json is provided in the repository.

To include a Haxe code asset:
[code asset](assets/HelloWorld.hx)

The above needs to be on its own line. The code asset text cannot be changed (it is not displayed to the reader anyway).

To include a smaller part of a Haxe code asset:
[code asset](assets/HelloWorld.hx#L2-L4)

The above would only show lines 2 through 4 (inclusive).

Code assets (direct)

Code can also be included in the Markdown content directly. This is convenient for very short snippets, snippets in other languages, or code that is not correct. Where possible, however, please use the CI-tested variant described above.

To include a snippet of Haxe code:
```haxe
trace("Hello, world!");
```
To include a snippet of another language:
```js
console.log("Hello, world!");
```

Code (inline)

Finally, short expressions can be included directly in the text by surrounding the code with backticks.

Flowcharts

Flowcharts are included as svg images:

![](assets/figures/type-system-resolution-order-diagram.svg)

Version information

To indicate that the following information is only true starting from a given Haxe version:
##### since Haxe 4.0.0

Definition

To give a concise definition of a term:
> ##### Define: Some Term
>
> This is the definition of the term.
>
> It can span multiple lines and use other Markdown syntax, too.

Definitions can be referenced from other parts of the manual. Their label is based on the term they describe, e.g. define-some-term for the example above.

Trivia

To give additional information, not crucial to understanding Haxe:
> ##### Trivia: Some Factoid
>
> This is something that is not very important.

Metadata and defines lists

The metadata and define tables are generated automatically from JSON definitions. To update the generated files from the current development branch, simply run haxe generate.hxml in the generate directory (requires curl to be installed and in PATH).

Manual preview

When working on the manual, any Markdown preview (including GitHub renderer) should suffice to show if the text looks correct. To make sure the special Haxe Manual-specific syntax works as expected, please use a local instance of haxe.org. The workflow consists of:

  1. Clone the haxe.org and HaxeManual repositories
  2. Replace the manual directory in haxe.org with a symlink to your local copy of HaxeManual
  3. Start the haxe.org server (haxe start-server.hxml & in the haxe.org repository)
  4. Make changes to the .md files
  5. Run haxe generate.hxml in the haxe.org repository
  6. Check results on localhost:2000, repeat from step 4

You can disable all haxe.org generators except the manual generator in Main.hx to hasten the generation process. A significant speed-up can also be gained by turning off the syntax highlighting.

haxemanual's People

Contributors

andyli avatar archiloque avatar aszasz avatar atry avatar aurel300 avatar binki avatar calebharper avatar chromy avatar confidantcommunications avatar gama11 avatar haxiomic avatar iamrajiv avatar ibilon avatar jasononeil avatar jdonaldson avatar jonasmalacofilho avatar kevinresol avatar markknol avatar nadako avatar npretto avatar paul59 avatar rblsb avatar realyuniquename avatar romamik avatar shohei909 avatar simn avatar smilyorg avatar uvtc avatar vincentb1 avatar zanadev avatar

Watchers

 avatar

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.