diff --git a/hamill/hamill.html b/hamill/hamill.html index d8df9d4..304b5b9 100644 --- a/hamill/hamill.html +++ b/hamill/hamill.html @@ -11,6 +11,9 @@ + + + + +
+ + +
+

Hamill

+
+

This document describes in English the Hamill language. La documentation en français est disponible ici.

+

Hamill is a lightweight markup language like Markdown, Textile, AsciiDoc or reStructuredText, to write documentation in a text file with structure information (headings, divisions, paragraphs) and formatting (bold, italics…).

+

Its lightweight syntax makes it easier to read the text file directly than the corresponding HTML file. Hamill dœs, however, provide a tool for transforming a Hamill file (extension .hml) into an HTML file (extension .html).

+

Its syntax is both easier and more complete than that of the original Markdown from 2004.

+

Hamill has been around since 2020, is currently at version 2 since 2022 and has two implementations that produce the same result:

+ +

The project's source code is available on GitHub.

+

You can try it directly online

+

The current version is 2.0.5. Hamill is released under the MIT license.

+

Damien Gouteux 2020-2024

+

This page has been translated from French to English with the help of DeepL Translator.

+

Contents

+ +

Use

+

Hamill comes in the form of two scripts: hamill and weyland (extension .mjs for the JavaScript version and .py for the Python version). Weyland handles the lexical and syntactic analysis of the various languages, while Hamill transforms the Hamill file (.hml extension) into a document made up of several nodes. This document is then translated into HTML. To do this, Hamill is used on the command line:

+
+node.exe hamill.mjs
+python.exe hamill.py
+
+

By default, it will display the help menu detailing the various commands available.

+
+Running Hamill v2.0.5
+---
+> Use hamill.mjs --process (or -p) <input config filepath> to convert the HML file to HTML
+  The file must be an object {} with a key named targets with an array value of pairs :
+            ["inputFile", "outputDir"]
+> Use hamill.mjs --tests (or -t) to launch all the tests (99).
+> Use hamill.mjs --eval (or -e) to run a read-eval-print-loop from hml to html
+> Use hamill.mjs --help (or -h) to display this message
+
+ +

The configuration file is a JSON file with an object as its root. This object must have a targets key which is a list of pairs, the first element indicating the target hamill file, the second element indicating the directory where to put the result of the transformation into HTML. The result will have the same filename as the target hamill file, except that its extension will be .html instead of .hml. If the first element is the string "comment", this pair will be ignored.

+
+{
+    "targets": [
+        [
+            "comment",
+            "Root pages"
+        ],
+        [
+            "./input/index.hml",
+            "../"
+        ]
+    ]
+}
+
+

Comments, HR and BR

+

Comments can be made by putting !rem or §§ at the beginning of the line, and the entire line is then a comment.

+
+!rem This is a comment
+§§ This is another comment
+
+

A line that is entirely a comment will be exported as HTML if the EXPORT_COMMENT variable is set to true.

+ +

A horizontal line can be made with a line consisting only of - of length greater than or equal to 3.

+
+---
+
+
+

You can force a line break with ## surrounded by a space before and after it, and not at the beginning of the line (otherwise it's a title):

+
+this is a line break ##.
+
+

this is a line break
.

+

Titles

+

A number of # is placed at the beginning of the line, corresponding to the level of the title you want.

+
+### Level 3 title
+
+

Text formatting

+ +

Div, p and span

