Skip to content

Commit cc1446e

Browse files
[Docs] - Re-organized pages, updated theming
1 parent 8fdb793 commit cc1446e

25 files changed

+183
-206
lines changed

doc/website/source/_data.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,20 @@ navigation:
3737
- title: "Get Started"
3838
url: /get-started
3939

40+
- title: Galleries
41+
tag: gallery
42+
sortBy: navOrder
43+
44+
- title: Timelines
45+
tag: timeline
46+
sortBy: navOrder
47+
4048
- title: Golden Scenes
41-
tag: scenes
49+
tag: golden-scenes
4250
sortBy: navOrder
4351

44-
- title: How it Works
45-
tag: how-it-works
52+
- title: Failure Scenes
53+
tag: failure-scenes
4654
sortBy: navOrder
4755

4856
- title: Flutter's Implementation

doc/website/source/_includes/components/highlightJs.jinja

Lines changed: 0 additions & 40 deletions
This file was deleted.

doc/website/source/_includes/layouts/docs_page.jinja

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@
2323

2424
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css">
2525
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
26+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/obsidian.min.css">
2627
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/dart.min.js"></script>
27-
<script>hljs.highlightAll();</script>
28+
<script>
29+
hljs.highlightAll();
30+
</script>
2831

2932
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
3033

3134
<link rel="stylesheet" href="/styles/docs_page_layout.css">
32-
<link rel="stylesheet" href="/styles/docs_page_layout_light.css">
3335
<link rel="stylesheet" href="/styles/docs_page_layout_dark.css">
3436
</head>
3537

@@ -97,11 +99,17 @@
9799

98100
<!-- Page/article content -->
99101
<main class="page-content col-12 col-lg-10 col-xl-8">
102+
{% if headerImage is defined %}
103+
<header class="image">
104+
<img class="background" src="{{ headerImage }}">
105+
</header>
106+
{% else %}
100107
<header>
101108
<h1>{{ title }}</h1>
102109
</header>
110+
{% endif %}
103111

104-
{{ content }}
112+
{{ content }}
105113
</main>
106114

107115
<!-- Table of contents for the page/article on desktop -->
@@ -126,12 +134,12 @@
126134
// - not in an "onload" function - because we need this code to
127135
// run before anything is painted. Otherwise we get a flicker from
128136
// light mode to dark mode on load.
129-
var brightness = localStorage.getItem('brightness');
130-
if (brightness === "light" || brightness === null) {
131-
goToLightMode();
132-
} else {
137+
//var brightness = localStorage.getItem('brightness');
138+
//if (brightness === "light" || brightness === null) {
139+
// goToLightMode();
140+
//} else {
133141
goToDarkMode();
134-
}
142+
//}
135143
136144
// Configure the global text search input.
137145
//docsearch({
@@ -158,10 +166,6 @@
158166
// For Algolia Docsearch bar theme
159167
html.setAttribute("data-theme", "light");
160168
161-
var button = document.getElementById("brightness-button");
162-
button.classList.remove("fa-sun");
163-
button.classList.add("fa-moon");
164-
165169
localStorage.setItem('brightness', 'light');
166170
}
167171
@@ -172,10 +176,6 @@
172176
// For Algolia Docsearch bar theme
173177
html.setAttribute("data-theme", "dark");
174178
175-
var button = document.getElementById("brightness-button");
176-
button.classList.remove("fa-moon");
177-
button.classList.add("fa-sun");
178-
179179
localStorage.setItem('brightness', 'dark');
180180
}
181181
</script>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tags: failure-scenes

doc/website/source/golden-scenes/failures.md renamed to doc/website/source/failure-scenes/failures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Failures
3-
navOrder: 40
2+
title: What is a Failure Scene?
3+
navOrder: 10
44
---
55
Building on the concept of [Golden Scenes](/golden-scenes/what-is-it), `flutter_test_goldens` introduces
66
the concept of "Failure Scenes". A Failure Scene is just like a Golden Scene, except instead of painting
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tags: gallery

doc/website/source/golden-scenes/gallery.md renamed to doc/website/source/gallery/gallery.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Gallery
33
navOrder: 20
4+
headerImage: /images/gallery.png
45
---
56
A gallery is a Golden Scene, which includes a variety of different widgets
67
and/or widget configurations.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Single Shot
3+
navOrder: 10
4+
headerImage: /images/single_shot_website_header.png
5+
---
6+
A "single shot" is a gallery that displays only one golden image. Most golden use-cases
7+
involve multiple related golden images, but sometimes you only need one. That's when you
8+
should use a `SingleShot`.
9+
10+
```dart
11+
void main() {
12+
testGoldenScene("Calendar", (tester) async {
13+
await SingleShot("Calendar", fileName: "shadcn-calendar") //
14+
.fromWidget(ShadCalendar())
15+
.inScaffold(shadcnItemScaffold)
16+
.withLayout(ShadcnSingleShotSceneLayout(
17+
shadcnWordmarkProvider: shadcnWordmarkProvider,
18+
))
19+
.run(tester);
20+
});
21+
}
22+
```

doc/website/source/get-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ dev_dependencies:
1111
With the packaged added, you may want to accomplish a variety of goals:
1212
1313
* [Write a gallery test](/golden-scenes/gallery)
14-
* [Write a film strip test](/golden-scenes/filmstrip)
14+
* [Write a timeline test](/golden-scenes/filmstrip)
1515
* [Add focus and semantic tracking](/golden-metadata/payload)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
tags: scenes
1+
tags: golden-scenes

0 commit comments

Comments
 (0)