styleguide.md 2.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Styleguide

If not explicitly stated otherwise,
the following takes effect for all files:

- character encoding __utf-8__
- line endings with __lf__
- indentation with __4 spaces__
- final new line

!!! info
    There will be most likely a editorconfig present,
    please make sure your used IDE respects this.

!!! tip
    In general,
    it's a good idea to have a look into the yet existing code,
    to check how certain things were done up to now.

## Markdown

most important bullet points:

- leave always an empty line above and beneath of lists.
    It may render fine in normal markdown viewers,
    but not in the MkDocs Pages docs (like this)  

    ??? example inline end
        __bad:__
        ```markdown
        some text
        - bullet point
        - another item
        more normal text
        ```
        __good:__
        ```markdown
        some text

        - bullet point
        - another item

        more normal text
        ```

- if you insert a link,
    __always__ write the link to the bottom of the file with an alias,
    ordered alphabetically.  

    ??? example
        __bad:__
        ```markdown
        Look [here](https://www.coolsite.not/with/ultra/long/url) to read more about this.
        ```
        __good:__
        ```markdown
        Look [here][coolsite] to read more about this.

        [coolsite]: https://www.coolsite.not/with/ultra/long/url
        ```

- split long sentences on punctuation and connection words like `and` & `or`.  
    It will have the same appearance in viewers,
    but be much easier to maintain on code side.

    ??? example
        __bad__:
        ```markdown
        Some sentence that is very long, therefore it has punctuation and has absolutely no sense at all.
        ```
        > Some sentence that is very long, therefore it has punctuation and has absolutely no sense at all.

        __good:__
        ```markdown
        Some sentence that is very long,
        therefore it has punctuation
        and has absolutely no sense at all.
        ```

        > Some sentence that is very long,
        > therefore it has punctuation
        > and has absolutely no sense at all.

- tables have to be formatted in code

    ??? example
        __bad:__
        ```markdown
        ||column 1|
        |:-|:-|
        |__row 1__|cell 1|
        ```

        __good:__
        ```markdown
        |           | column 1 |
        | :-------- | :------- |
        | __row 1__ | cell 1   |
        ```