Skip to content

Commit a20b33e

Browse files
committed
update preview pictures
Now includes light and dark theme variants of screenshots. The README will only render (on github) the relevant picture based on the user's preference. See [github docs](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#specifying-the-theme-an-image-is-shown-to) Updated mkdocs build similarly, but uses CSS instead of raw HTML.
1 parent e1223c4 commit a20b33e

27 files changed

+116
-34
lines changed

README.md

+45-24
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@
77
[io-doc]: https://cpp-linter.github.io/cpp-linter-action/inputs-outputs
88
[recipes-doc]: https://cpp-linter.github.io/cpp-linter-action/examples
99

10-
[format-annotations-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/annotations-clang-format.png
11-
[tidy-annotations-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/annotations-clang-tidy.png
12-
[thread-comment-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/comment.png
13-
[step-summary-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/step-summary.png
14-
[tidy-review-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/tidy-review.png
15-
[format-review-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/format-review.png
16-
[format-suggestion-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/format-suggestion.png
17-
18-
<!--README-start-->
10+
<!-- start -->
1911

2012
# C/C++ Linter Action <sub><sup>| clang-format & clang-tidy</sup></sub>
2113

@@ -71,49 +63,78 @@ For all explanations of our available input parameters and output variables, see
7163
7264
See also our [example recipes][recipes-doc].
7365
66+
<!-- stop -->
7467
## Example
7568
7669
### Annotations
7770
78-
Using [`file-annotations`][file-annotations]:
71+
Using [`--file-annotations`][file-annotations]:
7972

8073
#### clang-format annotations
8174

82-
![clang-format annotations][format-annotations-preview]
75+
<picture>
76+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/format-annotation-dark.png">
77+
<source media="(prefers-color-scheme: light)" srcset="docs/images/format-annotation-light.png">
78+
<img alt="format-annotation-preview." src="docs/images/format-annotation-light.png">
79+
</picture>
8380

8481
#### clang-tidy annotations
8582

86-
![clang-tidy annotations][tidy-annotations-preview]
83+
<picture>
84+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/tidy-annotation-dark.png">
85+
<source media="(prefers-color-scheme: light)" srcset="docs/images/tidy-annotation-light.png">
86+
<img alt="tidy-annotation-preview." src="docs/images/tidy-annotation-light.png">
87+
</picture>
8788

8889
### Thread Comment
8990

90-
Using [`thread-comments`][thread-comments]:
91+
Using [`--thread-comments`][thread-comments]:
9192

92-
![sample thread-comment][thread-comment-preview]
93+
<picture>
94+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/thread-comment-dark.png">
95+
<source media="(prefers-color-scheme: light)" srcset="docs/images/thread-comment-light.png">
96+
<img alt="thread-comment-preview." src="docs/images/thread-comment-light.png">
97+
</picture>
9398

9499
### Step Summary
95100

96-
Using [`step-summary`][step-summary]:
101+
Using [`--step-summary`][step-summary]:
97102

98-
![step summary][step-summary-preview]
103+
<picture>
104+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/step-summary-dark.png">
105+
<source media="(prefers-color-scheme: light)" srcset="docs/images/step-summary-light.png">
106+
<img alt="step-summary-preview." src="docs/images/step-summary-light.png">
107+
</picture>
99108

100109
### Pull Request Review
101110

102-
#### Only clang-tidy
103-
104-
Using [`tidy-review`][tidy-review]:
111+
<picture>
112+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/review-summary-dark.png">
113+
<source media="(prefers-color-scheme: light)" srcset="docs/images/review-summary-light.png">
114+
<img alt="review-summary-preview." src="docs/images/review-summary-light.png">
115+
</picture>
105116

106-
![sample tidy-review][tidy-review-preview]
117+
#### clang-tidy suggestion
107118

108-
#### Only clang-format
119+
Using [`--tidy-review`][tidy-review]:
109120

110-
Using [`format-review`][format-review]:
121+
<picture>
122+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/tidy-review-dark.png">
123+
<source media="(prefers-color-scheme: light)" srcset="docs/images/tidy-review-light.png">
124+
<img alt="tidy-review-preview." src="docs/images/tidy-review-light.png">
125+
</picture>
111126

112-
![sample format-review][format-review-preview]
127+
#### clang-format suggestion
113128

114-
![sample format-suggestion][format-suggestion-preview]
129+
Using [`--format-review`][format-review]:
115130

131+
<picture>
132+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/format-review-dark.png">
133+
<source media="(prefers-color-scheme: light)" srcset="docs/images/format-review-light.png">
134+
<img alt="format-review-preview." src="docs/images/format-review-light.png">
135+
</picture>
116136

137+
<!-- resume -->
117138
## Add C/C++ Linter Action badge in README
118139

119140
You can show C/C++ Linter Action status with a badge in your repository README
-19.9 KB
Binary file not shown.
-23.9 KB
Binary file not shown.

docs/images/comment.png

-22.3 KB
Binary file not shown.
11.1 KB
Loading
11 KB
Loading

docs/images/format-review-dark.png

27.5 KB
Loading

docs/images/format-review-light.png

27.6 KB
Loading

docs/images/format-review.png

-26.5 KB
Binary file not shown.

docs/images/format-suggestion.png

-32.7 KB
Binary file not shown.

docs/images/review-summary-dark.png

31.8 KB
Loading

docs/images/review-summary-light.png

32 KB
Loading

docs/images/step-summary-dark.png

28.7 KB
Loading

docs/images/step-summary-light.png

28.4 KB
Loading

docs/images/step-summary.png

-51.1 KB
Binary file not shown.

docs/images/thread-comment-dark.png

23.9 KB
Loading
46 KB
Loading
46 KB
Loading

docs/images/thread-comment-light.png

23.9 KB
Loading

docs/images/tidy-annotation-dark.png

10.6 KB
Loading

docs/images/tidy-annotation-light.png

10.6 KB
Loading

docs/images/tidy-review-dark.png

39.8 KB
Loading

docs/images/tidy-review-light.png

40 KB
Loading

docs/images/tidy-review.png

-59.4 KB
Binary file not shown.

docs/index.md

+61-10
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,67 @@
77
[io-doc]: inputs-outputs.md
88
[recipes-doc]: examples/index.md
99

10-
[format-annotations-preview]: images/annotations-clang-format.png
11-
[tidy-annotations-preview]: images/annotations-clang-tidy.png
12-
[thread-comment-preview]: images/comment.png
13-
[step-summary-preview]: images/step-summary.png
14-
[tidy-review-preview]: images/tidy-review.png
15-
[format-review-preview]: images/format-review.png
16-
[format-suggestion-preview]: images/format-suggestion.png
10+
{%
11+
include "../README.md"
12+
start="<!-- start -->"
13+
end="<!-- stop -->"
14+
%}
15+
16+
## Example
17+
18+
### Annotations
19+
20+
Using [`--file-annotations`][file-annotations]:
21+
22+
#### clang-format annotations
23+
24+
![format-annotation-dark](images/format-annotation-dark.png){ .dark-only }
25+
![format-annotation-light](images/format-annotation-light.png){ .light-only }
26+
27+
#### clang-tidy annotations
28+
29+
![tidy-annotation-dark](images/tidy-annotation-dark.png){ .dark-only }
30+
![tidy-annotation-light](images/tidy-annotation-light.png){ .light-only }
31+
32+
### Thread Comment
33+
34+
Using [`--thread-comments`][thread-comments]:
35+
36+
![thread-comment-dark](images/thread-comment-dark.png){ .dark-only }
37+
![thread-comment-light](images/thread-comment-light.png){ .light-only }
38+
39+
??? example "Expanded"
40+
41+
![thread-comment-expanded-dark](images/thread-comment-expanded-dark.png){ .dark-only }
42+
![thread-comment-expanded-light](images/thread-comment-expanded-light.png){ .light-only }
43+
44+
### Step Summary
45+
46+
Using [`--step-summary`][step-summary]:
47+
48+
![step-summary-dark](images/step-summary-dark.png){ .dark-only }
49+
![step-summary-light](images/step-summary-light.png){ .light-only }
50+
51+
### Pull Request Review
52+
53+
![review-summary-dark](images/review-summary-dark.png){ .dark-only }
54+
![review-summary-light](images/review-summary-light.png){ .light-only }
55+
56+
#### clang-tidy suggestion
57+
58+
Using [`--tidy-review`][tidy-review]:
59+
60+
![tidy-review-dark](images/tidy-review-dark.png){ .dark-only }
61+
![tidy-review-light](images/tidy-review-light.png){ .light-only }
62+
63+
#### clang-format suggestion
64+
65+
Using [`--format-review`][format-review]:
66+
67+
![format-review-dark](images/format-review-dark.png){ .dark-only }
68+
![format-review-light](images/format-review-light.png){ .light-only }
1769

1870
{%
19-
include-markdown "../README.md"
20-
start="<!--README-start-->"
21-
end="<!--README-end-->"
71+
include "../README.md"
72+
start="<!-- resume -->"
2273
%}

docs/stylesheets/extra.css

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ th {
22
background-color: var(--md-default-fg-color--lightest);
33
}
44

5+
[data-md-color-scheme="default"] img.dark-only {
6+
display: none;
7+
8+
}
9+
10+
[data-md-color-scheme="slate"] img.light-only {
11+
display: none;
12+
}
13+
514
.md-header,
615
.md-nav--primary .md-nav__title[for="__drawer"] {
716
background-color: #4051b5;

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ markdown_extensions:
8484
- pymdownx.highlight:
8585
linenums_style: pymdownx-inline
8686
- pymdownx.inlinehilite
87+
- pymdownx.details
8788
- pymdownx.snippets:
8889
check_paths: true
8990
- attr_list

0 commit comments

Comments
 (0)