Commit graph

30 commits

Author SHA1 Message Date
Matthieu Riegler
f9886e1e28 refactor(docs-infra): remove dart support & mentions (#49857)
There is no need to keep the support for Dart here.

PR Close #49857
2023-04-17 14:00:49 +00:00
Derek Cormier
50dee93f35 build(bazel): add aio targets to ci
This is a first pass. There is more work to do on package.json, adding
more test targets under bazel, and revising documentation.
2022-11-22 13:51:16 -07:00
Derek Cormier
07126ae40f build(bazel): fix race conditions in windows aio build
Disables the rules_nodejs linker and adds a custom esm module resolver
2022-11-22 13:51:16 -07:00
Derek Cormier
7c8ca113c1 build(bazel): replace ignore example feature with bazel equivalent
Comment out the entry in the EXAMPLES map to ignore an example.
2022-11-22 13:51:16 -07:00
Derek Cormier
8678550a94 build(bazel): create targets for aio docs tests
This replaces the docs-test npm script
2022-11-22 13:51:16 -07:00
Tobias Speicher
4ddcf81e61 refactor: replace deprecated String.prototype.substr() (#45397)
.substr() is deprecated so we replace it with functions which work similarily but aren't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

PR Close #45397
2022-03-24 11:48:09 -07:00
dario-piotrowicz
0ae4187566 refactor(docs-infra): remove eslint directive comments from examples (#43831)
Linting has recently been removed from the examples provided in angular.io
(see PRs #43592 and #43746) such removal effects the downloadable and
stackblitz examples but linting is still generally used in the examples
in the aio project itself (they are being migrated from tslint to eslint in
PR #43218) thus eslint directive comments are still necessary in the code itself.

So the comments need to be present but need not to be exposed to the users
(not in the zips, stackblitzes nor docs themselves), these changes are
removing such comments during the examples' parsing phase (effectively
removing them from all three sources mentioned above).

Original discussion: https://github.com/angular/angular/pull/43218#discussion_r697305494

resolves #43788

PR Close #43831
2021-11-09 18:02:33 +00:00
Alan Agius
36388b3ab2 build(docs-infra): configure region parser to allow .mjs (#44027)
This commit updates the necessary config settings to allow `.mjs` files to be able to be parsed by the region parser. We configure the parser to use `inline-c-only` so that comments are generated in like the below

```
// #docregion
```

rather than

```
/* #docregion */
```

PR Close #44027
2021-11-04 18:55:52 +00:00
Pete Bacon Darwin
758ba0f0f9 build(docs-infra): indent docplaster markers to the level of the docregion (#43216)
This change makes docplaster markers fit better with the surrounding code
that is being rendered.  Instead of:

```
{
  "a": 100,
// ...
  "b": 200,
// ...
}
```

you can now get

```
{
  "a": 100,
  // ...
  "b": 200,
  // ...
}
```

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
a73aaa9396 build(docs-infra): switch JSON examples to use inline docregion comments (#43216)
Now JSON files should be commented using

```
// #docregion
```

rather than

```
/* #docregion */
```

There are currently no JSON files with either kind of comments so this change
has no impact yet.

But when we add some examples with such comments, they will also benefit
from `// ... ` style docplasters to join docregion fragments.

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
ad04c1bc62 build(docs-infra): support docregions in .conf files (#43216)
This commit tells the docregion parser how to process files that end in `.conf`.

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
c77c8b7913 build(docs-infra): support docregions in .sh example files (#43216)
This commit tells the docregion parser how to process `.sh` files.

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
fb97e67fcb build(docs-infra): fail if there are unused example regions (#40479)
We can define regions in our examples that can be referenced
and rendered in guides as code snippets. It is quite hard to ensure
that these regions are maintained correctly. One reason for this is
it is hard to know whether a region is being used or not.

This commit adds a new processor that checks for unused named
regions in examples and fails if any are found.

Fixes #19761

PR Close #40479
2021-01-20 16:12:15 -08:00
George Kalpakas
d7ca263cc4 test(docs-infra): run tests in random order (and make them pass) (#31527)
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 #31527
2019-07-18 10:17:13 -07:00
George Kalpakas
261dc04d8e fix(docs-infra): detect docregions on more file types (pug, svg, yml) (#30559)
PR Close #30559
2019-06-27 15:56:26 -07:00
George Kalpakas
d9d226087c build(docs-infra): allow "" as empty region in {@example} tags (#26514)
PR Close #26514
2018-10-18 09:54:17 -07:00
George Kalpakas
7bad1d356d build(docs-infra): only render code example content in one place (#26514)
PR Close #26514
2018-10-18 09:54:17 -07:00
George Kalpakas
0add00a743 build(docs-infra): throw error if using title on code snippets (#26514)
Since #26396, the `title` property is ignored and `header` should be
used instead for specifying a code snippet's header.

This commit ensures that we don't accidentally set `title` have it be
silently ignored.

PR Close #26514
2018-10-18 09:54:17 -07:00
William Marques
fc6dad40ac fix(docs-infra): rename "title" by "header" to avoid unwanted tooltips (#26396)
Closes #26174

PR Close #26396
2018-10-17 11:05:29 -07:00
Pete Bacon Darwin
94707fe795 build(aio): initialise exampleMap correctly (#22502)
The `exampleMap` needs to hold an hash object for each
of the `collectExamples.exampleFolders` paths.

Previously these hash objects were only created if there
was actually an example file the hash's respective
example folder.  This could cause crashes during
`yarn docs-watch` (and so also `yarn sync-and-serve`)
if no examples were read in for a particular run of
the doc-gen.

PR Close #22502
2018-03-01 08:10:15 -08:00
Jesus Rodriguez
1a75934cc0 build(aio): migrate plunker to stackblitz (#20165)
PR Close #20165
2018-01-23 21:30:27 -08:00
Peter Bacon Darwin
3a03ff6b2d build(aio): allow render-examples to complete even if examples are broken
By setting `renderExamples.ignoreBrokenExamples = true` the doc-gen will
not fail if there is something wrong with an example. Instead it will
just log a warning.
2017-11-02 15:00:22 -07:00
Peter Bacon Darwin
0355142737 build(aio): fail doc-gen if a code-example is badly formatted.
This will catch the problem that was missed in
https://github.com/angular/angular/pull/19845#issuecomment-338626662
2017-11-02 14:58:38 -07:00
Peter Bacon Darwin
381e680758 build(aio): improve error message for ignored example files (#19265)
Addresses https://github.com/angular/angular/pull/18707#issuecomment-330396771

PR Close #19265
2017-09-20 12:36:14 -07:00
Peter Bacon Darwin
988b9f8378 build(aio): remove commented out code (#19265)
PR Close #19265
2017-09-20 12:36:14 -07:00
Peter Bacon Darwin
99b666614d build(aio): abort doc-gen if an example is missing
Closes #16936
2017-07-18 11:45:05 +01:00
Peter Bacon Darwin
6d9da73090 build(aio): move attribute utils to helpers folder
This allows these utility functions to be reused across packages.
2017-05-01 15:52:51 -07:00
Peter Bacon Darwin
24b9067047 build(aio): remove unused {@exampleTabs} inline tag 2017-04-30 09:07:28 -07:00
Ward Bell
7b94f493b9 feat(aio): code snippet source available & shown when code missing
Tells reader (usually the author) what code file is missing
Also when no linenums specified, turn them on if num of lines > 10
2017-04-28 11:07:45 +01:00
Peter Bacon Darwin
abecf3eb6d build(aio): move the transforms folder into the tools folder 2017-04-16 22:05:23 +01:00