Skip to content

Commit

Permalink
Move language resources out of /guides directory (#6261)
Browse files Browse the repository at this point in the history
Contributes to #5767

---------

Co-authored-by: Marya <[email protected]>
  • Loading branch information
parlough and MaryaBelanger authored Dec 10, 2024
1 parent 4ec03d2 commit 1d6d38b
Show file tree
Hide file tree
Showing 37 changed files with 72 additions and 63 deletions.
2 changes: 1 addition & 1 deletion eleventy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function (eleventyConfig: UserConfig) {
filter: /^(?!_).+/,
});
eleventyConfig.addPassthroughCopy(
'src/content/guides/language/specifications',
'src/content/resources/language/spec/versions',
);

if (shouldOptimize) {
Expand Down
27 changes: 17 additions & 10 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
{ "source": "/+isolates", "destination": "/language/concurrency", "type": 301 },
{ "source": "/+lexicalscope", "destination": "/language/functions#lexical-scope", "type": 301 },
{ "source": "/+pub", "destination": "/tools/pub", "type": 301 },
{ "source": "/2.0", "destination": "/guides/language/evolution#dart-20", "type": 301 },
{ "source": "/2.0", "destination": "/resources/language/evolution#dart-2-0", "type": 301 },
{ "source": "/\\)", "destination": "/", "type": 301 },
{ "source": "/angular{,/**}", "destination": "https://github.com/angulardart", "type": 301 },
{ "source": "/api", "destination": "https://api.dart.dev", "type": 301 },
{ "source": "/articles", "destination": "https://medium.com/dartlang", "type": 301 },
{ "source": "/articles/api-naming-guide{,/**}", "destination": "/effective-dart/design", "type": 301 },
{ "source": "/articles/archive", "destination": "https://medium.com/dartlang", "type": 301 },
{ "source": "/articles/archive/converters-and-codecs", "destination": "/libraries/convert/converters-and-codecs", "type": 301 },
{ "source": "/articles/archive/dart-2", "destination": "/guides/language/evolution#dart-20", "type": 301 },
{ "source": "/articles/archive/dart-2", "destination": "/resources/language/evolution#dart-2-0", "type": 301 },
{ "source": "/articles/archive/event-loop", "destination": "https://medium.com/dartlang/dart-asynchronous-programming-isolates-and-event-loops-bffc3e296a6a", "type": 301 },
{ "source": "/articles/archive/numeric-computation", "destination": "/guides/language/numbers", "type": 301 },
{ "source": "/articles/archive/numeric-computation", "destination": "/resources/language/number-representation", "type": 301 },
{ "source": "/articles/archive/zones", "destination": "/libraries/async/zones", "type": 301 },
{ "source": "/articles/await-async", "destination": "/libraries/async/async-await", "type": 301 },
{ "source": "/articles/broadcast-streams", "destination": "https://medium.com/dartlang/dart-asynchronous-programming-streams-dab952023ed7", "type": 301 },
Expand All @@ -55,7 +55,7 @@
{ "source": "/articles/dart-unit-tests{,/**}", "destination": "https://pub.dev/packages/test#writing-tests", "type": 301 },
{ "source": "/articles/dart-vm/io", "destination": "/articles/libraries/dart-io", "type": 301 },
{ "source": "/articles/dart-vm/native-extensions", "destination": "/server/c-interop-native-extensions", "type": 301 },
{ "source": "/articles/dart-vm/numeric-computation", "destination": "/guides/language/numbers", "type": 301 },
{ "source": "/articles/dart-vm/numeric-computation", "destination": "/resources/language/number-representation", "type": 301 },
{ "source": "/articles/dart-vm/snapshots", "destination": "/tools/dart-compile", "type": 301 },
{ "source": "/articles/design-decisions/why-dart-types", "destination": "/resources/faq#types", "type": 301 },
{ "source": "/articles/doc-comment-guidelines", "destination": "/effective-dart/documentation", "type": 301 },
Expand All @@ -76,11 +76,11 @@
{ "source": "/articles/libraries/dart-io", "destination": "/libraries/dart-io", "type": 301 },
{ "source": "/articles/libraries/zones", "destination": "/libraries/async/zones", "type": 301 },
{ "source": "/articles/libraries*{,/**}", "destination": "/libraries", "type": 301 },
{ "source": "/articles/m*{,/**}", "destination": "/guides/language/evolution", "type": 301 },
{ "source": "/articles/m*{,/**}", "destination": "/resources/language/evolution", "type": 301 },
{ "source": "/articles/mixins", "destination": "/language/mixins", "type": 301 },
{ "source": "/articles/mocking-with-dart", "destination": "https://pub.dev/packages/mockito", "type": 301 },
{ "source": "/articles/native-extensions-for-standalone-dart-vm", "destination": "/server/c-interop-native-extensions", "type": 301 },
{ "source": "/articles/numeric-computation", "destination": "/guides/language/numbers", "type": 301 },
{ "source": "/articles/numeric-computation", "destination": "/resources/language/number-representation", "type": 301 },
{ "source": "/articles/optional-types", "destination": "/resources/faq#types", "type": 301 },
{ "source": "/articles/serialization", "destination": "/guides/json", "type": 301 },
{ "source": "/articles/server/native-extensions", "destination": "/server/c-interop-native-extensions", "type": 301 },
Expand All @@ -107,8 +107,8 @@
{ "source": "/code-of-conduct", "destination": "/community/code-of-conduct", "type": 301 },
{ "source": "/concurrency", "destination": "/language/concurrency", "type": 301 },
{ "source": "/dart", "destination": "/overview", "type": 301 },
{ "source": "/dart-2", "destination": "/guides/language/evolution#dart-20", "type": 301 },
{ "source": "/dart-2.0", "destination": "/guides/language/evolution#dart-20", "type": 301 },
{ "source": "/dart-2", "destination": "/resources/language/evolution#dart-2-0", "type": 301 },
{ "source": "/dart-2.0", "destination": "/resources/language/evolution#dart-2-0", "type": 301 },
{ "source": "/dart-3", "destination": "/resources/dart-3-migration", "type": 301 },
{ "source": "/dart-by-example", "destination": "/samples", "type": 301 },
{ "source": "/dart-team-packages", "destination": "/resources/dart-team-packages", "type": 301 },
Expand Down Expand Up @@ -139,7 +139,7 @@
{ "source": "/docs/serverguide", "destination": "/server", "type": 301 },
{ "source": "/docs/spec/EnumsTC52draft.pdf", "destination": "/language/enum", "type": 301 },
{ "source": "/docs/spec/deferred-loading", "destination": "/language/libraries#lazily-loading-a-library", "type": 301 },
{ "source": "/docs/spec{,/**}", "destination": "/guides/language/spec", "type": 301 },
{ "source": "/docs/spec{,/**}", "destination": "/resources/language/spec", "type": 301 },
{ "source": "/docs/technical-overview{,/**}", "destination": "/overview", "type": 301 },
{ "source": "/docs/tutorials/add-elements", "destination": "/library/dart-html", "type": 301 },
{ "source": "/docs/tutorials/cmdline", "destination": "/tutorials/server/cmdline", "type": 301 },
Expand Down Expand Up @@ -222,12 +222,16 @@
{ "source": "/guides/language/effective-dart", "destination": "/effective-dart", "type": 301 },
{ "source": "/guides/language/effective-dart/:page*", "destination": "/effective-dart/:page*", "type": 301 },
{ "source": "/guides/language/extension-methods", "destination": "/language/extension-methods", "type": 301 },
{ "source": "/guides/language/evolution", "destination": "/resources/language/evolution", "type": 301 },
{ "source": "/guides/language/formatting", "destination": "/tools/dart-format", "type": 301 },
{ "source": "/guides/language/language-tour", "destination": "/deprecated/language-tour", "type": 301 },
{ "source": "/guides/language/library-tour", "destination": "/libraries", "type": 301 },
{ "source": "/guides/language/numbers", "destination": "/resources/language/number-representation", "type": 301 },
{ "source": "/guides/language/sound-dart", "destination": "/language/type-system", "type": 301 },
{ "source": "/guides/language/sound-faq", "destination": "/language/type-system", "type": 301 },
{ "source": "/guides/language/specifications/DartLangSpec-v2.2.pdf", "destination": "https://github.com/dart-lang/site-www/blob/a7f170389e210adc2aef810cc9a6fdbfa78059a5/src/guides/language/specifications/DartLangSpec-v2.2.pdf", "type": 301 },
{ "source": "/guides/language/spec", "destination": "/resources/language/spec", "type": 301 },
{ "source": "/guides/language/specifications", "destination": "/resources/language/spec", "type": 301 },
{ "source": "/guides/language/specifications/:page*", "destination": "/resources/language/spec/versions/:page*", "type": 301 },
{ "source": "/guides/language/type-system", "destination": "/language/type-system", "type": 301 },
{ "source": "/guides/libraries", "destination": "/libraries", "type": 301 },
{ "source": "/guides/libraries/create-library-packages", "destination": "/tools/pub/create-packages", "type": 301 },
Expand Down Expand Up @@ -347,6 +351,9 @@
{ "source": "/resources/dart-tips*{,/**}", "destination": "/effective-dart", "type": 301 },
{ "source": "/resources/dartpad-best-practices", "destination": "https://doi.org/10.1145/3397537.3397558", "type": 301 },
{ "source": "/resources/dartpad-tutorials.pdf", "destination": "https://doi.org/10.1145/3397537.3397558", "type": 301 },
{ "source": "/resources/language/spec/versions", "destination": "/resources/language/spec", "type": 301 },
{ "source": "/resources/language/spec/versions/DartLangSpecDraft.pdf", "destination": "https://spec.dart.dev/DartLangSpecDraft.pdf", "type": 301 },
{ "source": "/resources/language/spec/versions/DartLangSpec-v2.2.pdf", "destination": "https://github.com/dart-lang/site-www/blob/a7f170389e210adc2aef810cc9a6fdbfa78059a5/src/guides/language/specifications/DartLangSpec-v2.2.pdf", "type": 301 },
{ "source": "/samples", "destination": "/language", "type": 301 },
{ "source": "/samples/spirodraw{,/**}", "destination": "/language", "type": 301 },
{ "source": "/samples/todomvc{,/**}", "destination": "/language", "type": 301 },
Expand Down
2 changes: 1 addition & 1 deletion src/_data/linter_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,7 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
"details": "Only use a `break` in a non-empty switch case statement if you need to break\nbefore the end of the case body. Dart does not support fallthrough execution\nfor non-empty cases, so `break`s at the end of non-empty switch case statements\nare unnecessary.\n\n**BAD:**\n```dart\nswitch (1) {\n case 1:\n print(\"one\");\n break;\n case 2:\n print(\"two\");\n break;\n}\n```\n\n**GOOD:**\n```dart\nswitch (1) {\n case 1:\n print(\"one\");\n case 2:\n print(\"two\");\n}\n```\n\n```dart\nswitch (1) {\n case 1:\n case 2:\n print(\"one or two\");\n}\n```\n\n```dart\nswitch (1) {\n case 1:\n break;\n case 2:\n print(\"just two\");\n}\n```\n\nNOTE: This lint only reports unnecessary breaks in libraries with a\n[language version](https://dart.dev/guides/language/evolution#language-versioning)\nof 3.0 or greater. Explicit breaks are still required in Dart 2.19 and below.",
"details": "Only use a `break` in a non-empty switch case statement if you need to break\nbefore the end of the case body. Dart does not support fallthrough execution\nfor non-empty cases, so `break`s at the end of non-empty switch case statements\nare unnecessary.\n\n**BAD:**\n```dart\nswitch (1) {\n case 1:\n print(\"one\");\n break;\n case 2:\n print(\"two\");\n break;\n}\n```\n\n**GOOD:**\n```dart\nswitch (1) {\n case 1:\n print(\"one\");\n case 2:\n print(\"two\");\n}\n```\n\n```dart\nswitch (1) {\n case 1:\n case 2:\n print(\"one or two\");\n}\n```\n\n```dart\nswitch (1) {\n case 1:\n break;\n case 2:\n print(\"just two\");\n}\n```\n\nNOTE: This lint only reports unnecessary breaks in libraries with a\n[language version](https://dart.dev/resources/language/evolution#language-versioning)\nof 3.0 or greater. Explicit breaks are still required in Dart 2.19 and below.",
"sinceDartSdk": "3.0"
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/_data/side-nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
- title: JSON
permalink: /guides/json
- title: Number representation
permalink: /guides/language/numbers
permalink: /resources/language/number-representation
- title: Google APIs
permalink: /resources/google-apis
- title: Multi-platform apps
Expand Down Expand Up @@ -348,9 +348,9 @@
- title: Breaking changes
permalink: /resources/breaking-changes
- title: Language evolution
permalink: /guides/language/evolution
permalink: /resources/language/evolution
- title: Language specification
permalink: /guides/language/spec
permalink: /resources/language/spec
- title: Dart 3 migration guide
permalink: /resources/dart-3-migration
- title: Coming from ...
Expand Down
4 changes: 2 additions & 2 deletions src/content/effective-dart/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,8 @@ comment.

{% render 'linter-rule-mention.md', rules:'prefer_mixin' %}

Dart previously (language version [2.12](/guides/language/evolution#dart-2-12)
to [2.19](/guides/language/evolution#dart-2-19)) allowed any class that
Dart previously (language version [2.12](/resources/language/evolution#dart-2-12)
to [2.19](/resources/language/evolution#dart-2-19)) allowed any class that
met certain restrictions (no non-default constructor, no superclass, etc.)
to be mixed into other classes.
This was confusing because the author of the class
Expand Down
2 changes: 1 addition & 1 deletion src/content/guides/language/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ These two resources are popular with both beginning Dart developers and experts.
Learn about and practice writing asynchronous code, using DartPad.
* [Streams](/libraries/async/using-streams)<br>
A beginner's guide to handling sequences of asynchronous events.
* [Specification](/guides/language/spec)<br>
* [Specification](/resources/language/spec)<br>
A definitive, highly technical description of the Dart language.
2 changes: 1 addition & 1 deletion src/content/language/branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ When the guard clause evaluates to false,
execution proceeds to the next case rather
than exiting the entire switch.

[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[loops]: /language/loops
[exceptions]: /language/error-handling
[conditional expressions]: /language/operators#conditional-expressions
Expand Down
4 changes: 2 additions & 2 deletions src/content/language/built-in-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,12 @@ Symbol literals are compile-time constants.
[`num`]: {{site.dart-api}}/dart-core/num-class.html
[`dart:math`]: {{site.dart-api}}/dart-math/dart-math-library.html
[bitwise and shift operator]: /language/operators#bitwise-and-shift-operators
[dart-numbers]: /guides/language/numbers
[dart-numbers]: /resources/language/number-representation
[runes]: {{site.dart-api}}/dart-core/Runes-class.html
[characters package]: {{site.pub-pkg}}/characters
[grapheme clusters]: https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries
[`Characters`]: {{site.pub-api}}/characters/latest/characters/Characters-class.html
[characters API]: {{site.pub-api}}/characters
[characters example]: {{site.pub-pkg}}/characters/example
[`Symbol`]: {{site.dart-api}}/dart-core/Symbol-class.html
[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
2 changes: 1 addition & 1 deletion src/content/language/class-modifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ check out the [Class modifiers reference][].
[Class modifiers reference]: /language/modifier-reference


[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[class, mixin, or mixin class]: /language/mixins#class-mixin-or-mixin-class
[mixin]: /language/mixins
[fragile base class problem]: https://en.wikipedia.org/wiki/Fragile_base_class
Expand Down
2 changes: 1 addition & 1 deletion src/content/language/constructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ class Vector3d extends Vector2d {
}
```

[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[using constructors]: /language/classes#using-constructors
[late-final-ivar]: /effective-dart/design#avoid-public-late-final-fields-without-initializers
[static method]: /language/classes#static-methods
2 changes: 1 addition & 1 deletion src/content/language/enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ print(Vehicle.car.carbonFootprint);
[mixins]: /language/mixins
[generative constructors]: /language/constructors#constant-constructors
[Factory constructors]: /language/constructors#factory-constructors
[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[static variable]: /language/classes#class-variables-and-methods
[switch statements]: /language/branches#switch
2 changes: 1 addition & 1 deletion src/content/language/extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ For more information, see the informal
[parameterized types]: /language/generics#restricting-the-parameterized-type
[operators]: /language/methods#operators
[generic method]: /language/generics#using-generic-methods
[Dart language specification]: /guides/language/spec
[Dart language specification]: /resources/language/spec
4 changes: 2 additions & 2 deletions src/content/language/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,14 +555,14 @@ and the [Dart API reference]({{site.dart-api}}).
This site's code follows the conventions in the
[Dart style guide](/effective-dart/style).

[Dart language specification]: /guides/language/spec
[Dart language specification]: /resources/language/spec
[Comments]: /language/comments
[built-in types]: /language/built-in-types
[Strings]: /language/built-in-types#strings
[The main() function]: /language/functions#the-main-function
[ns]: /null-safety
[`Object`]: {{site.dart-api}}/dart-core/Object-class.html
[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[ObjectVsDynamic]: /effective-dart/design#avoid-using-dynamic-unless-you-want-to-disable-static-checking
[Libraries and imports]: /language/libraries
[conditional expression]: /language/operators#conditional-expressions
Expand Down
2 changes: 1 addition & 1 deletion src/content/language/mixins.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,6 @@ Any restrictions that apply to classes or mixins also apply to mixin classes:
- Mixins can't have `extends` or `with` clauses, so neither can a `mixin class`.
- Classes can't have an `on` clause, so neither can a `mixin class`.

[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[class]: /language/classes
[class modifiers]: /language/class-modifiers
6 changes: 3 additions & 3 deletions src/content/language/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ The `>>>` operator (known as _triple-shift_ or _unsigned shift_)
requires a [language version][] of at least 2.14.
:::

[Bitwise operations platform differences]: /guides/language/numbers#bitwise-operations
[Bitwise operations platform differences]: /resources/language/number-representation#bitwise-operations

## Conditional expressions

Expand Down Expand Up @@ -541,10 +541,10 @@ For more information about the `.`, `?.`, and `..` operators, see


[operators as class members]: /language/methods#operators
[Dart language specification]: /guides/language/spec
[Dart language specification]: /resources/language/spec
[identical()]: {{site.dart-api}}/dart-core/identical.html
[Operators]: /language/methods#operators
[library prefixes]: /language/libraries#specifying-a-library-prefix
[if-else]: /language/branches#if
[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[Classes]: /language/classes
2 changes: 1 addition & 1 deletion src/content/language/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ This case pattern simultaneously validates that:
- The new local variables to hold the values are `name` and `age`.


[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[types]: /language/pattern-types
[collection-type]: /language/collections
[wildcard pattern]: /language/pattern-types#wildcard
Expand Down
2 changes: 1 addition & 1 deletion src/content/language/records.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ parallelization of futures of different types, which you can read about in the
[`dart:async` documentation][].
:::

[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[collection types]: /language/collections
[pattern]: /language/patterns#destructuring-multiple-returns
[`dart:async` documentation]: /libraries/dart-async#handling-errors-for-multiple-futures
Expand Down
2 changes: 1 addition & 1 deletion src/content/language/type-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,5 +500,5 @@ The following resources have further information on sound Dart:


[analysis]: /tools/analysis
[language version]: /guides/language/evolution#language-versioning
[language version]: /resources/language/evolution#language-versioning
[null safety]: /null-safety
Loading

0 comments on commit 1d6d38b

Please sign in to comment.