65 Commits

Author SHA1 Message Date
Sonu Kapoor
46ff673192 fixup!: build(docs-infra): Ensures that only member docs are linked ()
PR Close 
2020-04-17 12:33:55 -04:00
Sonu Kapoor
7842f73e8b fixup!: build(docs-infra): add _ to ignored ignoreGenericWords ()
PR Close 
2020-04-17 12:33:55 -04:00
Sonu Kapoor
e5f9e3d018 build(docs-infra): add _ to ignored ignoreGenericWords ()
Previously, when a document included `_`, the autoLinker will try to
generate a link, e.g from `core/ɵComponentDef._`. This commit adds it
to the ignored words to prevent that.

PR Close 
2020-04-17 12:33:55 -04:00
Sonu Kapoor
aebd5f9af6 build(docs-infra): Ensures that only member docs are linked ()
This commit ensures that `member` docs are only linked if the linking
text contains `.`.

PR Close 
2020-04-17 12:33:55 -04:00
Sonu Kapoor
4fb034aeec build(docs-infra): fix autoLinkCode to ignore docs without a path ()
Previously, the auto linker generated links without an `href` when the
API was private. This commit fixes this by making sure that the `path`
of the document is not empty.

Closes 

PR Close 
2020-04-17 12:33:55 -04:00
Sonu Kapoor
7ca2a2a863 feat(docs-infra): add searchKeywords preprocessor ()
This commit adds a new preprocessor to use `${@searchKeywords}`, allowing
the docs to use a list of custom search phrases that will be
prioritized over the keywords found in the content.

Closes 

PR Close 
2020-02-27 10:47:52 -08:00
Judy Bogart
549ab2ecc3 build(docs-infra): add words to ignore in snippets ()
PR Close 
2020-01-27 10:49:03 -08:00
Kapunahele Wong
a3b2d6735a build(docs-infra): add auto-link-filter for generic words ()
Fixes 

PR Close 
2020-01-21 15:08:01 -05:00
Pete Bacon Darwin
06bca0cc66 fix(docs-infra): do not auto-link code in bash and json snippets ()
Previously any code block, which was not marked with
`no-auto-link` css class would have its contents auto-linked to
API pages. Sometimes this results in false positive links being
generated.

This is problematic for triple backticked blocks, which cannot provide
the `no-auto-link` CSS class to prevent the linking.

This commit fixes the problem by allowing the auto-linker to be
configured not to auto-link code blocks that have been marked with an
"ignored" language. By default these are `bash` and `json`.

Triple backticked blocks are able to specify the language directly after
the first set of triple backticks.

Fixes 

PR Close 
2019-11-18 09:11:01 -08:00
Pete Bacon Darwin
526537fefe style(docs-infra): reformat the auto-link-code files ()
PR Close 
2019-11-18 09:11:01 -08:00
George Kalpakas
d7ca263cc4 test(docs-infra): run tests in random order (and make them pass) ()
This commit updates the necessary config files to run the angular.io and
docs tooling unit tests in random order (and fixes the tests that were
failing due to their dependence on the previous ordered execution).

Besides being a good idea anyway, running tests in random order is the
new [default behavior in jasmine@3.0.0][1], so this commit is in
preparation of upgrading jasmine to the latest version.

[1]: https://github.com/jasmine/jasmine/blob/v3.0.0/release_notes/3.0.md#breaking-changes

PR Close 
2019-07-18 10:17:13 -07:00
Pete Bacon Darwin
1db3ac457c build(docs-infra): update dgeni-packages dependency ()
The new version 0.27.5 now has the `post-process-html` package, so we
don't need it in angular/angular any more.

PR Close 
2019-07-02 11:28:23 -07:00
George Kalpakas
c34abf2cbc refactor(docs-infra): move auto-link filters to dedicated directory ()
These filters have generic names (e.g. `filterPipes`), which do not make
their purpose obvious. Moving them to a dedicated `auto-link-filters`
directory should help with that.

PR Close 
2019-06-19 14:59:34 -07:00
George Kalpakas
c6b180380a fix(docs-infra): do not auto-link http:// to the common/http ()
Previously, our auto-linking feature would match `http` in URLs (such as
`http://...`) to the `common/http` package and automatically create a
link to that, which was undesirable. While it is possible to work around
that via `<code class="no-auto-link">http://...</code>`, most people
didn't even realize the issue.

Since in this case it is possible to reliably know it is a false match,
this commit fixes it by applying a custom auto-link filter that ignores
all docs for `http`, if it comes before `://`.

Fixes 

PR Close 
2019-06-19 14:59:34 -07:00
George Kalpakas
8bbf481d60 refactor(docs-infra): rename properties (blacklisted --> ignored) ()
PR Close 
2019-04-08 09:46:34 -07:00
George Kalpakas
c5bba8d9f2 build(docs-infra): do not include announcements.json in sitemap ()
The `announcements.json` file should not be included in the sitemap and
including it causes an error in Google Search Console (because the
generated URL does not exist).

