Skip to content

File tree

13 files changed

+186
-151
lines changed

13 files changed

+186
-151
lines changed

site/lib/_sass/components/_code.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,25 @@ iframe[src^="https://dartpad"] {
254254
resize: vertical;
255255
width: 100%;
256256
}
257+
258+
.file-tree {
259+
--file-tree-bg: var(--site-inset-bgColor);
260+
--file-tree-text: var(--site-base-fgColor);
261+
--file-tree-icon: var(--site-base-fgColor-alt);
262+
--file-tree-highlight: var(--site-link-fgColor);
263+
264+
font-family: var(--site-code-fontFamily);
265+
266+
border: 1px solid var(--site-inset-borderColor);
267+
margin-block-start: 1rem;
268+
margin-block-end: 1rem;
269+
270+
details {
271+
margin: unset;
272+
273+
summary {
274+
font-weight: unset;
275+
user-select: unset;
276+
}
277+
}
278+
}

site/lib/jaspr_options.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import 'package:docs_flutter_dev_site/src/components/pages/learning_resource_fil
3535
as prefix13;
3636
import 'package:docs_flutter_dev_site/src/components/pages/learning_resource_filters_sidebar.dart'
3737
as prefix14;
38+
import 'package:jaspr_content/components/file_tree.dart' as prefix15;
3839

3940
/// Default [JasprOptions] for use with your jaspr project.
4041
///
@@ -122,7 +123,7 @@ JasprOptions get defaultJasprOptions => JasprOptions(
122123
'src/components/pages/learning_resource_filters_sidebar',
123124
),
124125
},
125-
styles: () => [],
126+
styles: () => [...prefix15.FileTree.styles],
126127
);
127128