+ +
+!css span.spoiler {background: black; user-select: none;}
+!css span.spoiler:active {background: lightgrey; user-select: none;}
+This is text with a hidden part: {{.spoiler Darth Vader is Luke's father}}. To avoid spoilers.
+
+

This is a text with a hidden part: Darth Vader is Luke's father. To avoid spoilers.

+

Details

+ +
+<<This is a short note.
+
+

<<Short note → This is a short note.

+
+<<Long note
+* This is a long note
+* With Hamill in it ##
+<<end>>
+
+
Long note +
    +
  • This is a long note
  • +
  • With Hamill in it
  • +
+
+

Code

+

We use @@for inline code@@. Hamill has a syntax colorizer for Python and JSON, so we specify : @@python def function(par1, par2)@@.

+

For a block of code, there are two solutions:

+

You can start with a line containing only @@, followed by the language you want, and then continue with lines containing @@ at the beginning, up to a line containing only @@. For example:

+
+@@python
+@@# This is a comment
+@@def function(par1, par2):
+@@ return "This is a function"
+@@
+
+

Gives :

+
+# This is a comment
+def function(par1, par2):
+ return "This is a function"
+
+
+

You can also make a line with only @@@ followed by the language you want, then lines with nothing up to a line with only @@@. For example:

+
+@@python
+# This is a comment
+def function(par1, par2):
+ return "This is a function"
+@@@
+
+

Gives :

+
+# This is a comment
+def function(par1, par2):
+    return "This is a function"
+
+

Lists

+ +
    +
  1. + for a numbered list, item 1/2
  2. +
  3. + item 2/2
  4. +
+
    +
  1. - for an inverted numbered list, item 1/2
  2. +
  3. - item 2/2
  4. +
+

Definition lists

+ +
+Cuirassier
+    heavily equipped mounted soldier
+
+
+
Cuirassier
+
heavily equipped mounted soldier
+
+

Tables

+ + + + +
Thisis a table
My table is pretty
+

You can, of course, add text modifiers, links or an image to an array.

+ + + +
This is a table
It is a prettydifferent table.
+

You can also center a box by following the opening column with = and right-aligning with > :

+ + + +
Left and also very long Centered Right
Right Centered Left and also very long
+

You can also specify a colspan with #cVALUE# for example: #c3# and combine with centering =#c3# :

+ + + +
Column 1Column 2Column 3
Centered and colspan=3
+

LIMITATION: no lists in a table

+ + +

Images

+ +

Constants

+

Constants can be defined by putting !const at the beginning of the line. Constants can be defined anywhere in the document, but only once.

+

Some constants are predefined but have no value, so they can be defined once again:

+ +

Some constants are predefined with a value, so cannot be redefined:

+ +

For the display of the day in the week, only English and French are managed according to the LANG constant.

+

Variables

+

Variables can be defined by putting !var at the beginning of the line. You can change the value of a variable by redefining it in the document as many times as you like.

+ +

If NEXT_TAB_CLASS and DEFAULT_TAB_CLASS are defined, the value of NEXT_TAB_CLASS will be used.

+

Including HTML files

+

You can include an HTML file with !include at the beginning of the line. The content of the file will be copied directly into the document.

+

Linking to a CSS or JavaScript file

+

We can link our document to a CSS or JavaScript file with the !require command at the beginning of the line.

+

The link to a required CSS (.css) file is automatically placed at the head of the HTML document.

+

The link to a required JavaScript file (.js or .mjs) is automatically placed at the top of the HTML document.

+

Special

+ +
+
+ + + \ No newline at end of file diff --git a/index.html b/index.html index 03d8a83..72757fa 100644 --- a/index.html +++ b/index.html @@ -166,7 +166,7 @@

Bienvenue

Histoire méthodologie, bibliographie et France du XIXe Collections outils, prénoms, favoris, liens -

Damien Gouteux, dernière mise à jour le lundi 29 avril 2024.

+

Damien Gouteux, dernière mise à jour le lundi 6 mai 2024.

2005 ❤ 2024
diff --git a/static/hamill.config.json b/static/hamill.config.json index fb08c5f..3e7028e 100644 --- a/static/hamill.config.json +++ b/static/hamill.config.json @@ -44,6 +44,10 @@ "./input/hamill/hamill.hml", "../hamill/" ], + [ + "./input/hamill/hamill_en.hml", + "../hamill/" + ], [ "./input/hamill/tests.hml", "../hamill/" diff --git a/static/input/hamill/hamill.hml b/static/input/hamill/hamill.hml index 4f09399..3c7d0df 100644 --- a/static/input/hamill/hamill.hml +++ b/static/input/hamill/hamill.hml @@ -7,6 +7,8 @@ !require https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js !css blockquote {font-size: 12px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;} !css details > summary {cursor: pointer;} +!css pre.mockupblockquote { border-left: 8px solid #ACAEB0; padding-left: 5px; background-color: #EDEDED; border-radius: 0;} +!css span.hamill-special {color: black;} !var DEFAULT_CODE=hamill @@ -19,20 +21,31 @@ # Hamill --- -Ce document décrit le langage **Hamill**. Comme [[Markdown->#]], [[Textile->#]], [[AsciiDoc->#]] ou [[reStructuredText->#]], c'est un [[langage de balisage léger->#]] pour écrire de la documentation dans un fichier texte, directement lisible sans transformation, mais pouvant également être transformé en HTML. +Ce document en français décrit le langage **Hamill**. [[English documentation is available here->https://xitog.github.io/dgx/hamill/hamill_en.html]]. -Hamill existe depuis 2020, il est actuellement à sa version 2 depuis 2022 et dispose de deux implémentations : une en [[JavaScript avec NodeJS->https://nodejs.org/en]] et l'autre en [[Python 3->https://www.python.org/]]. +Hamill est un [[langage de balisage léger->#]] comme [[Markdown->#]], [[Textile->#]], [[AsciiDoc->#]] ou [[reStructuredText->#]], pour écrire de la documentation dans un fichier texte avec des informations de **structure** (titres, divisions, paragraphes) et de **formatages** (gras, italique...). -[[Le code source du projet et une documentation en anglais sont disponibles sur GitHub->https://github.com/Xitog/hamill]]. +Sa syntaxe légère rend plus facilement la lecture directe du fichier texte par rapport à un fichier HTML. Hamill fournit toutefois un outil pour transformer un fichier Hamill (extension @@.hml@@) en fichier HTML (extension @@.html@@) + +Sa syntaxe est à la fois plus facile et plus complète que celle du [[Markdown originel->https://daringfireball.net/projects/markdown/syntax]] de 2004. + +Hamill existe depuis 2020, il est actuellement à sa version 2 depuis 2022 et dispose de deux implémentations qui produisent le même résultat : + +* celle en [[JavaScript avec NodeJS->https://nodejs.org/en]] est hébergée sur NPM : [[Hamill JS->https://www.npmjs.com/package/hamill]], +* celle en en [[Python 3->https://www.python.org/]] est hébergée sur PYPI : [[Hamill PY->https://pypi.org/project/hamill/]]. + +[[Le code source du projet est disponible sur GitHub->https://github.com/Xitog/hamill]]. [[Vous pouvez l'essayer directement en ligne->https://xitog.github.io/dgx/hamill/index.html]] La version actuelle est la version 2.0.5. Hamill est publié sous licence MIT. +Damien Gouteux 2020-2024 + ## Sommaire * [[Utilisation->#]] -* [[Commentaires->#]] +* [[Commentaires, HR et BR->#]] * [[Titres->#]] * [[Modification de texte->#]] * [[Div, p et span->#]] @@ -93,7 +106,7 @@ Le fichier de configuration est un fichier JSON qui a un objet pour racine. Cet } @@@ -## Commentaires +## Commentaires, HR et BR On peut faire des commentaires en mettant @@!rem@@ ou @@§§@@ en début de ligne, toute la ligne est alors en commentaire. @@ -230,10 +243,14 @@ def function(par1, par2): * $ indique une liste de définition. On fait suivre directement la définition en la précédant d'espaces. ->> $ cuirassier ->> soldat à cheval lourdement équipé +!var NEXT_CODE_CLASS=mockupblockquote + +@@@hamill +$ Cuirassier + soldat à cheval lourdement équipé +@@@ -$ cuirassier +$ Cuirassier soldat à cheval lourdement équipé ## Tables @@ -265,7 +282,7 @@ On peut également préciser un colspan avec #cVALEUR# par exemple : @@#c3#@@ et |-----------------------------| |=#c3# Centré et colspan=3 | -**LIMITATION : pas de listes dans un tableau** : +**LIMITATION : pas de listes dans un tableau** ## Liens @@ -274,8 +291,8 @@ On peut également préciser un colspan avec #cVALEUR# par exemple : @@#c3#@@ et * La seconde forme dite ''nommée'' s'écrit @@[[ nom affiché -> URL | REF | #ID ]]@@ ou @@[ nom affiché -> REF ]@@ * Une URL commence par @@http://@@ ou @@https://@@ * Une REF est définie par une ligne de la forme @@::code:: http://...@@ -* Une forme spéciale de la nommée est si REF est seulement @@#@@ comme @@[[] nom affiché -> # ]]@@ : Hamill essaye alors de faire sur le nom affiché transformé ou, si l'ancre n'existe pas, le nom affiché directement -* Les titres sont automatiquement transformés en ancre en remplaçant les espaces par - et en les mettant en minuscules : ainsi **Les jeux** devient **les_jeux** +* Une forme spéciale de la nommée est si REF est seulement @@#@@ comme @@[[ nom affiché -> # ]]@@ : Hamill essaye alors de faire sur le nom affiché transformé ou, si l'ancre n'existe pas, le nom affiché directement +* Les titres sont automatiquement transformés en ancre en remplaçant les espaces par - et en les mettant en minuscules : ainsi **Les jeux** devient **les-jeux** ## Images @@ -314,6 +331,8 @@ On peut définir des variables en mettant @@!var@@ en début de ligne. On peut c * @@!var DEFAULT_PAR_CLASS=cls@@ spécifie la classe par défaut de **tous les paragraphes qui suivent** * @@!var DEFAULT_TAB_CLASS=cls@@ spécifie la classe par défaut de **tous les tableaux qui suivent** * @@!var DEFAULT_FIND_IMAGE=path@@ spécifie un répertoire où aller chercher les images par défaut +* @@!var NEXT_CODE_ID=ids@@ spécifie l'id du **prochain** bloc de code +* @@!var NEXT_CODE_CLASS=cls@@ spécifie la classe du **prochain** bloc de code Si @@NEXT_TAB_CLASS@@ et @@DEFAULT_TAB_CLASS@@ sont définies, c'est la valeur de @@NEXT_TAB_CLASS@@ qui sera prise en compte. diff --git a/static/input/hamill/hamill_en.hml b/static/input/hamill/hamill_en.hml new file mode 100644 index 0000000..3b6abd3 --- /dev/null +++ b/static/input/hamill/hamill_en.hml @@ -0,0 +1,366 @@ +!const TITLE=Hamill +!const LANG=en +!const ICON=https://xitog.github.io/dgx/img/favicon.ico +!require https://xitog.github.io/dgx/css/simplex.bootstrap.css +!require https://xitog.github.io/dgx/css/palatino.css +!require https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js +!require https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js +!css blockquote {font-size: 12px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;} +!css details > summary {cursor: pointer;} +!css pre.mockupblockquote { border-left: 8px solid #ACAEB0; padding-left: 5px; background-color: #EDEDED; border-radius: 0;} +!css span.hamill-special {color: black;} + +!var DEFAULT_CODE=hamill + +{{#main .container}} + +!include menu.html + +{{#content-div}} + +# Hamill +--- + +This document describes in English the **Hamill** language. [[La documentation en français est disponible ici->https://xitog.github.io/dgx/hamill/hamill.html]]. + +Hamill is a [[lightweight markup language->lml]] like [[Markdown->#]], [[Textile->#]], [[AsciiDoc->#]] or [[reStructuredText->#]], to write documentation in a text file with **structure** information (headings, divisions, paragraphs) and **formatting** (bold, italics...). + +Its lightweight syntax makes it easier to read the text file directly than the corresponding HTML file. Hamill does, however, provide a tool for transforming a Hamill file (extension @@.hml@@) into an HTML file (extension @@.html@@). + +Its syntax is both easier and more complete than that of the [[original Markdown->https://daringfireball.net/projects/markdown/syntax]] from 2004. + +Hamill has been around since 2020, is currently at version 2 since 2022 and has two implementations that produce the same result: + +* the one in [[JavaScript with NodeJS->https://nodejs.org/en]] is hosted by NPM: [[Hamill JS->https://www.npmjs.com/package/hamill]], +* the one in [[Python 3->https://www.python.org/]] is hosted on PYPI: [[Hamill PY->https://pypi.org/project/hamill/]]. + +[[The project's source code is available on GitHub->https://github.com/Xitog/hamill]]. + +[[You can try it directly online->https://xitog.github.io/dgx/hamill/index.html]] + +The current version is 2.0.5. Hamill is released under the MIT license. + +Damien Gouteux 2020-2024 + +This page has been translated from French to English with the help of [[DeepL Translator->https://www.deepl.com/translator]]. + +## Contents + +* [[Use->#]] +* [[Comments, HR and BR->#]] +* [[Titles->#]] +* [[Text formatting->#]] +* [[Div, p and span->#]] +* [[Details->#]] +* [[Code->#]] +* [[Lists->#]] +* [[Definition lists->#]] +* [[Tables->#]] +* [[Links->#]] +* [[Images->#]] +* [[Constants->#]] +* [[Variables->#]] +* [[Including HTML files->#]] +* [[Linking to a CSS or JavaScript file->#]] +* [[Special->#]] + +## Use + +Hamill comes in the form of two scripts: hamill and weyland (extension .mjs for the JavaScript version and .py for the Python version). Weyland handles the lexical and syntactic analysis of the various languages, while Hamill transforms the Hamill file (.hml extension) into a document made up of several nodes. This document is then translated into HTML. To do this, Hamill is used on the command line: + +@@@text +node.exe hamill.mjs +python.exe hamill.py +@@@ + +By default, it will display the help menu detailing the various commands available. + +@@@text +Running Hamill v2.0.5 +--- +> Use hamill.mjs --process (or -p) to convert the HML file to HTML + The file must be an object {} with a key named targets with an array value of pairs : + ["inputFile", "outputDir"] +> Use hamill.mjs --tests (or -t) to launch all the tests (99). +> Use hamill.mjs --eval (or -e) to run a read-eval-print-loop from hml to html +> Use hamill.mjs --help (or -h) to display this message +@@@ + +* @@--process or -p@@: launches the translation of one or more hamill files into HTML. You must specify the path to a config file. +* @@--tests or -t@@: launches the test suite. +* @@--eval or -e@@: to launch a command prompt to enter hamill and see the result translated directly into HTML. Useful for testing. +* @@--help or -h@@: to display this message (default behavior) + +The configuration file is a JSON file with an object as its root. This object must have a targets key which is a list of pairs, the first element indicating the target hamill file, the second element indicating the directory where to put the result of the transformation into HTML. The result will have the same filename as the target hamill file, except that its extension will be .html instead of .hml. If the first element is the string "comment", this pair will be ignored. + +@@@json +{ + "targets": [ + [ + "comment", + "Root pages" + ], + [ + "./input/index.hml", + "../" + ] + ] +} +@@@ + +## Comments, HR and BR + +Comments can be made by putting @@!rem@@ or @@§§@@ at the beginning of the line, and the entire line is then a comment. + +>>!rem This is a comment +>>§§ This is another comment + +A line that is entirely a comment will be exported as HTML if the @@EXPORT_COMMENT@@ variable is set to @@true@@. + +§§ This is a comment and will not be exported + +!var EXPORT_COMMENT=true + +§§ This is a comment it will be exported as HTML + +A horizontal line can be made with a line consisting only of @@-@@ of length greater than or equal to 3. + +>>--- + +--- + + +You can force a line break with @@##@@ surrounded by a space before and after it, and not at the beginning of the line (otherwise it's a title): + +>>this is a line break ##. + +this is a line break ##. + +## Titles + +A number of @@#@@ is placed at the beginning of the line, corresponding to the level of the title you want. + +>>### Level 3 title + +## Text formatting + +* \*\***bold**\*\*: to make bold (tag ''b'') +* \!\!!!bold!!\!\! for bold (tag ''strong'') +* \'\'''italic''\'\': to italicize (tag ''i'') +* \/\///italic//\/\/: to italicize (tag ''em'') +* \-\---stroke--\-\-: to strike through +* \_\___underlined__\_\_: to underline +* \^\^^^exponent^^\^\^: to put in superscript +* \%\%%%index%%\%\%: to set an index +* To escape a special character, use @@\\@@. + +# Div, p and span + +* @@{{#id .class}}@@: on a single line, to define a div with an id and/or a class. +* @@{{begin}}@@: on one line, to open a div without id or class. +* @@{{end}}@@: on one line, to close an open div. +* @@{{#id .class}} content@@: in a paragraph, specifies the paragraph id and/or class. +* @@{{#id .class content}}@@: in a paragraph, specifies a span with an id and/or class. + +>>!css span.spoiler {background: black; user-select: none;} +>>!css span.spoiler:active {background: lightgrey; user-select: none;} +>>This is text with a hidden part: {{.spoiler Darth Vader is Luke's father}}. To avoid spoilers. + +!css span.spoiler {background: black; user-select: none;} +!css span.spoiler:active {background: lightgrey; user-select: none;} +This is a text with a hidden part: {{.spoiler Darth Vader is Luke's father}}. To avoid spoilers. + +## Details + +* Write @@< yyy>>@@ to open a short note. You can put an id and a class before xxx with @@#id@@ and @@.class@@. +* Write @@<>@@ to open a long note. put an id and a class before xxx with @@#id@@ and @@.class@@. +* Write @@<>@@ to close a long note. You can call up the id and class, but this has no meaning for Hamill. + +!css details {margin-bottom: 1em; background-color: #EDEDED;} +!css details[open] {padding-bottom: 0.5em;} +!css summary {margin-bottom: 0.5em; color: black; font-size: 16px; user-select: none; border: 1px solid darkgrey; background-color: white;} + +>>< This is a short note. + +>><>* This is a long note +>>* With Hamill in it ## +>><> + +<> +* This is a long note +* With Hamill in it +<> + +## Code + +We use @@\@\@for inline code\@\@@@. Hamill has a syntax colorizer for Python and JSON, so we specify : @@\@\@python def function(par1, par2)\@\@@@. + +For a block of code, there are two solutions: + +You can start with a line containing only @@\@\@@@, followed by the language you want, and then continue with lines containing @@\@\@@@ at the beginning, up to a line containing only @@\@\@@@. For example: + +>>@@python +>>@@# This is a comment +>>@@def function(par1, par2): +>>@@ return "This is a function" +>>@@ + +Gives : + +@@python +@@# This is a comment +@@def function(par1, par2): +@@ return "This is a function" +@@ + +You can also make a line with only @@\@\@\@@@ followed by the language you want, then __lines with nothing__ up to a line with only @@\@\@\@@@. For example: + +>>@@python +>># This is a comment +>>def function(par1, par2): +>> return "This is a function" +>>@@@ + +Gives : + +@@@python +# This is a comment +def function(par1, par2): + return "This is a function" +@@@ + +## Lists + +* @@*@@ for an unnumbered list + ++ @@+@@ for a numbered list, item 1/2 ++ @@+@@ item 2/2 + +- @@-@@ for an inverted numbered list, item 1/2 +- @@-@@ item 2/2 + +## Definition lists + +* $ indicates a definition list. The definition is followed directly by spaces. + +!var NEXT_CODE_CLASS=mockupblockquote + +@@@hamill +Cuirassier + heavily equipped mounted soldier +@@@ + +$ Cuirassier + heavily equipped mounted soldier + +## Tables + +* A table is written as follows: @@|col1|col2|col3|@@ +* The title line must be the first and separated from the others by a line of dashes: @@|----|@@ + +|This|is |a |table | +|----|------|---|-----------| +|My |table |is |pretty | + +You can, of course, add text modifiers, links or an image to an array. + +!var DEFAULT_FIND_IMAGE=https://xitog.github.io/dgx/img + +|^^This^^ |**is**| __a__ |''table'' | +|-------------------------------------------------------------------------------------------------------------------------------------| +|It ((background-green.png)) |is |a --pretty--different| [[table->https://xitog.github.io/dgx/]]. | + +You can also center a box by following the opening column with @@=@@ and right-aligning with @@>@@ : + +|Left and also very long |= Centered |> Right | +|--------------------------------------------------------------------| +|> Right |= Centered |Left and also very long | + +You can also specify a colspan with #cVALUE# for example: @@#c3#@@ and combine with centering @@=#c3#@@ : + +|Column 1|Column 2|Column 3| +|-----------------------------| +|=#c3# Centered and colspan=3 | + +**LIMITATION: no lists in a table** + +## Links + +* We use square brackets +* The first "direct" form is @@[[URL]]@@, @@[[REF]]@@, @@[#ID]@@. The URL, REF or ID will be displayed. +* The second form, called "named", is written @@[[ displayed name -> URL | REF | #ID ]]@@ or @@[ displayed name -> REF ]@@. +* A URL begins with @@http://@@ or @@https://@@. +* A REF is defined by a line of the form @@::code:: http://...@@ +* A special form of the named is if REF is only @@#@@ as @@[[ displayed name -> # ]]@@: Hamill then tries to do on the transformed displayed name or, if the anchor doesn't exist, the displayed name directly. +* Titles are automatically transformed into anchors by replacing spaces with - and lower-casing them: thus **The Games** becomes **the-games**. + +## Images + +* We use parentheses @@((url))@@ like : @@((my_image.png))@@ +* You can define a default directory where images will be taken with the variable @@DEFAULT_FIND_IMAGE@@. + +## Constants + +Constants can be defined by putting @@!const@@ at the beginning of the line. Constants can be defined anywhere in the document, but only once. + +Some constants are predefined but have no value, so they can be defined once again: + +* @@!const TITLE=title@@ to define the page title +* @@!const ICON=icon@@ to define an icon for the page +* @@!const LANG=lang@@ to define the language used in the page +* @@!const ENCODING=encoding@@ to define the language used in the page, default is utf-8 +* @@!const BODY_CLASS=class@@ to define the body class +* @@!const BODY_ID=id@@ to define body id + +Some constants are predefined with a value, so cannot be redefined: + +* @@!const VERSION@@ the Hamill version used +* @@!const NOW@@ displays the day, month and year in a string in the format: Wednesday April 24, 2024. + +For the display of the day in the week, only English and French are managed according to the @@LANG@@ constant. + +## Variables + +Variables can be defined by putting @@!var@@ at the beginning of the line. You can change the value of a variable by redefining it in the document as many times as you like. + +* @@!var EXPORT_COMMENT=true/false@@ specifies whether comments will be exported as HTML or not +* @@!var PARAGRAPH_DEFINITION=true/false@@ specifies whether definition list dd's should be set in p tags +* @@!var DEFAULT_CODE=python/json@@ sets the default syntax highlighting of the code (none by default) +* @@!var NEXT_TAB_ID=ids@@ specifies the id of the **next** array +* @@!var NEXT_TAB_CLASS=cls@@ specifies the class of the **next** array +* @@!var DEFAULT_PAR_CLASS=cls@@ specifies the default class of **all following paragraphs** +* @@!var DEFAULT_TAB_CLASS=cls@@ specifies the default class for **all subsequent tables** +* @@!var DEFAULT_FIND_IMAGE=path@@ specifies a directory in which to fetch default images +* @@!var NEXT_CODE_ID=ids@@ specifies the id of the **next** code block +* @@!var NEXT_CODE_CLASS=cls@@ specifies the class of the **next** code block + +If @@NEXT_TAB_CLASS@@ and @@DEFAULT_TAB_CLASS@@ are defined, the value of @@NEXT_TAB_CLASS@@ will be used. + +## Including HTML files + +You can include an HTML file with @@!include@@ at the beginning of the line. The content of the file will be copied directly into the document. + +## Linking to a CSS or JavaScript file + +We can link our document to a CSS or JavaScript file with the @@!require@@ command at the beginning of the line. + +The link to a required CSS (.css) file is **automatically** placed at the head of the HTML document. + +The link to a required JavaScript file (.js or .mjs) is **automatically** placed at the top of the HTML document. + +## Special + +* @@!css css-code@@ allows you to add css code +* @@!html html-code@@ adds html code + +::markdown:: https://en.wikipedia.org/wiki/Markdown +::textile:: https://en.wikipedia.org/wiki/Textile_(markup_language) +::asciidoc:: http://asciidoc.org/ +::restructuredtext:: https://docutils.sourceforge.io/rst.html +::lml:: https://en.wikipedia.org/wiki/Lightweight_markup_language + +{{end}} +{{end}}