@ng-doc/keywords-loaders 22.0.0-beta.2 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +20 -29
  2. package/index.cjs.js +6 -2
  3. package/package.json +21 -20
package/README.md CHANGED
@@ -1,37 +1,28 @@
1
- <!-- PROJECT LOGO -->
2
- <br />
3
- <div align="center">
4
- <a href="https://github.com/ng-doc/ng-doc">
5
- <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px">
6
- </a>
7
-
8
- <h1 align="center" style="margin-bottom: 0; border-bottom: 0">NgDoc</h1>
9
- <p align="center">
10
- Create user-friendly documentation for your projects with ease!
11
- <br />
12
- <a href="https://ng-doc.com/">Documentation</a>
13
- ·
14
- <a href="https://github.com/ng-doc/ng-doc/issues/new/choose">Report Bug</a>
15
- ·
16
- <a href="https://github.com/ng-doc/ng-doc/issues/new/choose">Request Feature</a>
17
-
18
- [![GitHub Workflow Status][build-shield]][build-url]
1
+ # 🔗 @ng-doc/keywords-loaders
2
+
3
+ Loaders that let keywords link to the Angular and RxJS docs or to another NgDoc site.
4
+
5
+ It's part of [NgDoc](https://ng-doc.com/) 📚, the documentation engine for Angular projects.
6
+
19
7
  [![NPM][npm-shield]][npm-url]
20
8
  [![MIT License][license-shield]][license-url]
21
9
 
22
- </p>
23
- </div>
10
+ ## 🚀 Getting started
11
+
12
+ You don't need to install this package by hand. Add NgDoc to your project and it sets up
13
+ everything it needs:
24
14
 
25
- <!-- ABOUT THE PROJECT -->
15
+ ```bash
16
+ ng add @ng-doc/add
17
+ ```
26
18
 
27
- ## About The Project
19
+ ## 📖 Learn more
28
20
 
29
- This library is a part of NgDoc project, that uses to create documentation
30
- for Angular projects, please check our [repo](https://github.com/ng-doc/ng-doc) for more details.
21
+ - [Documentation](https://ng-doc.com/)
22
+ - [GitHub repository](https://github.com/ng-doc/ng-doc)
23
+ - [Report a bug or request a feature](https://github.com/ng-doc/ng-doc/issues/new/choose)
31
24
 
32
- [npm-shield]: https://img.shields.io/npm/v/@ng-doc/builder.svg?style=for-the-badge
33
- [npm-url]: https://www.npmjs.com/package/@ng-doc/builder
25
+ [npm-shield]: https://img.shields.io/npm/v/%40ng-doc%2Fkeywords-loaders.svg?style=for-the-badge
26
+ [npm-url]: https://www.npmjs.com/package/@ng-doc/keywords-loaders
34
27
  [license-shield]: https://img.shields.io/github/license/ng-doc/ng-doc.svg?style=for-the-badge
35
- [license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt
36
- [build-shield]: https://img.shields.io/github/actions/workflow/status/ng-doc/ng-doc/release.yml?style=for-the-badge&branch=release
37
- [build-url]: https://github.com/ng-doc/ng-doc/actions
28
+ [license-url]: https://github.com/ng-doc/ng-doc/blob/main/LICENSE
package/index.cjs.js CHANGED
@@ -105,7 +105,11 @@ function ngDocKeywordsLoader(options) {
105
105
  } = keywords[key];
106
106
  const url = `${endpoint}${path}`;
107
107
  const isGuideKeyword = key.startsWith('*');
108
- if (isGuideKeyword && options.loadGuides) {
108
+ // Page keywords (and their anchors) start with an asterisk; they are loaded only on request.
109
+ if (isGuideKeyword && !options.loadGuides) {
110
+ return acc;
111
+ }
112
+ if (isGuideKeyword) {
109
113
  const prefix = options.guidesPrefix ?? '';
110
114
  const newKey = `*${prefix}${key.replace(/^\*/, '')}`;
111
115
  acc[newKey] = {
@@ -159,7 +163,7 @@ function rxjsPageToKeyword(page, version) {
159
163
  return [page.title, {
160
164
  title: page.title,
161
165
  url: getApiUrl(page.path, version),
162
- description: `External link the RxJS documentation.`
166
+ description: `External link to the RxJS documentation.`
163
167
  }];
164
168
  }
165
169
 
package/package.json CHANGED
@@ -1,20 +1,7 @@
1
1
  {
2
2
  "name": "@ng-doc/keywords-loaders",
3
- "version": "22.0.0-beta.2",
4
- "type": "commonjs",
5
- "dependencies": {
6
- "@ng-doc/core": "22.0.0-beta.2",
7
- "node-fetch": "2.6.11"
8
- },
9
- "publishConfig": {
10
- "access": "public"
11
- },
12
- "exports": {
13
- "./package.json": "./package.json",
14
- ".": "./index.cjs.js"
15
- },
16
- "main": "./index.cjs.js",
17
- "types": "./index.d.ts",
3
+ "version": "22.0.0",
4
+ "description": "Keyword loaders that link NgDoc pages to Angular, RxJS and other NgDoc sites.",
18
5
  "keywords": [
19
6
  "angular",
20
7
  "documentation",
@@ -25,14 +12,28 @@
25
12
  "demo",
26
13
  "ng-doc"
27
14
  ],
28
- "author": "Skoropad Aleksandr <alex@skoropad.dev>",
15
+ "homepage": "https://ng-doc.com",
16
+ "bugs": {
17
+ "url": "https://github.com/ng-doc/ng-doc/issues"
18
+ },
29
19
  "repository": {
30
20
  "type": "git",
31
21
  "url": "git+https://github.com/ng-doc/ng-doc.git"
32
22
  },
33
- "bugs": {
34
- "url": "https://github.com/ng-doc/ng-doc/issues"
23
+ "license": "MIT",
24
+ "type": "commonjs",
25
+ "dependencies": {
26
+ "@ng-doc/core": "22.0.0",
27
+ "node-fetch": "2.6.11"
35
28
  },
36
- "homepage": "https://ng-doc.com",
37
- "license": "MIT"
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "exports": {
33
+ "./package.json": "./package.json",
34
+ ".": "./index.cjs.js"
35
+ },
36
+ "main": "./index.cjs.js",
37
+ "types": "./index.d.ts",
38
+ "author": "Skoropad Aleksandr <alex@skoropad.dev>"
38
39
  }