128129
Map<String, dynamic> _prefix2CopyButton(prefix2.CopyButton c) => {

site/lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
import 'package:jaspr/server.dart';
6+
import 'package:jaspr_content/components/file_tree.dart';
67
import 'package:jaspr_content/jaspr_content.dart';
78
import 'package:jaspr_content/theme.dart';
89
import 'package:path/path.dart' as path;
@@ -94,6 +95,7 @@ List<CustomComponent> get _embeddableComponents => [
9495
const DashTabs(),
9596
const DashImage(),
9697
const YoutubeEmbed(),
98+
const FileTree(),
9799
CustomComponent(
98100
pattern: RegExp('OSSelector', caseSensitive: false),
99101
builder: (_, _, _) => const OsSelector(),

site/lib/src/layouts/dash_layout.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'dart:convert' show htmlEscape;
6-
75
import 'package:jaspr/jaspr.dart';
86
import 'package:jaspr_content/jaspr_content.dart';
97

@@ -102,9 +100,7 @@ abstract class FlutterDocsLayout extends PageLayoutBase {
102100
),
103101
link(
104102
rel: 'stylesheet',
105-
href:
106-
'/assets/css/main.css?'
107-
'hash=${htmlEscape.convert(generatedStylesHash)}',
103+
href: '/assets/css/main.css?hash=$generatedStylesHash',
108104
),
109105

110106
if (pageData['js'] case final List<Object?> jsList)

site/lib/src/style_hash.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// dart format off
33

44
/// The generated hash of the `main.css` file.
5-
const generatedStylesHash = 'mW0BCRz4bRll';
5+
const generatedStylesHash = 'ZFZ+YS8Vr+JP';

src/_includes/docs/add-to-app/ios-project/embed-cocoapods.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ If you have a different directory structure,
3535
adjust the relative paths.
3636
The example directory structure resembles the following:
3737

38-
```plaintext
39-
/path/to/MyApp
40-
├── my_flutter/
41-
│ └── .ios/
42-
│ └── Flutter/
43-
│ └── podhelper.rb
44-
└── MyApp/
45-
└── Podfile
46-
```
38+
<FileTree>
39+
40+
- my_flutter/
41+
- .ios/
42+
- Flutter/
43+
- podhelper.rb
44+
- MyApp/
45+
- Podfile
46+
47+
</FileTree>
4748

4849
#### Update your Podfile
4950

src/_includes/docs/add-to-app/ios-project/embed-framework-directory-tree.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,27 @@ Run this _every time_ you change code in your Flutter module.
99

1010
The resulting project structure should resemble this directory tree.
1111

12-
```plaintext
13-
/path/to/MyApp/
14-
└── Flutter/
15-
├── Debug/
16-
│ ├── Flutter.xcframework
17-
│   ├── App.xcframework
18-
│   ├── FlutterPluginRegistrant.xcframework (only if you have plugins with iOS platform code)
19-
│   └── example_plugin.xcframework (each plugin is a separate framework)
20-
├── Profile/
21-
│ ├── Flutter.xcframework
22-
│ ├── App.xcframework
23-
│ ├── FlutterPluginRegistrant.xcframework
24-
│ └── example_plugin.xcframework
25-
└── Release/
26-
├── Flutter.xcframework
27-
├── App.xcframework
28-
├── FlutterPluginRegistrant.xcframework
29-
└── example_plugin.xcframework
30-
```
12+
<FileTree>
13+
14+
- /path/to/MyApp/
15+
- Flutter/
16+
- Debug/
17+
- Flutter.xcframework
18+
- App.xcframework
19+
- FlutterPluginRegistrant.xcframework (If you have plugins with iOS-platform code)
20+
- example_plugin.xcframework (One framework file for each plugin)
21+
- Profile/
22+
- Flutter.xcframework
23+
- App.xcframework
24+
- FlutterPluginRegistrant.xcframework
25+
- example_plugin.xcframework
26+
- Release/
27+
- Flutter.xcframework
28+
- App.xcframework
29+
- FlutterPluginRegistrant.xcframework
30+
- example_plugin.xcframework
31+
32+
</FileTree>
3133

3234
:::warning
3335
Always use `Flutter.xcframework` and `App.xcframework` bundles

src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
77
directories.
88
Name this new directory the name of the platform package.
99

10-
```plaintext highlightLines=3
11-
plugin_name/ios/
12-
├── ...
13-
└── plugin_name/
14-
```
10+
<FileTree>
11+
12+
- plugin_name/
13+
- ios/
14+
- ...
15+
- **plugin_name/**
16+
17+
</FileTree>
1518

1619
1. Within this new directory, create the following files/directories:
1720

@@ -27,14 +30,17 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
2730

2831
Your plugin should look like:
2932

30-
```plaintext highlightLines=4-6
31-
plugin_name/ios/
32-
├── ...
33-
└── plugin_name/
34-
├── Package.swift
35-
└── Sources/plugin_name/include/plugin_name/
36-
└── .gitkeep
37-
```
33+
<FileTree>
34+
35+
- plugin_name/
36+
- ios/
37+
- ...
38+
- plugin_name/
39+
- **Package.swift**
40+
- **Sources/plugin_name/include/plugin_name/**
41+
- **.gitkeep/**
42+
43+
</FileTree>
3844

3945
1. Use the following template in the `Package.swift` file:
4046

src/_includes/docs/swift-package-manager/migrate-swift-plugin.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
77
directories.
88
Name this new directory the name of the platform package.
99

10-
```plaintext highlightLines=3
11-
plugin_name/ios/
12-
├── ...
13-
└── plugin_name/
14-
```
10+
<FileTree>
11+
12+
- plugin_name/
13+
- ios/
14+
- ...
15+
- **plugin_name/**
16+
17+
</FileTree>
1518

1619
1. Within this new directory, create the following files/directories:
1720

@@ -21,13 +24,17 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
2124

2225
Your plugin should look like:
2326

24-
```plaintext highlightLines=4-5
25-
plugin_name/ios/
26-
├── ...
27-
└── plugin_name/
28-
├── Package.swift
29-
└── Sources/plugin_name/
30-
```
27+
<FileTree>
28+
29+
- plugin_name/
30+
- ios/
31+
- ...
32+
- plugin_name/
33+
- **Package.swift**
34+
- **Sources/**
35+
- **plugin_name/**
36+
37+
</FileTree>
3138

3239
1. Use the following template in the `Package.swift` file:
3340

src/content/add-to-app/android/project-setup.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -284,27 +284,29 @@ More specifically, this command creates
284284
(by default all debug/profile/release modes)
285285
a [local repository][], with the following files:
286286

287-
```plaintext
288-
build/host/outputs/repo
289-
└── com
290-
└── example
291-
└── flutter_module
292-
├── flutter_release
293-
│ ├── 1.0
294-
│ │   ├── flutter_release-1.0.aar
295-
│ │   ├── flutter_release-1.0.aar.md5
296-
│ │   ├── flutter_release-1.0.aar.sha1
297-
│ │   ├── flutter_release-1.0.pom
298-
│ │   ├── flutter_release-1.0.pom.md5
299-
│ │   └── flutter_release-1.0.pom.sha1
300-
│ ├── maven-metadata.xml
301-
│ ├── maven-metadata.xml.md5
302-
│ └── maven-metadata.xml.sha1
303-
├── flutter_profile
304-
│ ├── ...
305-
└── flutter_debug
306-
└── ...
307-
```
287+
<FileTree>
288+
289+
- build/host/outputs/repo
290+
- com
291+
- example
292+
- flutter_module
293+
- flutter_release
294+
- 1.0
295+
- flutter_release-1.0.aar
296+
- flutter_release-1.0.aar.md5
297+
- flutter_release-1.0.aar.sha1
298+
- flutter_release-1.0.pom
299+
- flutter_release-1.0.pom.md5
300+
- flutter_release-1.0.pom.sha1
301+
- maven-metadata.xml
302+
- maven-metadata.xml.md5
303+
- maven-metadata.xml.sha1
304+
- flutter_profile
305+
- ...
306+
- flutter_debug
307+
- ...
308+
309+
</FileTree>
308310

309311
To depend on the AAR, the host app must be able
310312
to find these files.

0 commit comments

Comments
 (0)