diff --git a/_config.yml b/_config.yml index 24ca3d983c..130ecbbd36 100644 --- a/_config.yml +++ b/_config.yml @@ -45,9 +45,6 @@ collections: articles: output: true permalink: /articles/:path - tutorials: - output: true - permalink: /tutorials/:path guides: output: true permalink: /guides/:path diff --git a/src/_tutorials/README.md b/src/_tutorials/README.md deleted file mode 100644 index 24b2bb364a..0000000000 --- a/src/_tutorials/README.md +++ /dev/null @@ -1,35 +0,0 @@ -The tutorial examples, including source for DartPad examples, -live in the "dart-tutorials-samples" repo on GitHub. - -DartPad grabs source for these examples from "gist" files. -The gist files are generated from the source in the sample repo, -using the gist-generator. - -For info on how to generate the gist files, see: -https://github.com/dart-lang/dart-tutorials-samples/blob/master/README.md - -To generate the gist files, you need to use a gist token/password. -Get the token from the creator of the original gist file. - -Location of relevant resources: - -GitHub repo for tutorials examples: -https://github.com/dart-lang/dart-tutorials-samples - -Gist files: -https://gist.github.com/ - -Gist generator: -https://github.com/kasperpeulen/gist-generator - -DartPad: -{{site.dartpad}} - -Definitions for the DartPad constants used on dartlang: -src/site/_config.yml - -Embedding Guide for DartPad: -https://github.com/dart-lang/dart-pad/wiki/Embedding-Guide - -Defined constants for embedding DartPad: -/src/site/_config.yml diff --git a/src/_tutorials/images/housekeeping-files.png b/src/assets/img/tutorials/libraries/housekeeping-files.png similarity index 100% rename from src/_tutorials/images/housekeeping-files.png rename to src/assets/img/tutorials/libraries/housekeeping-files.png diff --git a/src/_tutorials/images/libraries-folder.png b/src/assets/img/tutorials/libraries/libraries-folder.png similarity index 100% rename from src/_tutorials/images/libraries-folder.png rename to src/assets/img/tutorials/libraries/libraries-folder.png diff --git a/src/_tutorials/images/other-folders.png b/src/assets/img/tutorials/libraries/other-folders.png similarity index 100% rename from src/_tutorials/images/other-folders.png rename to src/assets/img/tutorials/libraries/other-folders.png diff --git a/src/_tutorials/server/images/dcat-dart-run.svg b/src/assets/img/tutorials/server/dcat-dart-run.svg similarity index 100% rename from src/_tutorials/server/images/dcat-dart-run.svg rename to src/assets/img/tutorials/server/dcat-dart-run.svg diff --git a/src/_tutorials/web/images/add-element-code.png b/src/assets/img/tutorials/web/add-element-code.png similarity index 100% rename from src/_tutorials/web/images/add-element-code.png rename to src/assets/img/tutorials/web/add-element-code.png diff --git a/src/_tutorials/web/images/add-element.png b/src/assets/img/tutorials/web/add-element.png similarity index 100% rename from src/_tutorials/web/images/add-element.png rename to src/assets/img/tutorials/web/add-element.png diff --git a/src/_tutorials/web/images/anagram-move.png b/src/assets/img/tutorials/web/anagram-move.png similarity index 100% rename from src/_tutorials/web/images/anagram-move.png rename to src/assets/img/tutorials/web/anagram-move.png diff --git a/src/_tutorials/web/images/anagram-newletters.png b/src/assets/img/tutorials/web/anagram-newletters.png similarity index 100% rename from src/_tutorials/web/images/anagram-newletters.png rename to src/assets/img/tutorials/web/anagram-newletters.png diff --git a/src/_tutorials/web/images/child-references.png b/src/assets/img/tutorials/web/child-references.png similarity index 100% rename from src/_tutorials/web/images/child-references.png rename to src/assets/img/tutorials/web/child-references.png diff --git a/src/_tutorials/web/images/css-code.png b/src/assets/img/tutorials/web/css-code.png similarity index 100% rename from src/_tutorials/web/images/css-code.png rename to src/assets/img/tutorials/web/css-code.png diff --git a/src/_tutorials/web/images/css-property-value.png b/src/assets/img/tutorials/web/css-property-value.png similarity index 100% rename from src/_tutorials/web/images/css-property-value.png rename to src/assets/img/tutorials/web/css-property-value.png diff --git a/src/_tutorials/web/images/css-rule-explained.png b/src/assets/img/tutorials/web/css-rule-explained.png similarity index 100% rename from src/_tutorials/web/images/css-rule-explained.png rename to src/assets/img/tutorials/web/css-rule-explained.png diff --git a/src/_tutorials/web/images/dart-html-connect-full.png b/src/assets/img/tutorials/web/dart-html-connect-full.png similarity index 100% rename from src/_tutorials/web/images/dart-html-connect-full.png rename to src/assets/img/tutorials/web/dart-html-connect-full.png diff --git a/src/_tutorials/web/images/dart-html-connect.png b/src/assets/img/tutorials/web/dart-html-connect.png similarity index 100% rename from src/_tutorials/web/images/dart-html-connect.png rename to src/assets/img/tutorials/web/dart-html-connect.png diff --git a/src/_tutorials/web/images/dynamic-dart.png b/src/assets/img/tutorials/web/dynamic-dart.png similarity index 100% rename from src/_tutorials/web/images/dynamic-dart.png rename to src/assets/img/tutorials/web/dynamic-dart.png diff --git a/src/_tutorials/web/images/event-handler-idiom.png b/src/assets/img/tutorials/web/event-handler-idiom.png similarity index 100% rename from src/_tutorials/web/images/event-handler-idiom.png rename to src/assets/img/tutorials/web/event-handler-idiom.png diff --git a/src/_tutorials/web/images/event-handler-todo.png b/src/assets/img/tutorials/web/event-handler-todo.png similarity index 100% rename from src/_tutorials/web/images/event-handler-todo.png rename to src/assets/img/tutorials/web/event-handler-todo.png diff --git a/src/_tutorials/web/images/event-listener-exp.png b/src/assets/img/tutorials/web/event-listener-exp.png similarity index 100% rename from src/_tutorials/web/images/event-listener-exp.png rename to src/assets/img/tutorials/web/event-listener-exp.png diff --git a/src/_tutorials/web/images/paragraph-dom.png b/src/assets/img/tutorials/web/paragraph-dom.png similarity index 100% rename from src/_tutorials/web/images/paragraph-dom.png rename to src/assets/img/tutorials/web/paragraph-dom.png diff --git a/src/_tutorials/web/images/parent-reference.png b/src/assets/img/tutorials/web/parent-reference.png similarity index 100% rename from src/_tutorials/web/images/parent-reference.png rename to src/assets/img/tutorials/web/parent-reference.png diff --git a/src/_tutorials/web/images/relationships.png b/src/assets/img/tutorials/web/relationships.png similarity index 100% rename from src/_tutorials/web/images/relationships.png rename to src/assets/img/tutorials/web/relationships.png diff --git a/src/_tutorials/web/images/remove-all-code.png b/src/assets/img/tutorials/web/remove-all-code.png similarity index 100% rename from src/_tutorials/web/images/remove-all-code.png rename to src/assets/img/tutorials/web/remove-all-code.png diff --git a/src/_tutorials/web/images/remove-all-elements.png b/src/assets/img/tutorials/web/remove-all-elements.png similarity index 100% rename from src/_tutorials/web/images/remove-all-elements.png rename to src/assets/img/tutorials/web/remove-all-elements.png diff --git a/src/_tutorials/web/images/remove-element-code.png b/src/assets/img/tutorials/web/remove-element-code.png similarity index 100% rename from src/_tutorials/web/images/remove-element-code.png rename to src/assets/img/tutorials/web/remove-element-code.png diff --git a/src/_tutorials/web/images/remove-element.png b/src/assets/img/tutorials/web/remove-element.png similarity index 100% rename from src/_tutorials/web/images/remove-element.png rename to src/assets/img/tutorials/web/remove-element.png diff --git a/src/_tutorials/web/images/simple-dom-tree.png b/src/assets/img/tutorials/web/simple-dom-tree.png similarity index 100% rename from src/_tutorials/web/images/simple-dom-tree.png rename to src/assets/img/tutorials/web/simple-dom-tree.png diff --git a/src/_tutorials/web/images/simple-html.png b/src/assets/img/tutorials/web/simple-html.png similarity index 100% rename from src/_tutorials/web/images/simple-html.png rename to src/assets/img/tutorials/web/simple-html.png diff --git a/src/_tutorials/web/images/todo-dart.png b/src/assets/img/tutorials/web/todo-dart.png similarity index 100% rename from src/_tutorials/web/images/todo-dart.png rename to src/assets/img/tutorials/web/todo-dart.png diff --git a/src/_tutorials/web/images/todo-dom.png b/src/assets/img/tutorials/web/todo-dom.png similarity index 100% rename from src/_tutorials/web/images/todo-dom.png rename to src/assets/img/tutorials/web/todo-dom.png diff --git a/src/_tutorials/web/images/todo-html.png b/src/assets/img/tutorials/web/todo-html.png similarity index 100% rename from src/_tutorials/web/images/todo-html.png rename to src/assets/img/tutorials/web/todo-html.png diff --git a/src/_tutorials/index.md b/src/tutorials/index.md similarity index 91% rename from src/_tutorials/index.md rename to src/tutorials/index.md index 29b574f65f..1002a5366f 100644 --- a/src/_tutorials/index.md +++ b/src/tutorials/index.md @@ -44,5 +44,4 @@ which are fundamental to most Dart programs. ## More tutorials -See the [Flutter tutorials.](https://flutter.dev/tutorials) - +Check out the [Flutter codelabs and tutorials]({{site.flutter-docs}}/codelabs). diff --git a/src/_tutorials/language/index.md b/src/tutorials/language/index.md similarity index 100% rename from src/_tutorials/language/index.md rename to src/tutorials/language/index.md diff --git a/src/_tutorials/language/streams.md b/src/tutorials/language/streams.md similarity index 100% rename from src/_tutorials/language/streams.md rename to src/tutorials/language/streams.md diff --git a/src/_tutorials/libraries/index.md b/src/tutorials/libraries/index.md similarity index 100% rename from src/_tutorials/libraries/index.md rename to src/tutorials/libraries/index.md diff --git a/src/_tutorials/libraries/shared-pkgs.md b/src/tutorials/libraries/shared-pkgs.md similarity index 97% rename from src/_tutorials/libraries/shared-pkgs.md rename to src/tutorials/libraries/shared-pkgs.md index 7e42cd003e..ea3a939ced 100644 --- a/src/_tutorials/libraries/shared-pkgs.md +++ b/src/tutorials/libraries/shared-pkgs.md @@ -197,7 +197,7 @@ only one, `lib`, was installed when you ran pub get.
- Dart libraries directory
@@ -209,7 +209,7 @@ only one, `lib`, was installed when you ran pub get.
- Housekeeping files
@@ -230,7 +230,7 @@ only one, `lib`, was installed when you ran pub get.
- Document, scripts, tests, and other resources
diff --git a/src/_tutorials/server/_dcat-example.html b/src/tutorials/server/_dcat-example.html similarity index 100% rename from src/_tutorials/server/_dcat-example.html rename to src/tutorials/server/_dcat-example.html diff --git a/src/_tutorials/server/cmdline.md b/src/tutorials/server/cmdline.md similarity index 99% rename from src/_tutorials/server/cmdline.md rename to src/tutorials/server/cmdline.md index 882a7446f2..09738b71bc 100644 --- a/src/_tutorials/server/cmdline.md +++ b/src/tutorials/server/cmdline.md @@ -204,7 +204,7 @@ result of parsing command-line arguments is stored in `argResults`. The following diagram shows how the `dcat` command line used above is parsed into an `ArgResults` object. -![Run dcat from the command-line](images/dcat-dart-run.svg){:width="350"} +![Run dcat from the command-line](/assets/img/tutorials/server/dcat-dart-run.svg){:width="350"} You can access flags and options by name, treating an `ArgResults` like a `Map`. diff --git a/src/_tutorials/server/fetch-data.md b/src/tutorials/server/fetch-data.md similarity index 100% rename from src/_tutorials/server/fetch-data.md rename to src/tutorials/server/fetch-data.md diff --git a/src/_tutorials/server/get-started.md b/src/tutorials/server/get-started.md similarity index 100% rename from src/_tutorials/server/get-started.md rename to src/tutorials/server/get-started.md diff --git a/src/_tutorials/server/httpserver.md b/src/tutorials/server/httpserver.md similarity index 100% rename from src/_tutorials/server/httpserver.md rename to src/tutorials/server/httpserver.md diff --git a/src/_tutorials/server/index.md b/src/tutorials/server/index.md similarity index 100% rename from src/_tutorials/server/index.md rename to src/tutorials/server/index.md diff --git a/src/_tutorials/web/get-started.md b/src/tutorials/web/get-started.md similarity index 100% rename from src/_tutorials/web/get-started.md rename to src/tutorials/web/get-started.md diff --git a/src/_tutorials/web/index.md b/src/tutorials/web/index.md similarity index 100% rename from src/_tutorials/web/index.md rename to src/tutorials/web/index.md diff --git a/src/_tutorials/web/low-level-html/add-elements.md b/src/tutorials/web/low-level-html/add-elements.md similarity index 94% rename from src/_tutorials/web/low-level-html/add-elements.md rename to src/tutorials/web/low-level-html/add-elements.md index 96496a4468..af91f5487c 100644 --- a/src/_tutorials/web/low-level-html/add-elements.md +++ b/src/tutorials/web/low-level-html/add-elements.md @@ -160,7 +160,7 @@ DOM through the `Element` class. An `Element` object has a parent `Element` and maintains references to its children elements in a list. -An element with multiple child elements and a parent element An `Element` object has at most one parent `Element`. @@ -170,7 +170,7 @@ Get an `Element`'s parent with the getter `parent`. For example, if you have an `Element` with the name `anElement` you would refer to its parent element with `anElement.parent`. -Dart code reference to anElement's parent An `Element` object maintains references to its child elements in a list. @@ -197,13 +197,13 @@ The `List` class has various methods and operators whereby you can refer to each child element individually, iterate over the list, and add and remove elements. -Dart code references to anElement's list of children and individual child Elements You can change the tree structure by adding children to and removing children from an element's list of children. -Add a child element When you change an `Element` or its child elements in your Dart program, @@ -223,12 +223,12 @@ You could get the same results using Dart code, but it's usually better to define the primary page elements in HTML code (easier to read, quicker to load). -todo app and its corresponding HTML code The following diagram shows a partial DOM tree for the todo app. -The todo app and part of its DOM tree Of interest are the two-page elements that have IDs: @@ -244,7 +244,7 @@ whenever the user enters text into the input element. The following diagram shows the Dart code for the todo app. -todo app and its corresponding Dart code The top-level variables are initialized using @@ -282,14 +282,14 @@ The todo app defines a function, `addToDoItem()`, that can handle these change events. The following code connects `addToDoItem()` to the input field: -Add an event handler to the toDoInput element Rather than dissect this busy line of code, think of it as a Dart idiom for adding an event handler to an `Element` object. -Dart idiom: Add an event handler to an Element A change event is just one of many types of events @@ -330,7 +330,7 @@ The `addToDoItem()` function ignores the Event object passed to it. The change event handler has the following code: -The addToDoItem() function explained The final line of code is where the DOM gets changed. @@ -347,7 +347,7 @@ in the to do list. Let's take a look at the CSS file for this app. -The effect of CSS styles This code uses three different kinds of CSS selectors. @@ -492,7 +492,7 @@ The program adds each button to a DOM element—a simple `
` element identified by the CSS selector `letterpile`—with a call to `letterpile.children.add()`. -Dart code populates the letter pile with buttons Each button element in the letter pile @@ -509,7 +509,7 @@ Because an element can have only one parent, adding the button to a different parent automatically removes it from its previous parent. -The mouse click handler adds the button to the word, thus moving it The `+=` operator is a compound assignment operator, diff --git a/src/_tutorials/web/low-level-html/connect-dart-html.md b/src/tutorials/web/low-level-html/connect-dart-html.md similarity index 97% rename from src/_tutorials/web/low-level-html/connect-dart-html.md rename to src/tutorials/web/low-level-html/connect-dart-html.md index 45c41b755d..90e7d30ab6 100644 --- a/src/_tutorials/web/low-level-html/connect-dart-html.md +++ b/src/tutorials/web/low-level-html/connect-dart-html.md @@ -95,7 +95,7 @@ and displays the document in a window. The following diagram shows a simple HTML file and the resulting web browser page in Chrome. -A simple HTML file and its resulting web page HTML uses tags to describe the document. @@ -117,7 +117,7 @@ For example, the tree has page elements, text nodes, and attribute nodes. Here is the DOM tree for the simple HTML file above. -A Dart dynamically changing the DOM Notice that some tags, such as the `

` paragraph tag, @@ -136,7 +136,7 @@ by adding, deleting, and modifying the nodes in the DOM tree. When the DOM is changed, the browser immediately re-renders the window. -A Dart program can dynamically change the DOM The diagram shows a small Dart program that makes @@ -337,7 +337,7 @@ the node containing the string "RipVanWinkle paragraph." is a text node. -DOM tree for a paragraph element More complex text, @@ -387,7 +387,7 @@ In DartPad, the only visible connection between the Dart code and the HTML code is the `RipVanWinkle` ID. -The RipVanWinkle ID is used by both Dart and HTML To run your app outside DartPad, @@ -496,7 +496,7 @@ Let's look at the CSS code for the mini app. The CSS file for the mini app has one CSS rule in it. A CSS rule has two main parts: a selector and a set of declarations. -The parts of a CSS rule In the mini app, the selector `#RipVanWinkle` is an ID selector, @@ -518,7 +518,7 @@ for all matching elements. The style sheet is used to set the appearance of the matching element(s) on the web page. -A declaration specifies an attribute and its value The CSS rule for the `RipVanWinkle` paragraph diff --git a/src/_tutorials/web/low-level-html/index.md b/src/tutorials/web/low-level-html/index.md similarity index 100% rename from src/_tutorials/web/low-level-html/index.md rename to src/tutorials/web/low-level-html/index.md diff --git a/src/_tutorials/web/low-level-html/remove-elements.md b/src/tutorials/web/low-level-html/remove-elements.md similarity index 94% rename from src/_tutorials/web/low-level-html/remove-elements.md rename to src/tutorials/web/low-level-html/remove-elements.md index ed37abbf06..85162f6977 100644 --- a/src/_tutorials/web/low-level-html/remove-elements.md +++ b/src/tutorials/web/low-level-html/remove-elements.md @@ -174,7 +174,7 @@ using the element's `remove()` function is shorter and more concise than using functions from the `List` class. -Use element.remove() to remove an element from the DOM In the app, @@ -186,7 +186,7 @@ When the user clicks that new element, its event handler causes the element to remove itself from the DOM with `remove()`. -Registering an event handler to delete an item When the element removes itself from the DOM, @@ -198,7 +198,7 @@ and the item disappears from the to do list. When the user clicks the **Delete All** button, all elements are removed from the list. -Use element.children.clear() to remove all of an element's children In this case, using the `List` class's `clear()` function @@ -219,7 +219,7 @@ that implements the **Delete All** button. the handler removes all of the child elements from the to do list. Here is all the Dart code related to the **Delete All** button. - Remove all child elements from an Element ## About function expressions and => @@ -235,7 +235,7 @@ For more details, see the language tour's coverage of [functions](/language/functions). -A one-line function definition It is equivalent to writing this: diff --git a/tool/create_code_with_tooltips.dart b/tool/create_code_with_tooltips.dart index 59bb05aded..3be018d8bf 100644 --- a/tool/create_code_with_tooltips.dart +++ b/tool/create_code_with_tooltips.dart @@ -17,7 +17,7 @@ const sources = [ _SrcAndTipPaths( '$repoBase/examples/misc/bin/dcat/dcat.dart', '$repoBase/examples/misc/bin/dcat/dcat_tooltips.html', - '$repoBase/src/_tutorials/server/_dcat-example.html', + '$repoBase/src/tutorials/server/_dcat-example.html', ), ];