(This is a follow-up to fbef94a8e.)

PR Close 
2019-04-08 09:46:33 -07:00
Pete Bacon Darwin
a4f3f3f81d build(docs-infra): support doc aliases via @alias dgeni tag ()
Now, one can add an `@alias` tag to API docs, which tells dgeni that this
API element (usually a `const`) is really just an alias for some API element
defined elsewhere.

Dgeni will then look up this API element and copy over the properties from
the alias to the current doc.

For example, we would like to privately export an Enum from `@angular/core`
but then publicly export this from `@angular/common`:

**packages/core/private_exports.ts**

```ts
/**
 * Description of this document.
 */
export enum ɵSomeEnum { ... }
```

**packages/common/public_api.ts**

```ts
import {ɵSomeEnum} from '@angular/core';

 /**
 * @alias core/ɵSomeEnum
 */
export const SomeEnum = ɵSomeEnum;
```

In the generated docs there will be a page for `common/SomeEnum`, which
will be rendered as an enum, rather than a const, showing the description
extracted from the `core/ɵSomeEnum`.

---

The implementation of this feature required some refactoring of the other
processing:

1. Previously `ɵ` prefixed exports were not even considered.
2. Due to 1. some processors needed to have guards added to ignore such
   private exports (`addMetadataAliases` and `checkContentRules`).
3. The processing of package pages had to be reworked (and split) so that
   it picked up the aliased export docs after their alias proeprties had
   been copied.

See FW-1207, FW-632, 

PR Close 
2019-04-04 10:52:36 -07:00
Pete Bacon Darwin
9ff8155cd9 build(docs-infra): mark code blocks to disable auto-linking ()
You can now mark `<code>` blocks with a `no-auto-link` css class
to tell the code auto-linker to ignore this code block.

PR Close 
2018-10-26 18:09:20 -04:00
Pete Bacon Darwin
7c730fe5b3 build(docs-infra): include inherited members in search index ()
Closes 

PR Close 
2018-10-26 13:16:33 -04:00
Pete Bacon Darwin
f233131974 build(docs-infra): refactor generateKeywords processor ()
PR Close 
2018-10-26 13:16:32 -04:00
Pete Bacon Darwin
15dadb92ef build(docs-infra): include directives etc in class descendants lists ()
PR Close 
2018-10-01 09:36:33 -07:00
Pete Bacon Darwin
f22deb2e2d build(docs-infra): improve directive API doc templates ()
Closes 
Closes 

PR Close 
2018-10-01 09:36:32 -07:00
Pete Bacon Darwin
026b60cd70 build(docs-infra): expose deprecated status on items more clearly ()
PR Close 
2018-09-21 10:26:48 -07:00
Pete Bacon Darwin
96f9f03d25 build(docs-infra): improve search quality ()
PR Close 
2018-09-21 10:26:48 -07:00
Pete Bacon Darwin
9931bd7576 build(docs-infra): do not include license comment in first API doc ()
The default dgeni config is to concatenate leading comments in front of API items.

In the case that you have an API item that starts a file with no import statements,
the license comment at the top of the file was being added to the front of the
API item's comment. SInce the license comment includes the `@license` tag
and the API item's comment did not start with `@description` the content of
the API item's comment was being put inside the `@license` tag, and no
description was being extracted from the API item's comment.

This commit updates to a version of dgeni-packages that has a switch to turn off
this concatenation, and then also configures this switch.

Closes 

PR Close 
2018-09-21 10:25:41 -07:00
Pete Bacon Darwin
8a4c577917 build(aio): fix broken doc-gen unit test ()
PR Close 
2018-06-13 16:47:40 -07:00
Pete Bacon Darwin
293ec78069 build(aio): don't constrain checkContentRules to run before another processor ()
We don't really care when this processor runs as long as it happens
after the tags have been extracted.
By not constraining its `runBefore` property we can ensure that other
processors can be run before it.

PR Close 
2018-06-13 16:47:40 -07:00
Pete Bacon Darwin
131d0d8e8a build(aio): do not try to auto-link to internal API items ()
This would cause dangling links since the target, being internal,
would not exist in the docs.

PR Close 
2018-06-13 16:47:40 -07:00
Pete Bacon Darwin
700e55ce14 build(docs-infra): log warning rather than error if content errors are not fatal ()
PR Close 
2018-06-06 10:25:04 -07:00
Pete Bacon Darwin
02acb5e3e5 build(aio): improve enum API rendering ()
* The member details section is now called "Members", rather
than "Properties".
* The property table now displays appropriate table headings:
"Member", "Value", "Description".
* The "Value" column is not shown if none of the members have
a value.

Closes 

PR Close 
2018-05-14 10:37:42 -07:00
Pete Bacon Darwin
e0ae74d40e build(aio): add checkContentRules processor ()
This processor will enable us to write rules about
how the content should appear, such as:

