Outils pour utilisateurs

Outils du site


en:yaml:texte

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
en:yaml:texte [2026/10/18 22:49] – Documentation 4.17 : listes, boucles, raccourcis et editeur cyrilfiestaen:yaml:texte [2026/11/04 23:30] (Version actuelle) – Documentation 4.17 : objets, evenements et mise en page verifies cyrilfiesta
Ligne 44: Ligne 44:
  
 Supported languages: ''diff'', ''yaml'', ''python'', ''js'', ''json'', ''bash'', and every language handled by highlight.js on web and desktop. On Discord, they fall back to a plain code block. Supported languages: ''diff'', ''yaml'', ''python'', ''js'', ''json'', ''bash'', and every language handled by highlight.js on web and desktop. On Discord, they fall back to a plain code block.
- 
  
 ===== Story Blocks ===== ===== Story Blocks =====
Ligne 89: Ligne 88:
     text: "A styled badge"     text: "A styled badge"
 </code> </code>
 +
 +^ Key ^ Value ^
 +| ''size:'' | Size in pixels, such as ''18'' or ''24''. |
 +| ''font:'' | CSS font family, such as ''Georgia'', ''monospace'' or ''cursive''. |
 +| ''background:'' | CSS background color, such as ''"#111827"''. |
 +| ''text-color:'' | CSS text color, such as ''"#facc15"''. |
 +
 +These keys apply to the whole block on Web and Desktop; Discord and Terminal ignore them. Use inline Markdown to style a single word.
  
 ===== Room Background ===== ===== Room Background =====
Ligne 98: Ligne 105:
   text: "The room is dark."   text: "The room is dark."
 </code> </code>
- 
  
 ===== The global markdown: field ===== ===== The global markdown: field =====
Ligne 111: Ligne 117:
 | ''quote'' | Blockquote | | ''quote'' | Blockquote |
 | ''story'' | Story blocks enabled | | ''story'' | Story blocks enabled |
-| ''py'' / ''yaml'' / ''js'' / … | Highlighted code block | +| ''py'' / ''yaml'' / ''js'' / ... | Highlighted code block |
  
 ===== Interactive Inline Elements ===== ===== Interactive Inline Elements =====
Ligne 119: Ligne 124:
  
 <code yaml> <code yaml>
-text: "The %%{{door:?An old door.}}%% is locked." +text: 
-text: "Touch the %%{{lever:@pull_lever}}%%." +  - "The {{door:?An old door.}} is locked." 
-text: "Drop the %%{{key:>key}}%% onto the %%{{door:$door}}%%."+  - "Touch the {{lever:@pull_lever}}." 
 +  - "Drop the {{key:>key}} onto the {{door:$door}}."
 </code> </code>
  
Ligne 127: Ligne 133:
  
 Tiles and grids use the extended picture syntax: [[en:yaml:tiles-tilemaps|Tiles and tilemaps]]. Tiles and grids use the extended picture syntax: [[en:yaml:tiles-tilemaps|Tiles and tilemaps]].
- 
  
 ===== Reusing the text of another room ===== ===== Reusing the text of another room =====
Ligne 158: Ligne 163:
         to: chest         to: chest
       - to: corridor       - to: corridor
 +  - id: chest
 +    text: The chest.
 +  - id: corridor
 +    text: The corridor.
 </code> </code>
  
Ligne 182: Ligne 191:
  
 Write media tags in the scenario: ''%%[[t_item.image_t]]%%'' reads an address. An inserted value such as ''t_item.name_t'' stays text even if it contains tags. See [[en:yaml:listes-boucles|Lists and loops]]. In the editor, **Composed content** creates this group. Write media tags in the scenario: ''%%[[t_item.image_t]]%%'' reads an address. An inserted value such as ''t_item.name_t'' stays text even if it contains tags. See [[en:yaml:listes-boucles|Lists and loops]]. In the editor, **Composed content** creates this group.
 +
 +===== Furniture item and vertical inventory =====
 +
 +''%%[[ITEM_IN:coffre]]%%'' inserts the identifier of the first item present in that furniture in the current room, or empty text if it is empty. The French form is ''%%[[OBJET_DANS:coffre]]%%''.
 +
 +''%%[[INVENTORY_VERTICAL]]%%'' lists one item per line, using item identifiers and grouped quantities. The French form is ''%%[[INVENTAIRE_VERTICAL]]%%''.
 +
 +<code yaml>
 +title: 'Wiki 4.17: inventory'
 +language: en
 +rooms:
 +  - id: atelier
 +    auto_refresh: true
 +    text: |
 +      Inventory:
 +      [[INVENTORY_VERTICAL]]
 +      First item in coffre: [[ITEM_IN:coffre]]
 +    objects:
 +      - name: cle
 +        location: coffre
 +        pickup_reaction: Take
 +    choices:
 +      - command: regarder
 +        button: Look
 +        to: atelier
 +</code>
 +
 +''pickup_reaction: Take'' adds the native pickup button for this item in its furniture. ''auto_refresh: true'' refreshes the text after pickup: the key appears in the vertical inventory and the chest is empty. The "Look" choice displays the room again without taking an item.
 +
 +===== Previous room name =====
 +
 +''%%[[SALLE_PRECEDENTE]]%%'' inserts the known previous room ID, not its text or button label. Before the first move, the result is empty. Keep this French tag on English pages too: it has no English alias.
 +
 +<code yaml>
 +title: 'Wiki 4.17: previous'
 +rooms:
 +- id: entree
 +  text: 'Previous: [[SALLE_PRECEDENTE]]'
 +  choices:
 +  - button: Continue
 +    to: atelier
 +- id: atelier
 +  text: 'Previous: [[SALLE_PRECEDENTE]]'
 +  choices:
 +  - button: Back
 +    to: entree
 +</code>
 +
 +===== Local alignment and sized splits =====
 +
 +On Web, Desktop and in HTML exports, ''%%[[align:left]]text[[/align]]%%'' aligns a block. Directions are ''left'', ''center'', ''right'' or ''gauche'', ''centre'', ''droite''. A text variable such as ''t_cote_t'' can provide the direction. Close the block with ''%%[[/align]]%%''.
 +
 +''%%[[split]]%%'' separates zones. ''%%[[split:40]]%%'' gives 40% to the previous zone; the next receives the remainder. Splits and alignment also work in HUD panels.
 +
 +<code yaml>
 +title: 'Wiki 4.17: alignment'
 +vars_text:
 +  cote: right
 +rooms:
 +- id: atelier
 +  text: |
 +    [[align:left]]Left.[[/align]]
 +    [[align:center]]Center.[[/align]]
 +    [[align:t_cote_t]]Right.[[/align]]
 +    [[split:40]]
 +    Second zone.
 +  choices:
 +  - command: rester
 +    button: Stay
 +    to: atelier
 +</code>
  
en/yaml/texte.1792356547.txt.gz · Dernière modification : de cyrilfiesta