Skip to content

Instantly share code, notes, and snippets.

@pwilkowski
pwilkowski / code_style.md
Last active April 28, 2025 20:40 — forked from jesseschalken/code_style.md
Code style

My preferred code style is tabs K&R. This is intended to provide a justification for this style.

Why K&R?

K&R style has the following properties:

  1. Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
  2. Forces no empty or meaningless lines, thereby avoiding artificial distance between related things that should be together.
  3. Consumes the minimum vertical space while keeping the opening and closing syntax of a block on separate lines from the content.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MD</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/12.3.0/markdown-it.min.js"
integrity="sha512-q1tclxbgrDhFhGp/i9mnxITl2FQ3TCfwNj0mZ1r2USwj9WNXBpQ1au4HOBdAq8LXXWFIcsW+5dsdFHyVdk10AQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>

NextUI Template tags:

Data Text templates allows you to replace a text with custom template, you can use any combination of those below as well as normal text, some examples:

  • [name] - [hp:f] => Player Surname - 32k
  • [hp:pct:f]% => 48%
  • [name:first] is missing [hp:def:f] health! => Player is missing 32k health!
  • [somethingrandom] => [somethingrandom]