* no headings in markdown content
* only one sentence per line
* no single character parameter names
* etc.

PR Close 
2018-04-12 00:06:49 -07:00
Pete Bacon Darwin
6f0dad1710 build(aio): render doc-gen issues in overview dump ()
Related to 

PR Close 
2018-03-14 10:20:30 -07:00
Pete Bacon Darwin
0e311e3918 build(aio): improve accuracy of code auto-linking ()
The new version of `dgeni-packages/typescript` no longer strips
out "namespaces" from types, which was part of the problem of
not autolinking correctly to `HttpEventType.Response`.

Another part of the problem was that we did not include `.`
characters when matching potential code blocks for auto-linking,
which precluded properties of enums from being linked.

Finally, members we not being given a `path` property, which is
needed to effectively autolink to them. This is now set in
the `simplifyMemberAnchors` processor.

Closes 

PR Close 
2018-03-01 08:11:19 -08:00
Pete Bacon Darwin
83b32a0a0a build(aio): render heading anchors on the right
This approach simplifies the styling needed considerably.
Previously, we had to make room on the left for heading that
are in visual containers. Also we had to apply a `float:right`
when on narrow screens as the gutter not available then.
This float didn't render nicely if the heading text was longer
than could be rendered on a single line.

Closes 
2018-02-27 18:32:32 -08:00
Pete Bacon Darwin
71ea931df5 build(aio): blacklist unwanted URLs from the generated sitemap.xml ()
Closes 

PR Close 
2018-02-07 12:02:01 -08:00
Pete Bacon Darwin
9a0700f5bd build(aio): add API static members to search index ()
Previously searching for `compose` did not include `Validators`
in the search results because we were not including all the
`static` members of API docs in the index.

PR Close 
2018-02-05 13:00:47 -08:00
Pete Bacon Darwin
a64af40c0b build(aio): generate sitemap from the generated pages ()
Closes 

PR Close 
2018-01-22 12:55:15 -08:00
Peter Bacon Darwin
e2b76bb386 build(aio): filter out ambiguous directives from auto code linking ()
Closes 

PR Close 
2017-11-21 22:28:16 -06:00
Peter Bacon Darwin
7c44637fbf build(aio): tighten up code autolinking ()
Do not match code "words" that are part of a hyphenated
string of characters: e.g. `platform-browser-dynamic` should
not auto-link `browser`.

Do not match code "words" that correspond to pipe names
but are not preceded by a pipe `|` character. E.g. `package.json` should
not auto link `json` to the `JsonPipe`.

Closes 

PR Close 
2017-11-16 16:20:03 -06:00
George Kalpakas
7e38f4fd1f fix(aio): fix window title on Home page ()
Using `display: none` on the `<h1>` causes `innerText` to not work as expected
and include the icon ligature (`link`) in the title. This caused the window
title on the angular.io Home page to appear as "Angular - link".
This commit fixes it by not generating anchors at all for headings with the
`no-anchor` class.

Fixes 

PR Close 
2017-11-15 18:25:58 -06:00
Peter Bacon Darwin
9ab1f4a9c9 style(aio): fix docs linting issues ()
These issues appeared after upgrade of eslint jasmine plugin

PR Close 
2017-11-01 15:24:46 -07:00
Peter Bacon Darwin
8b571309ed build(aio): append information about links in and out of docs ()
Closes 

PR Close 
2017-10-10 17:06:51 -07:00
Pete Bacon Darwin
97e02c2fa0 build(aio): render class/interface "descendants" in API docs ()
For classes, the tree of subclasses is rendered, recursively.

For interfaces, the descendants are separated into child interfaces, which
extend the interface, and classes, which implement the interface.

Closes 
2017-09-25 11:59:44 -07:00
Peter Bacon Darwin
9ab9437319 build(aio): auto-link more code items
We now parse all code blocks, after they have been rendered by dgeni
and insert links to API docs that match "words" in the code.
2017-09-12 13:58:43 -04:00
Peter Bacon Darwin
b8a3736275 build(aio): do not auto-link code elements already inside a link ()
Closes 

PR Close 
2017-08-18 17:13:16 -05:00
Georgios Kalpakas
cc2a4c41f9 build(aio): fix warning about missing <h1>
Fixes 
2017-07-31 13:40:07 -07:00
Peter Bacon Darwin
c453b7bcfa build(aio): fail doc-gen if referenced images are missing 2017-07-18 11:45:05 +01:00
Peter Bacon Darwin
f06ce9adc8 build(aio): truncate API overview parameters at one line 2017-07-13 12:16:20 -07:00
Peter Bacon Darwin
998049ec9b build(aio): truncate API overview parameters at one line 2017-07-13 12:16:20 -07:00
Peter Bacon Darwin
e8bbf86e66 build(aio): add terms from heading to the search index 2017-07-11 15:04:37 +01:00