mirror of
https://github.com/Fechin/reference.git
synced 2026-11-20 21:23:11 +03:00
fix: ini format
Fix formatting of emphasis and code block languages
This commit is contained in:
1 file changed
+33
-54
+33
-54
@@ -6,31 +6,26 @@ tags:
|
||||
categories:
|
||||
- Programming
|
||||
intro: |
|
||||
This is a quick reference cheat sheet for understanding and writing INI-format configuration files.
|
||||
This is a quick reference cheat sheet for understanding and writing INI-format configuration files.
|
||||
plugins:
|
||||
- copyCode
|
||||
- copyCode
|
||||
---
|
||||
|
||||
Getting Started
|
||||
----
|
||||
## Getting Started
|
||||
|
||||
|
||||
|
||||
### introduction
|
||||
### Introduction
|
||||
|
||||
- INI is a configuration file with a fixed standard format
|
||||
- Base elements are keys or properties
|
||||
- Each key consists of a `name` and a `value`, separated by an equal sign (`=`)
|
||||
- `key name` is displayed to the `left side` of the equals sign
|
||||
- `equal sign` and `semicolon` are `reserved` characters
|
||||
- Each key consists of a **name** and a **value**, separated by an equal sign (`=`)
|
||||
- **key name** is displayed to the **left side** of the equals sign
|
||||
- Equal sign (`=`) and semicolon (`;`) are **reserved** characters
|
||||
- INI configuration method comes from the MS-DOS operating system
|
||||
|
||||
Now an informal standard for many configurations, other operating systems may use `.conf` or `.cfg` as a suffix
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```ini
|
||||
; Here are the comments
|
||||
[owner]
|
||||
@@ -47,18 +42,16 @@ file="acme payroll.dat"
|
||||
foo = bar
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
### Comments
|
||||
|
||||
comment (`;`)
|
||||
Comment (`;`)
|
||||
|
||||
```ini
|
||||
; This is the comment text and will be ignored
|
||||
```
|
||||
|
||||
comment (`#`)
|
||||
Comment (`#`)
|
||||
|
||||
```ini
|
||||
# Here is the comment text, ⚠️ Some compilers support it
|
||||
```
|
||||
@@ -72,8 +65,6 @@ foo = bar # this is another inline comment
|
||||
|
||||
Comments must appear alone on lines in some cases
|
||||
|
||||
|
||||
|
||||
### Sections
|
||||
|
||||
- The name appears on a line by itself
|
||||
@@ -100,8 +91,6 @@ The same as `JSON` below 👇
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Nesting (supported by some parsers)
|
||||
|
||||
```ini
|
||||
@@ -113,7 +102,7 @@ foo = bar
|
||||
|
||||
The same as `JSON` below 👇
|
||||
|
||||
```js
|
||||
```json
|
||||
{
|
||||
"section": {
|
||||
"domain": "cheatsheets.zip"
|
||||
@@ -133,28 +122,24 @@ domain = cheatsheets.zip
|
||||
foo = bar
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Escape character
|
||||
|
||||
sequence | meaning
|
||||
:-| :-
|
||||
`\\` | \ (single backslash, escape escape character)
|
||||
`\'` | apostrophe
|
||||
`\"` | double quotes
|
||||
`\0` | null character
|
||||
`\a` | ringtone/alert/sound
|
||||
`\b` | Backspace, [Bell character] for some applications (https://en.wikipedia.org/wiki/Bell_character)
|
||||
`\t` | tab character
|
||||
`\r` | carriage return
|
||||
`\n` | newline
|
||||
`\;` | semicolon
|
||||
`\#` | number sign
|
||||
`\=` | equal sign
|
||||
`\:` | colon
|
||||
`\x????` | Unicode character for the hexadecimal code point corresponding to ????
|
||||
|
||||
|
||||
| sequence | meaning |
|
||||
| :------- | :----------------------------------------------------------------------------------------------- |
|
||||
| `\\` | \ (single backslash, escape escape character) |
|
||||
| `\'` | apostrophe |
|
||||
| `\"` | double quotes |
|
||||
| `\0` | null character |
|
||||
| `\a` | ringtone/alert/sound |
|
||||
| `\b` | Backspace, [Bell character] for some applications (https://en.wikipedia.org/wiki/Bell_character) |
|
||||
| `\t` | tab character |
|
||||
| `\r` | carriage return |
|
||||
| `\n` | newline |
|
||||
| `\;` | semicolon |
|
||||
| `\#` | number sign |
|
||||
| `\=` | equal sign |
|
||||
| `\:` | colon |
|
||||
| `\x????` | Unicode character for the hexadecimal code point corresponding to ???? |
|
||||
|
||||
### Array
|
||||
|
||||
@@ -167,20 +152,15 @@ array[]=second value
|
||||
|
||||
The same as `JSON` below 👇
|
||||
|
||||
```js
|
||||
```json
|
||||
{
|
||||
"section": {
|
||||
"domain": "cheatsheets.zip",
|
||||
"array": [
|
||||
"first value",
|
||||
"second value"
|
||||
]
|
||||
}
|
||||
"section": {
|
||||
"domain": "cheatsheets.zip",
|
||||
"array": ["first value", "second value"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Interpreter
|
||||
|
||||
- [@go-ini/ini](https://github.com/go-ini/ini) _(golang)_
|
||||
@@ -191,7 +171,6 @@ The same as `JSON` below 👇
|
||||
- [@rickyah/ini-parser](https://github.com/rickyah/ini-parser) _(c#)_
|
||||
- [@Enichan/Ini](https://github.com/Enichan/Ini) _(c#)_
|
||||
|
||||
## See also
|
||||
|
||||
See also
|
||||
---
|
||||
- [INI file configuration](https://en.wikipedia.org/wiki/INI_file)_(wikipedia.org)_
|
||||
Reference in new issue
Block a user