Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

chore: base setup for use of API doc code-excerpt updating tools #1395

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions angular/lib/src/common/directives/ng_if.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,33 @@ import 'package:angular/src/core/linker/app_view_utils.dart';
///
/// ### Examples
///
/// <?code-excerpt "docs/template-syntax/lib/app_component.html (NgIf-1)"?>
/// <?code-excerpt "examples/hacker_news_pwa/lib/src/item_detail_component.html"?>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This illustrates use of code from examples/hacker_news_pwa.

/// ```html
/// <hero-detail *ngIf="isActive"></hero-detail>
/// <!-- Loading view -->
/// <div *ngIf="item == null" class="notice">Loading...</div>
///
/// <!-- Loaded view -->
/// <template [ngIf]="item != null">
/// <item [item]="item"></item>
/// <div *ngIf="item['comments'].isEmpty">There are no comments yet.</div>
/// <comment
/// *ngFor="let comment of item['comments']"
/// [comment]="comment">
/// </comment>
/// </template>
/// ```
///
/// <?code-excerpt "packages/template_syntax/app_component.html (NgIf-1)"?>
/// ```html
/// <my-hero *ngIf="isActive"></my-hero>
/// ```
///
/// <?code-excerpt "docs/structural-directives/lib/app_component.html (asterisk)"?>
/// <?code-excerpt "packages/structural_directives/app_component.html (asterisk)"?>
/// ```html
/// <div *ngIf="hero != null" >{{hero.name}}</div>
/// ```
///
/// <?code-excerpt "docs/structural-directives/lib/app_component.html (ngif-template)"?>
/// <?code-excerpt "packages/structural_directives/app_component.html (ngif-template)"?>
/// ```html
/// <template [ngIf]="hero != null">
/// <div>{{hero.name}}</div>
Expand Down
4 changes: 2 additions & 2 deletions angular_forms/lib/src/directives/ng_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ import 'shared.dart' show setUpControl;
///
/// ### Examples
///
/// <?code-excerpt "docs/template-syntax/lib/app_component.html (NgModel-1)"?>
/// <?code-excerpt "packages/template_syntax/app_component.html (NgModel-1)"?>
/// ```html
/// <input [(ngModel)]="currentHero.name">
/// ```
///
/// This is equivalent to having separate bindings:
///
/// <?code-excerpt "docs/template-syntax/lib/app_component.html (NgModel-3)"?>
/// <?code-excerpt "packages/template_syntax/app_component.html (NgModel-3)"?>
/// ```html
/// <input
/// [ngModel]="currentHero.name"
Expand Down
11 changes: 11 additions & 0 deletions build.excerpt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
targets:
$default:
sources:
include:
- examples/**
exclude:
- '**/.*/**'
- '**/build/**'
builders:
code_excerpter|code_excerpter:
enabled: true
19 changes: 19 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,24 @@
name: repository

dev_dependencies:
build_runner: any
code_excerpter:
git: https://github.com/chalin/code_excerpter.git
code_excerpt_updater:
git: https://github.com/chalin/code_excerpt_updater.git
dev:
path: dev

# Source of some of the code examples
structural_directives:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List site-webdev external apps here.

git:
url: https://github.com/dart-lang/site-webdev.git
path: examples/ng/doc/structural-directives
template_syntax:
git:
url: https://github.com/dart-lang/site-webdev.git
path: examples/ng/doc/template-syntax
pipes:
git:
url: https://github.com/dart-lang/site-webdev.git
path: examples/ng/api/common/pipes