-
Notifications
You must be signed in to change notification settings - Fork 734
Documentation guide
This is a work in progress.
Follow the Google Developer Documentation Style Guide.
You can use the following variables in the Dart documentation.
Variable | Result |
---|---|
{{site.dart_api}} |
https://api.dartlang.org |
{{site.data.pkg-vers.SDK.channel}} |
stable or dev
|
See Semantic line breaks (<=80 chars).
See URLs
If you need to add an anchor to a page, but not attach it to a heading use this format:
<a id="control-flow-operators" aria-hidden="true"></a>
--- title: Dart SDK Archive description: Download a specific version of the Dart SDK. ---
There are more fields that you can add. For details, see Top matter (YAML)
:::note Note text goes here. :::
See Asides (notes, tips, warnings, ...)
:::tip Tip text goes here. :::
See Asides (notes, tips, warnings, ...)
:::warning Warning text goes here. :::
See Asides (notes, tips, warnings, ...)
{% tabs "device-type-tabs" %} {% tab "Android" %} Android content here. {% endtab %} {% tab "iOS" %} iOS content here. {% endtab %} {% endtabs %}
Most code samples in the docs need to be generated from code excerpts. If you see a tag that looks like the following in the docs, the code sample is being generated from a code excerpt.
<?code-excerpt "examples/main.dart (optional-region-name)" arg0="value0" ...?> ```dart void main() {} ```
Don't attempt to change the code sample directly in the markdown file. If you do, your PR will fail when you try and post it for review. To learn more about code excerpts see the Code excerpts README.
```kotlin title="MainActivity.kt" put code here ```
Code results should be styled with the plaintext
keyword.
```plaintext i = 1, j = 1 i = 1, j = 2 i = 1, j = 3 i = 2, j = 1 i = 2, j = 2 outerLoop exited ```
```dart tag=fails-sa // put failing code here ```
If you are using code excerpts to generate code samples and you want to suppress an intended error or warning, you can add a comment in your code excerpt for this. To learn more, see https://dart.dev/tools/analysis
Look at this PR: https://github.com/dart-lang/site-www/pull/6576
To run tests against the beta branch of Dart, use the following command to switch to the beta branch:
flutter channel beta && flutter upgrade
To run tests against the stable branch of Dart, use the following command to switch to the stable branch:
flutter channel stable && flutter upgrade