From dbf1a47c43604ac904157e71f4921685086ad830 Mon Sep 17 00:00:00 2001 From: doup Date: Wed, 15 May 2024 19:52:40 +0200 Subject: [PATCH 1/4] Add `callout` shortcode --- sass/components/_callout.scss | 35 +++++++++++++++++++++++++++++++ sass/site.scss | 1 + templates/shortcodes/callout.html | 3 +++ 3 files changed, 39 insertions(+) create mode 100644 sass/components/_callout.scss create mode 100644 templates/shortcodes/callout.html diff --git a/sass/components/_callout.scss b/sass/components/_callout.scss new file mode 100644 index 0000000000..dc5e18f191 --- /dev/null +++ b/sass/components/_callout.scss @@ -0,0 +1,35 @@ +.callout { + margin-block: 32px; + padding: 16px; + border-radius: 4px; + background-color: var(--callout-bg-color); + border-top: 4px solid var(--callout-accent-color); + color: var(--callout-color); + + >:first-child { + margin-top: 0; + } + + >:last-child { + margin-bottom: 0; + } + + &, + &--info { + --callout-accent-color: #5944e0; + --callout-bg-color: #2f2745; + --callout-color: #f0effb; + } + + &--caution { + --callout-accent-color: #e82f5a; + --callout-bg-color: #591626; + --callout-color: #eed5db; + } + + &--warning { + --callout-accent-color: #e4c151; + --callout-bg-color: #513903; + --callout-color: #fdfdec; + } +} diff --git a/sass/site.scss b/sass/site.scss index 7788449916..e3a60e5b23 100644 --- a/sass/site.scss +++ b/sass/site.scss @@ -28,6 +28,7 @@ @import "components/docs-footer"; @import "components/button-square"; @import "components/button"; +@import "components/callout"; @import "components/card"; @import "components/container"; @import "components/example"; diff --git a/templates/shortcodes/callout.html b/templates/shortcodes/callout.html new file mode 100644 index 0000000000..7804578761 --- /dev/null +++ b/templates/shortcodes/callout.html @@ -0,0 +1,3 @@ +
+ {{ body | markdown | safe }} +
From ac8e32e0d951f4a11a527267657cc2fc172be276 Mon Sep 17 00:00:00 2001 From: doup Date: Wed, 15 May 2024 19:53:33 +0200 Subject: [PATCH 2/4] Use callouts in a couple of places --- content/learn/quick-start/getting-started/_index.md | 5 ++++- content/learn/quick-start/introduction.md | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/content/learn/quick-start/getting-started/_index.md b/content/learn/quick-start/getting-started/_index.md index 1646ec3539..891e15a6d9 100644 --- a/content/learn/quick-start/getting-started/_index.md +++ b/content/learn/quick-start/getting-started/_index.md @@ -12,10 +12,13 @@ This section will help you get started on your Bevy journey as quickly as possib If you want to dive in immediately and you already have a working Rust setup, feel free to follow this "quick start" guide. Otherwise, move on to the next page. -Note: depending on your platform, you may have to [install additional dependencies]. You can also speed up compile times by following the ["fast compiles"] section. +{% callout() %} +**Note**: depending on your platform, you may have to [install additional dependencies]. +You can also speed up compile times by following the ["fast compiles"] section. [install additional dependencies]: /learn/quick-start/getting-started/setup/#installing-os-dependencies ["fast compiles"]: /learn/quick-start/getting-started/setup/#enable-fast-compiles-optional +{% end %} ### Try the Examples diff --git a/content/learn/quick-start/introduction.md b/content/learn/quick-start/introduction.md index c03b8b814d..a98a231efd 100644 --- a/content/learn/quick-start/introduction.md +++ b/content/learn/quick-start/introduction.md @@ -29,13 +29,13 @@ Bevy is [built in the open by volunteers](/learn/quick-start/contributing) using For a more in-depth introduction, check out the [Introducing Bevy](/news/introducing-bevy/) blog post. -

- Stability Warning -

+{% callout(type="warning") %} +## Stability Warning Bevy is still in the early stages of development. Important features are missing. Documentation is sparse. A new version of Bevy containing breaking changes to the API is released [approximately once every 3 months](https://bevyengine.org/news/bevy-0-6/#the-train-release-schedule). We provide [migration guides](https://bevyengine.org/learn/book/migration-guides/), but we can't guarantee migrations will always be easy. Use only if you are willing to work in this environment. If you are currently trying to pick an engine for your Next Big Projectâ„¢, we recommend that you check out [Godot Engine](https://godotengine.org). It is currently much more feature-complete and stable. And it is also free, open-source, and [scriptable with Rust](https://github.com/godot-rust/gdext)! +{% end %} The Quick Start Guide is not a comprehensive guide to Bevy and the next section [Getting Started](/learn/quick-start/getting-started/) will help you with the setup of Bevy and learning the basics, but it does not cover most of Bevy's features. In the future you can use the Bevy Book to gain a better understanding, until then see the last page [Next Steps](/learn/quick-start/next-steps) for more exhaustive and complex resources on Bevy. From 19909b6eb3a3fa4b53e0a0756b79a9cb940d95a4 Mon Sep 17 00:00:00 2001 From: doup Date: Wed, 15 May 2024 20:04:10 +0200 Subject: [PATCH 3/4] Add missing trailing space --- templates/shortcodes/callout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/shortcodes/callout.html b/templates/shortcodes/callout.html index 7804578761..d93d1f92ec 100644 --- a/templates/shortcodes/callout.html +++ b/templates/shortcodes/callout.html @@ -1,3 +1,3 @@ -
+
{{ body | markdown | safe }}
From e3213be78b8f90c747e1aea52363e842b7b30141 Mon Sep 17 00:00:00 2001 From: doup Date: Wed, 15 May 2024 20:09:49 +0200 Subject: [PATCH 4/4] Remove `Note` text as it's implicit --- content/learn/quick-start/getting-started/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/learn/quick-start/getting-started/_index.md b/content/learn/quick-start/getting-started/_index.md index 891e15a6d9..5b02a49357 100644 --- a/content/learn/quick-start/getting-started/_index.md +++ b/content/learn/quick-start/getting-started/_index.md @@ -13,7 +13,7 @@ This section will help you get started on your Bevy journey as quickly as possib If you want to dive in immediately and you already have a working Rust setup, feel free to follow this "quick start" guide. Otherwise, move on to the next page. {% callout() %} -**Note**: depending on your platform, you may have to [install additional dependencies]. +Depending on your platform, you may have to [install additional dependencies]. You can also speed up compile times by following the ["fast compiles"] section. [install additional dependencies]: /learn/quick-start/getting-started/setup/#installing-os-dependencies