Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Enable API doc generation for Dart - quickfix #1593

Closed
1 of 7 tasks
chalin opened this issue Jun 3, 2016 · 2 comments
Closed
1 of 7 tasks

Enable API doc generation for Dart - quickfix #1593

chalin opened this issue Jun 3, 2016 · 2 comments

Comments

@chalin
Copy link
Contributor

chalin commented Jun 3, 2016

This issue tracks progress in generating Dart API docs using the current angular.io tool chain. This approach has the advantage of being quick to get up and running, but its main disadvantage (at the moment) is that it is generated from the TS sources.

@kwalrath's task list from #1589

  • Make sure the issue search uses the right labels ('api' & 'dart')
  • Add known issues to the database.
  • Add text to each page linking to known issues.
  • Either
    • add Dart examples everywhere or
    • change the text to NOT imply that we have them everywhere.
  • Make sure the output is useful (which maybe it will be once Dart examples are everywhere?). I didn't realize that all the generated entries in the docs are directly from TS, not from generated Dart.
  • Be more specific in the caveat about how TypeScripty the docs are. Perhaps create a page telling people how to figure out what the API actually is? E.g., how do you find out all the args to bootstrap()? Array -> List, string -> String, boolean -> bool etc.
  • Consider pointing people to both the angular.io and dartdocs.org docs? E.g. https://www.dartdocs.org/documentation/angular2/latest/angular2.common/Control-class.html seems to have correct type info except in methods, which lack types (it also shows lots of inherited properties); https://angular.io/docs/dart/latest/api/common/index/Control-class.html is much shorter and/but has little useful information except the text.
@chalin
Copy link
Contributor Author

chalin commented Jun 3, 2016

Once #1589, is in place, here is what we will be able to do:

  • Generate the same API entries that exist on the TS side
  • Each API page corresponds to a generated .jade file.

The Jade source files are setup much like the prose, and so we have access to language-specific "macros"; e.g. making the following change in angular/common/src/pipes/async_pipe.ts

- * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
+ * The `async` pipe subscribes to !{_an} `!{_Observable}` or `!{_Promise}` and returns the latest value it has

renders as before on the TS side and on the Dart side we get

The async pipe subscribes to a Stream or Future and

With no other change to the API source, we also get @example entries like this:

{@example core/pipes/ts/async_pipe/async_pipe_example.ts region='AsyncPipePromise'}

correctly picking up Dart samples. (This is because such directives become makeExample entries which have been adapted to reinterpret paths based on the page language.)

So the main question to ask users if whether such an incremental improvement over having no API pages at all, would be useful enough.

As a next step I could work on getting proper Dart API signatures.

@chalin chalin changed the title Enable API doc generation for Dart Enable API doc generation for Dart - quickfix Jul 13, 2016
@chalin
Copy link
Contributor Author

chalin commented Jul 14, 2016

Superseded by #1880.

@chalin chalin closed this as completed Jul 14, 2016
chalin added a commit to chalin/angular.io that referenced this issue Jul 14, 2016
Fixes angular#1880.
Supersedes angular#1593.
### Task breakdown

