File: tricks.md

package info (click to toggle)
doxygen-awesome-css 2.3.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 6,244 kB
  • sloc: javascript: 289; cpp: 33; makefile: 28
file content (127 lines) | stat: -rw-r--r-- 3,657 bytes parent folder | download | duplicates (3)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Tips & Tricks

[TOC]

## Diagrams with Graphviz {#tricks-graphviz}

To get the best-looking class diagrams for your documentation, generate them with Graphviz as vector graphics with transparent background:

```
# Doxyfile
HAVE_DOT = YES
DOT_IMAGE_FORMAT = svg
DOT_TRANSPARENT = YES
```

In case `INTERACTIVE_SVG = YES` is set in the Doxyfile, all user-defined dotgraphs must be wrapped with the `interactive_dotgraph` CSS class for them to be rendered correctly:

```md
<div class="interactive_dotgraph">

\dotfile graph.dot

</div>
```

@note Both the default overflow scrolling behavior in this theme and the interactive editor enabled by `INTERACTIVE_SVG` are unsatisfying workarounds IMHO. Consider designing your graphs to be narrow enough to fit the page to avoid scrolling.

## Disable Dark Mode {#tricks-darkmode}

If you don't want the theme to automatically switch to dark mode depending on the browser preference,
you can disable dark mode by adding the `light-mode` class to the HTML tag in the header template:

```html
<html xmlns="http://www.w3.org/1999/xhtml" class="light-mode">
```

The same can be done to always enable dark mode:

```html
<html xmlns="http://www.w3.org/1999/xhtml" class="dark-mode">
```


@warning This only works if you don't use the dark-mode toggle extension.

## Choosing Sidebar Width {#tricks-sidebar}

If you have enabled the sidebar-only theme variant, make sure to carefully choose a proper width for your sidebar.
It should be wide enough to hold the icon, project title and version number. If the content is too wide, it will be
cut off.

```css
html {
    /* Make sure sidebar is wide enough to contain the page title (logo + title + version) */
    --side-nav-fixed-width: 335px;
}
```

The chosen width should also be set in the Doxyfile:

```
# Doxyfile
TREEVIEW_WIDTH = 335
```

## Formatting Tables {#tricks-tables}

By default tables in this theme are left-aligned and as wide as required to fit their content.
Those properties can be changed for individual tables.

### Centering

Tables can be centered by wrapping them in the `<center>` HTML tag.

<div class="tabbed">

- <span class="tab-title">Code</span>
    ```md
    <center>
        | This table | is centered          |
        |------------|----------------------|
        | test 1     | test 2               |
    </center>
    ```
- <span class="tab-title">Result</span>
    <center>
        | This table | is centered |
        |------------|----------------------|
        | test 1     | test 2               |
    </center>

</div>



### Full Width

To make tables span the full width of the page, no matter how wide the content is, wrap the table in the `full_width_table` CSS class.

@warning Apply with caution! This breaks the overflow scrolling of the table. Content might be cut off on small screens!

<div class="tabbed">

- <span class="tab-title">Code</span>
    ```md
    <div class="full_width_table">
        | This table | spans the full width |
        |------------|----------------------|
        | test 1     | test 2               |
    </div>
    ```
- <span class="tab-title">Result</span>
    <div class="full_width_table">
        | This table | spans the full width |
        |------------|----------------------|
        | test 1     | test 2               |
    </div>

</div>

<div class="section_buttons">

| Previous                          |                                   Next |
|:----------------------------------|---------------------------------------:|
| [Customization](customization.md) | [Example](https://jothepro.github.io/doxygen-awesome-css/class_my_library_1_1_example.html) |

</div>