manual: use subheadings for primitive types

this gives us HTML anchors for each of them
This commit is contained in:
Valentin Gagarin 2022-07-28 17:09:53 +02:00
parent 86fcd4f692
commit 3063e5b94c

View file

@ -4,7 +4,9 @@
Nix has the following basic data types:
- *Strings* can be written in three ways.
### Strings
*Strings* can be written in three ways.
The most common way is to enclose the string between double quotes,
e.g., `"foo bar"`. Strings can span multiple lines. The special
@ -112,14 +114,18 @@ Nix has the following basic data types:
`"http://example.org/foo.tar.bz2"` can also be written as
`http://example.org/foo.tar.bz2`.
- Numbers, which can be *integers* (like `123`) or *floating point*
### Numbers
Numbers, which can be *integers* (like `123`) or *floating point*
(like `123.43` or `.27e13`).
Numbers are type-compatible: pure integer operations will always
return integers, whereas any operation involving at least one
floating point number will have a floating point number as a result.
- *Paths*, e.g., `/bin/sh` or `./builder.sh`. A path must contain at
### Paths
*Paths*, e.g., `/bin/sh` or `./builder.sh`. A path must contain at
least one slash to be recognised as such. For instance, `builder.sh`
is not a path: it's parsed as an expression that selects the
attribute `sh` from the variable `builder`. If the file name is
@ -146,9 +152,13 @@ Nix has the following basic data types:
recognized as a path. `a.${foo}/b.${bar}` is a syntactically valid division
operation. `./a.${foo}/b.${bar}` is a path.
- *Booleans* with values `true` and `false`.
### Booleans
- The null value, denoted as `null`.
*Booleans* with values `true` and `false`.
### Null
The null value, denoted as `null`.
## Lists