**Package dependencies:**
- [ ] [**BLOCKING**] Update to new [harp](https://github.com/sintaxi/harp) package which depends on latest [terraform](https://github.com/sintaxi/terraform) release. This is needed so that dots (`.`) can be supported in site URIs; something that is essential for Dart given that library names contain dots. See sintaxi/harp#526 (/cc @sintaxi).<br>Blocked awaiting the new release.

**Gulp tasks / build scripts:**
- [x] New tasks to run `pub` and `dartdoc` over (existing) `angular-dart` repo, peer to ng.io repo.
- [x] `build-api-docs` should also do Dart API docs.
- [x] Shredder should run over Dart sources and generate example fragments.
- [x] Create script to patch local `terraform` package, while we await new harp release, as a means of **unblocking**.

**Generator package:**
- [x] New `tools/dart-api-builder`; stand alone tool re-using part of the basis of a Dart API dgeni package.

**Harp/Jade site infrastructure:**
- [x] New `public/docs/_layout-dart-api.jade`.
- [x] Updates to other Harp/Jade template files.

**API List directive:**
- [x] Create new or update existing `<api-list>` directive:
  - [x] Display only filter categories that are relevant to Dart.

**Site data and Jade file generation:**
- [x] Main API page
  - [x] Generate `api-list.json`.
  - [x] Add warning that API is preliminary and that code might still appear as TS.
- [x] Generate data (`_data.json`) and Jade files for
  - [x] For each library (i.e., top-level folder).
    - [x] `_data.json`
    - [x] Library "index" Jade page.
    - [x] Each member Jade page.
  - [x] For library subfolders (e.g., containing class member details).
    - [x] `_data.json`
    - [x] Folder "index" page (it actually has the same name as the container -- e.g., class name).
    - [x] Each member page.
- [x] API Jade file page contents:
  - [x] Attributes like name and type
  - [x] Breadcrumbs
  - [ ] Page header section tabs.
  - [x] Core page content excerpt from dartdoc-generated page
    - [x] Exclude the "left" nav menu (full ng2 package content list) from the core page content.
  - [x] `{@example ...}` tags are replaced by their designated example code fragments.
- [x] Filter generated API pages (configurable via regExp in build file): exclude entries from
  - [x] Non-public, developer/internal libraries.
  - [x] Top-level catch all `angular2` library -- otherwise every entry appears twice.
- [x] Support developer & production modes for data (JSON) file generation
  - [x] Developer mode (pretty-printed).
  - [x] [NOT implemented] ~~Production mode (compact).~~

Note about the API subsite design:
- I had to resort to using Jade extends/includes; hence disabling Harp _layout/partials.

cc: @naomiblack @kwalrath @ferhatb @keertip
chalin added a commit to chalin/angular.io that referenced this issue Jul 14, 2016
Fixes angular#1880.
Supersedes angular#1593.
### Task breakdown

**Package dependencies:**
- [ ] [**BLOCKING**] Update to new [harp](https://github.com/sintaxi/harp) package which depends on latest [terraform](https://github.com/sintaxi/terraform) release. This is needed so that dots (`.`) can be supported in site URIs; something that is essential for Dart given that library names contain dots. See sintaxi/harp#526 (/cc @sintaxi).<br>Blocked awaiting the new release.

**Gulp tasks / build scripts:**
- [x] New tasks to run `pub` and `dartdoc` over (existing) `angular-dart` repo, peer to ng.io repo.
- [x] `build-api-docs` should also do Dart API docs.
- [x] Shredder should run over Dart sources and generate example fragments.
- [x] Create script to patch local `terraform` package, while we await new harp release, as a means of **unblocking**.

**Generator package:**
- [x] New `tools/dart-api-builder`; stand alone tool re-using part of the basis of a Dart API dgeni package.

**Harp/Jade site infrastructure:**
- [x] New `public/docs/_layout-dart-api.jade`.
- [x] Updates to other Harp/Jade template files.

**API List directive:**
- [x] Create new or update existing `<api-list>` directive:
  - [x] Display only filter categories that are relevant to Dart.

**Site data and Jade file generation:**
- [x] Main API page
  - [x] Generate `api-list.json`.
  - [x] Add warning that API is preliminary and that code might still appear as TS.
- [x] Generate data (`_data.json`) and Jade files for
  - [x] For each library (i.e., top-level folder).
    - [x] `_data.json`
    - [x] Library "index" Jade page.
    - [x] Each member Jade page.
  - [x] For library subfolders (e.g., containing class member details).
    - [x] `_data.json`
    - [x] Folder "index" page (it actually has the same name as the container -- e.g., class name).
    - [x] Each member page.
- [x] API Jade file page contents:
  - [x] Attributes like name and type
  - [x] Breadcrumbs
  - [ ] Page header section tabs.
  - [x] Core page content excerpt from dartdoc-generated page
    - [x] Exclude the "left" nav menu (full ng2 package content list) from the core page content.
  - [x] `{@example ...}` tags are replaced by their designated example code fragments.
- [x] Filter generated API pages (configurable via regExp in build file): exclude entries from
  - [x] Non-public, developer/internal libraries.
  - [x] Top-level catch all `angular2` library -- otherwise every entry appears twice.
- [x] Support developer & production modes for data (JSON) file generation
  - [x] Developer mode (pretty-printed).
  - [x] [NOT implemented] ~~Production mode (compact).~~

Note about the API subsite design:
- I had to resort to using Jade extends/includes; hence disabling Harp _layout/partials.

cc: @naomiblack @kwalrath @ferhatb @keertip
chalin added a commit to chalin/angular.io that referenced this issue Jul 15, 2016
Fixes angular#1880.
Supersedes angular#1593.
### Task breakdown

**Package dependencies:**
- [ ] [**BLOCKING**] Update to new [harp](https://github.com/sintaxi/harp) package which depends on latest [terraform](https://github.com/sintaxi/terraform) release. This is needed so that dots (`.`) can be supported in site URIs; something that is essential for Dart given that library names contain dots. See sintaxi/harp#526 (/cc @sintaxi).<br>Blocked awaiting the new release.

**Gulp tasks / build scripts:**
- [x] New tasks to run `pub` and `dartdoc` over (existing) `angular-dart` repo, peer to ng.io repo.
- [x] `build-api-docs` should also do Dart API docs.
- [x] Shredder should run over Dart sources and generate example fragments.
- [x] Create script to patch local `terraform` package, while we await new harp release, as a means of **unblocking**.

**Generator package:**
- [x] New `tools/dart-api-builder`; stand alone tool re-using part of the basis of a Dart API dgeni package.

**Harp/Jade site infrastructure:**
- [x] New `public/docs/_layout-dart-api.jade`.
- [x] Updates to other Harp/Jade template files.

**API List directive:**
- [x] Create new or update existing `<api-list>` directive:
  - [x] Display only filter categories that are relevant to Dart.

**Site data and Jade file generation:**
- [x] Main API page
  - [x] Generate `api-list.json`.
  - [x] Add warning that API is preliminary and that code might still appear as TS.
- [x] Generate data (`_data.json`) and Jade files for
  - [x] For each library (i.e., top-level folder).
    - [x] `_data.json`
    - [x] Library "index" Jade page.
    - [x] Each member Jade page.
  - [x] For library subfolders (e.g., containing class member details).
    - [x] `_data.json`
    - [x] Folder "index" page (it actually has the same name as the container -- e.g., class name).
    - [x] Each member page.
- [x] API Jade file page contents:
  - [x] Attributes like name and type
  - [x] Breadcrumbs
  - [ ] Page header section tabs.
  - [x] Core page content excerpt from dartdoc-generated page
    - [x] Exclude the "left" nav menu (full ng2 package content list) from the core page content.
  - [x] `{@example ...}` tags are replaced by their designated example code fragments.
- [x] Filter generated API pages (configurable via regExp in build file): exclude entries from
  - [x] Non-public, developer/internal libraries.
  - [x] Top-level catch all `angular2` library -- otherwise every entry appears twice.
- [x] Support developer & production modes for data (JSON) file generation
  - [x] Developer mode (pretty-printed).
  - [x] [NOT implemented] ~~Production mode (compact).~~

Note about the API subsite design:
- I had to resort to using Jade extends/includes; hence disabling Harp _layout/partials.

cc: @naomiblack @kwalrath @ferhatb @keertip
chalin added a commit to chalin/angular.io that referenced this issue Jul 15, 2016
Fixes angular#1880.
Supersedes angular#1593.
### Task breakdown

**Package dependencies:**
- [ ] [**BLOCKING**] Update to new [harp](https://github.com/sintaxi/harp) package which depends on latest [terraform](https://github.com/sintaxi/terraform) release. This is needed so that dots (`.`) can be supported in site URIs; something that is essential for Dart given that library names contain dots. See sintaxi/harp#526 (/cc @sintaxi).<br>Blocked awaiting the new release.

**Gulp tasks / build scripts:**
- [x] New tasks to run `pub` and `dartdoc` over (existing) `angular-dart` repo, peer to ng.io repo.
- [x] `build-api-docs` should also do Dart API docs.
- [x] Shredder should run over Dart sources and generate example fragments.
- [x] Create script to patch local `terraform` package, while we await new harp release, as a means of **unblocking**.

**Generator package:**
- [x] New `tools/dart-api-builder`; stand alone tool re-using part of the basis of a Dart API dgeni package.

**Harp/Jade site infrastructure:**
- [x] New `public/docs/_layout-dart-api.jade`.
- [x] Updates to other Harp/Jade template files.

**API List directive:**
- [x] Create new or update existing `<api-list>` directive:
  - [x] Display only filter categories that are relevant to Dart.

**Site data and Jade file generation:**
- [x] Main API page
  - [x] Generate `api-list.json`.
  - [x] Add warning that API is preliminary and that code might still appear as TS.
- [x] Generate data (`_data.json`) and Jade files for
  - [x] For each library (i.e., top-level folder).
    - [x] `_data.json`
    - [x] Library "index" Jade page.
    - [x] Each member Jade page.
  - [x] For library subfolders (e.g., containing class member details).
    - [x] `_data.json`
    - [x] Folder "index" page (it actually has the same name as the container -- e.g., class name).
    - [x] Each member page.
- [x] API Jade file page contents:
  - [x] Attributes like name and type
  - [x] Breadcrumbs
  - [ ] Page header section tabs.
  - [x] Core page content excerpt from dartdoc-generated page
    - [x] Exclude the "left" nav menu (full ng2 package content list) from the core page content.
  - [x] `{@example ...}` tags are replaced by their designated example code fragments.
- [x] Filter generated API pages (configurable via regExp in build file): exclude entries from
  - [x] Non-public, developer/internal libraries.
  - [x] Top-level catch all `angular2` library -- otherwise every entry appears twice.
- [x] Support developer & production modes for data (JSON) file generation
  - [x] Developer mode (pretty-printed).
  - [x] [NOT implemented] ~~Production mode (compact).~~

Note about the API subsite design:
- I had to resort to using Jade extends/includes; hence disabling Harp _layout/partials.

cc: @naomiblack @kwalrath @ferhatb @keertip
chalin added a commit to chalin/angular.io that referenced this issue Jul 15, 2016
Fixes angular#1880.
Supersedes angular#1593.
### Task breakdown

**Package dependencies:**
- [ ] [**BLOCKING**] Update to new [harp](https://github.com/sintaxi/harp) package which depends on latest [terraform](https://github.com/sintaxi/terraform) release. This is needed so that dots (`.`) can be supported in site URIs; something that is essential for Dart given that library names contain dots. See sintaxi/harp#526 (/cc @sintaxi).<br>Blocked awaiting the new release.

**Gulp tasks / build scripts:**
- [x] New tasks to run `pub` and `dartdoc` over (existing) `angular-dart` repo, peer to ng.io repo.
- [x] `build-api-docs` should also do Dart API docs.
- [x] Shredder should run over Dart sources and generate example fragments.
- [x] Create script to patch local `terraform` package, while we await new harp release, as a means of **unblocking**.

**Generator package:**
- [x] New `tools/dart-api-builder`; stand alone tool re-using part of the basis of a Dart API dgeni package.

**Harp/Jade site infrastructure:**
- [x] New `public/docs/_layout-dart-api.jade`.
- [x] Updates to other Harp/Jade template files.

**API List directive:**
- [x] Create new or update existing `<api-list>` directive:
  - [x] Display only filter categories that are relevant to Dart.

**Site data and Jade file generation:**
- [x] Main API page
  - [x] Generate `api-list.json`.
  - [x] Add warning that API is preliminary and that code might still appear as TS.
- [x] Generate data (`_data.json`) and Jade files for
  - [x] For each library (i.e., top-level folder).
    - [x] `_data.json`
    - [x] Library "index" Jade page.
    - [x] Each member Jade page.
  - [x] For library subfolders (e.g., containing class member details).
    - [x] `_data.json`
    - [x] Folder "index" page (it actually has the same name as the container -- e.g., class name).
    - [x] Each member page.
- [x] API Jade file page contents:
  - [x] Attributes like name and type
  - [x] Breadcrumbs
  - [ ] Page header section tabs.
  - [x] Core page content excerpt from dartdoc-generated page
    - [x] Exclude the "left" nav menu (full ng2 package content list) from the core page content.
  - [x] `{@example ...}` tags are replaced by their designated example code fragments.
- [x] Filter generated API pages (configurable via regExp in build file): exclude entries from
  - [x] Non-public, developer/internal libraries.
  - [x] Top-level catch all `angular2` library -- otherwise every entry appears twice.
- [x] Support developer & production modes for data (JSON) file generation
  - [x] Developer mode (pretty-printed).
  - [x] [NOT implemented] ~~Production mode (compact).~~

Note about the API subsite design:
- I had to resort to using Jade extends/includes; hence disabling Harp _layout/partials.

cc: @naomiblack @kwalrath @ferhatb @keertip
chalin added a commit to chalin/angular.io that referenced this issue Jul 15, 2016
Fixes angular#1880.
Supersedes angular#1593.
### Task breakdown

**Package dependencies:**
- [ ] [**BLOCKING**] Update to new [harp](https://github.com/sintaxi/harp) package which depends on latest [terraform](https://github.com/sintaxi/terraform) release. This is needed so that dots (`.`) can be supported in site URIs; something that is essential for Dart given that library names contain dots. See sintaxi/harp#526 (/cc @sintaxi).<br>Blocked awaiting the new release.

**Gulp tasks / build scripts:**
- [x] New tasks to run `pub` and `dartdoc` over (existing) `angular-dart` repo, peer to ng.io repo.
- [x] `build-api-docs` should also do Dart API docs.
- [x] Shredder should run over Dart sources and generate example fragments.
- [x] Create script to patch local `terraform` package, while we await new harp release, as a means of **unblocking**.

**Generator package:**
- [x] New `tools/dart-api-builder`; stand alone tool re-using part of the basis of a Dart API dgeni package.

**Harp/Jade site infrastructure:**
- [x] New `public/docs/_layout-dart-api.jade`.
- [x] Updates to other Harp/Jade template files.

**API List directive:**
- [x] Create new or update existing `<api-list>` directive:
  - [x] Display only filter categories that are relevant to Dart.

**Site data and Jade file generation:**
- [x] Main API page
  - [x] Generate `api-list.json`.
  - [x] Add warning that API is preliminary and that code might still appear as TS.
- [x] Generate data (`_data.json`) and Jade files for
  - [x] For each library (i.e., top-level folder).
    - [x] `_data.json`
    - [x] Library "index" Jade page.
    - [x] Each member Jade page.
  - [x] For library subfolders (e.g., containing class member details).
    - [x] `_data.json`
    - [x] Folder "index" page (it actually has the same name as the container -- e.g., class name).
    - [x] Each member page.
- [x] API Jade file page contents:
  - [x] Attributes like name and type
  - [x] Breadcrumbs
  - [ ] Page header section tabs.
  - [x] Core page content excerpt from dartdoc-generated page
    - [x] Exclude the "left" nav menu (full ng2 package content list) from the core page content.
  - [x] `{@example ...}` tags are replaced by their designated example code fragments.
- [x] Filter generated API pages (configurable via regExp in build file): exclude entries from
  - [x] Non-public, developer/internal libraries.
  - [x] Top-level catch all `angular2` library -- otherwise every entry appears twice.
- [x] Support developer & production modes for data (JSON) file generation
  - [x] Developer mode (pretty-printed).
  - [x] [NOT implemented] ~~Production mode (compact).~~

Note about the API subsite design:
- I had to resort to using Jade extends/includes; hence disabling Harp _layout/partials.

cc: @naomiblack @kwalrath @ferhatb @keertip
kwalrath pushed a commit that referenced this issue Jul 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants