Skip to content

Commit

Permalink
update preview pictures
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
2bndy5 committed Dec 23, 2024
1 parent e1223c4 commit 9695813
Show file tree
Hide file tree
Showing 27 changed files with 116 additions and 34 deletions.
69 changes: 45 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
[io-doc]: https://cpp-linter.github.io/cpp-linter-action/inputs-outputs
[recipes-doc]: https://cpp-linter.github.io/cpp-linter-action/examples

[format-annotations-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/annotations-clang-format.png
[tidy-annotations-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/annotations-clang-tidy.png
[thread-comment-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/comment.png
[step-summary-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/step-summary.png
[tidy-review-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/tidy-review.png
[format-review-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/format-review.png
[format-suggestion-preview]: https://raw.githubusercontent.com/cpp-linter/cpp-linter-action/main/docs/images/format-suggestion.png

<!--README-start-->
<!-- start -->

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

Expand Down Expand Up @@ -71,49 +63,78 @@ For all explanations of our available input parameters and output variables, see
See also our [example recipes][recipes-doc].
<!-- stop -->
## Example
### Annotations
Using [`file-annotations`][file-annotations]:
Using [`--file-annotations`][file-annotations]:

#### clang-format annotations

![clang-format annotations][format-annotations-preview]
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/images/format-annotation-dark.png">
<source media="(prefers-color-scheme: light)" srcset="docs/images/format-annotation-light.png">
<img alt="format-annotation-preview." src="docs/images/format-review-light.png">
</picture>

#### clang-tidy annotations

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

### Thread Comment

Using [`thread-comments`][thread-comments]:
Using [`--thread-comments`][thread-comments]:

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

### Step Summary

Using [`step-summary`][step-summary]:
Using [`--step-summary`][step-summary]:

![step summary][step-summary-preview]
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/images/step-summary-dark.png">
<source media="(prefers-color-scheme: light)" srcset="docs/images/step-summary-light.png">
<img alt="step-summary-preview." src="docs/images/step-summary-light.png">
</picture>

### Pull Request Review

#### Only clang-tidy

Using [`tidy-review`][tidy-review]:
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/images/review-summary-dark.png">
<source media="(prefers-color-scheme: light)" srcset="docs/images/review-summary-light.png">
<img alt="review-summary-preview." src="docs/images/review-summary-light.png">
</picture>

![sample tidy-review][tidy-review-preview]
#### clang-tidy suggestion

#### Only clang-format
Using [`--tidy-review`][tidy-review]:

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

![sample format-review][format-review-preview]
#### clang-format suggestion

![sample format-suggestion][format-suggestion-preview]
Using [`--format-review`][format-review]:

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

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

You can show C/C++ Linter Action status with a badge in your repository README
Expand Down
Binary file removed docs/images/annotations-clang-format.png
Binary file not shown.
Binary file removed docs/images/annotations-clang-tidy.png
Binary file not shown.
Binary file removed docs/images/comment.png
Binary file not shown.
Binary file added docs/images/format-annotation-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/format-annotation-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/format-review-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/format-review-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/format-review.png
Binary file not shown.
Binary file removed docs/images/format-suggestion.png
Binary file not shown.
Binary file added docs/images/review-summary-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/review-summary-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/step-summary-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/step-summary-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/step-summary.png
Binary file not shown.
Binary file added docs/images/thread-comment-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/thread-comment-expanded-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/thread-comment-expanded-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/thread-comment-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tidy-annotation-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tidy-annotation-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tidy-review-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tidy-review-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/tidy-review.png
Binary file not shown.
71 changes: 61 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,67 @@
[io-doc]: inputs-outputs.md
[recipes-doc]: examples/index.md

[format-annotations-preview]: images/annotations-clang-format.png
[tidy-annotations-preview]: images/annotations-clang-tidy.png
[thread-comment-preview]: images/comment.png
[step-summary-preview]: images/step-summary.png
[tidy-review-preview]: images/tidy-review.png
[format-review-preview]: images/format-review.png
[format-suggestion-preview]: images/format-suggestion.png
{%
include "../README.md"
start="<!-- start -->"
end="<!-- stop -->"
%}

## Example

### Annotations

Using [`--file-annotations`][file-annotations]:

#### clang-format annotations

![format-annotation-dark](images/format-annotation-dark.png){ .dark-only }
![format-annotation-light](images/format-annotation-light.png){ .light-only }

#### clang-tidy annotations

![tidy-annotation-dark](images/tidy-annotation-dark.png){ .dark-only }
![tidy-annotation-light](images/tidy-annotation-light.png){ .light-only }

### Thread Comment

Using [`--thread-comments`][thread-comments]:

![thread-comment-dark](images/thread-comment-dark.png){ .dark-only }
![thread-comment-light](images/thread-comment-light.png){ .light-only }

??? example "Expanded"

![thread-comment-expanded-dark](images/thread-comment-expanded-dark.png){ .dark-only }
![thread-comment-expanded-light](images/thread-comment-expanded-light.png){ .light-only }

### Step Summary

Using [`--step-summary`][step-summary]:

![step-summary-dark](images/step-summary-dark.png){ .dark-only }
![step-summary-light](images/step-summary-light.png){ .light-only }

### Pull Request Review

![review-summary-dark](images/review-summary-dark.png){ .dark-only }
![review-summary-light](images/review-summary-light.png){ .light-only }

#### clang-tidy suggestion

Using [`--tidy-review`][tidy-review]:

![tidy-review-dark](images/tidy-review-dark.png){ .dark-only }
![tidy-review-light](images/tidy-review-light.png){ .light-only }

#### clang-format suggestion

Using [`--format-review`][format-review]:

![format-review-dark](images/format-review-dark.png){ .dark-only }
![format-review-light](images/format-review-light.png){ .light-only }

{%
include-markdown "../README.md"
start="<!--README-start-->"
end="<!--README-end-->"
include "../README.md"
start="<!-- resume -->"
%}
9 changes: 9 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ th {
background-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="default"] img.dark-only {
display: none;

}

[data-md-color-scheme="slate"] img.light-only {
display: none;
}

.md-header,
.md-nav--primary .md-nav__title[for="__drawer"] {
background-color: #4051b5;
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ markdown_extensions:
- pymdownx.highlight:
linenums_style: pymdownx-inline
- pymdownx.inlinehilite
- pymdownx.details
- pymdownx.snippets:
check_paths: true
- attr_list
Expand Down

0 comments on commit 9695813

Please sign in to comment.