Skip to content

Commit

Permalink
Merge branch 'develop' into child-pages-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MCluck90 authored Nov 25, 2020
2 parents ded17fb + 1219ac0 commit 9ac3392
Show file tree
Hide file tree
Showing 69 changed files with 705 additions and 1,150 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- 🔗 Interpage hyperlinks
- 🎨 Integrated Theme
- 📑 Reflection Navigation Title Customization
- ✏️ Integrated spell-checking (coming soon...)

## Demo

Expand All @@ -29,4 +28,4 @@ See the [Quick Start](https://mipatterson.github.io/typedoc-plugin-pages/pages/G

## Supported Versions of TypeDoc

This plugin is designed to work with as many versions of TypeDoc as possible. It has been tested with the following versions `0.16.5` through `0.17.6`. If you are reporting an issue, please include the version of TypeDoc you are using the plugin with.
This plugin is designed to work with as many versions of TypeDoc as possible. It has been tested with the versions `0.16.5` through `0.19.2`. If you are reporting an issue, please include the version of TypeDoc you are using the plugin with.
12 changes: 9 additions & 3 deletions docs-source/getting-started/organization/child-pages.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
You can add pages as children of other pages. These will display as indented links under their parent page in the navigation sidebar. Child pages may **not** have their own children. However, they can have sub-groups. See {@page Sub-Groups} for more information.
Child pages can be used to nest pages as children under other pages.

To add a page as a child of another page, simply add the child page as an object in a "children" array property on the parent page's definition:
In the built-in plugin theme, these will display as indented links under their parent page in the navigation sidebar and will only display when the page, its parent page, or a sibling page is active.

Child pages may **not** have their own children.

## Creating Child Pages

To add a page as a child of another page, simply add the child page as an object in a `children` array property on the parent page's definition:

#### `typedoc.json`

Expand Down Expand Up @@ -29,4 +35,4 @@ To add a page as a child of another page, simply add the child page as an object
}
```

The "children" property is optional. Not specifying a "children" property on your page definition is the same as specifying the property as an empty array.
The `children` property is optional. Not specifying a `children` property on your page definition is the same as specifying the property as an empty array.
26 changes: 5 additions & 21 deletions docs-source/getting-started/organization/page-groups.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
## Overview

Page groups can be used to group collections of pages that are related to one another.

Each page group and its member pages will be displayed as a group of navigation items in the navigation sidebar.

## When to use page groups

Page groups should be used to group related pages in two scenarios:

### 1. Top-level page content

All top-level pages are organized into groups. You may have as few as one groups defined.

### 2. Page sections

To avoid overcrowding the navigation sidebar, groups can also be split up into sections. Page sections serve as a collection of page groups.

See {@page Page Sections} for more information.
Each page group and its member pages will be displayed as a group of navigation items in the navigation sidebar. Your plugin must specify at least one group, because all top-level pages must be in a group.

## Creating Groups
## Creating Page Groups

Follow these steps to create a page group:

Expand All @@ -33,12 +17,12 @@ Follow these steps to create a page group:

2. Add the group definition JSON to either:

- The top-level `groups` array
- The `groups` array of a page section
- The top-level `groups` array
- The `groups` array of a page section (See {@page Page Sections} for more information.)

## Group Options

In addition to the required `title` and `pages` properties, page groups definitions support two optional properties:
In addition to the required `title` and `pages` properties, page group definitions support two optional properties:

### 1. Output

Expand Down
100 changes: 100 additions & 0 deletions docs-source/getting-started/organization/page-sections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Sometimes you may have so many pages that the navigation sidebar feels cluttered, even when using child pages. Page sections can be used to simplify the navigation structure.

Page sections do not have a source file associated with them, but instead have their own nested groups. When the user clicks a page section link in the navigation sidebar, the groups that are nested under that section will be displayed in the sidebar and the previous groups will disappear. Additionally, a new link will be added to the top of the navigation sidebar allowing users to navigate back to the parent groups.

## Creating Page Sections

Follow these steps to create a page section:

1. Create a JSON definition for the section:

```json
{
"title": "My Group",
"groups": []
}
```

2. Add the section definition JSON to either:

- The `pages` array of a page group
- The `children` array of a parent page

## Section Options

In addition to the required `title` and `groups` properties, page section definitions support two optional properties:

### 1. Output

The optional `output` property supports configuring the name of the directory that pages and groups within the section are rendered to.

> 👉 For example, the following page definiton would be rendered to `outer-group/my-section/inner-group/my-page.html`:
```json
{
"groups": [
{
"title": "Outer Group",
"output": "outer-group",
"pages": [
{
"title": "My Section",
"output": "my-section",
"groups": [
{
"title": "Inner Group",
"output": "inner-group",
"pages": [
{
"title": "My Page",
"source": "my-page.md",
"output": "my-page.html"
}
]
}
]
}
]
}
]
}
```

If no `output` property is provided, the section's title will be used as the default value.

### 2. Source

The optional `source` property allows you to configure a default path prefix for the `source` property of each group within the section.

> 👉 For example, the following page would be read from `outer-group/my-section/inner-group/my-page.md`:
```json
{
"groups": [
{
"title": "Outer Group",
"source": "outer-group",
"pages": [
{
"title": "My Section",
"source": "my-section",
"groups": [
{
"title": "Inner Group",
"source": "inner-group",
"pages": [
{
"title": "My Page",
"source": "my-page.md",
}
]
}
]
}
]
}
]
}
```

By default, no source path prefix is applied when the `source` property is omitted.
6 changes: 3 additions & 3 deletions docs-source/getting-started/page-organization.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Organization Options

Your pages can be organized in several different ways. You can group pages in the following ways:
Your pages can be organized in several different ways:

1. [Page groups](#1-page-groups)
2. [Child pages](#2-child-pages)
Expand All @@ -10,13 +10,13 @@ Your pages can be organized in several different ways. You can group pages in th

Page groups can be used to group collections of pages that are related to one another.

Each page group and its member pages will be displayed as a group of navigation items in the navigation sidebar.
Pages in the same page group will be displayed together under the same group header in the navigation sidebar.

See {@page Page Groups} for more information.

### 2. Child pages

Pages can also be nested as children of other pages. This provides a way to breakup related content when there is too much content to group as different sections on a single page.
Pages can also be nested as children of other pages.

> 💡 Note that child pages cannot have children of their own.
Expand Down
3 changes: 0 additions & 3 deletions docs-source/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ To configure the plugin, create a `pagesconfig.json` file in the same directory
]
}
]
"theme": "pages-plugin"
}
```

Expand Down Expand Up @@ -87,5 +86,3 @@ Run TypeDoc to generate your documentation output:
```
$ typedoc
```

## Next Steps
3 changes: 0 additions & 3 deletions docs-source/introduction.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
⚠️ This plugin is still under active development and some options and functionality may change before the v1.0.0 release.

This plugin lets you integrate your own pages into the documentation output.

### Features
Expand All @@ -8,7 +6,6 @@ This plugin lets you integrate your own pages into the documentation output.
- 🔗 Page hyperlinks
- 📁 Customizable Page Organization
- 🎨 Built-in Theme
- ✏️ Integrated spell-checking (coming soon...)

### Getting Started

Expand Down
3 changes: 0 additions & 3 deletions docs-source/themes/custom-themes.md

This file was deleted.

Empty file.
48 changes: 48 additions & 0 deletions docs-source/themes/custom/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
It is possible to use the TypeDoc Pages Plugin with both third-party TypeDoc themes and your own custom themes. Both requires making some small modifications to the themes.

If you're using your own custom theme, it should be trivial to modify the theme source code. If you're using this plugin with a third-party TypeDoc theme, it is likely that you're consuming the theme via npm. In this scenario, it is recommended that you create a local copy of the theme and make the necessary modifications.

## How to modify a TypeDoc theme to support the Pages Plugin:

The following steps detail the modifications that need to be done to a theme to make it compatible with this plugin:

1. Add a Handlebars template for rendering your Markdown pages

Inside your theme's `templates` directory create a new Handlebars file, `markdown-page.hbs` with the following contents:

```handlebars
<div class="tsd-panel tsd-typography">
{{#markdown}}{{{model.pagesPlugin.item.contents}}}{{/markdown}}
</div>
```

This is the file that will be responsible for rendering your Markdown pages. You may modify this file to meet the needs of your theme.

2. Add custom styles for plugin components

By default, this plugin will add new items to your theme's existing navigation component. It is a good idea to style these items to best suit your theme. The following is a list of classes, for which you may want to add styling rules to your theme's CSS:

- `pp-nav`: Class added to all navigation items, including groups, pages, child pages, and sections
- `pp-group`: Class added to all group navigation items
- `pp-page`: Class added to all page navigation items
- `pp-parent`: Class added to all page navigation items that have child pages
- `pp-active`: Class added to parent page navigation items when the parent page or any of its child pages are the current page
- `pp-child`: Class added to all child page navigation items

Additionally, search results for pages added by this plugin will be given the `tsd-kind-page` class. You can customize the icon of these search results with the following styles:

```css
.tsd-kind-page .tsd-kind-icon:before {
display: inline-block;
vertical-align: middle;
height: 16px;
width: 16px;
content: "";
background-image: url("../images/page-icon.svg");
background-size: 16px 16px;
}
```

The above code sample will use the image located at `/assets/images/page-icon.svg` for the search result icon. You can find a sample icon image in the built-in theme, [here](https://github.com/mipatterson/typedoc-plugin-pages/blob/master/theme/v2/assets/images/page-icon.svg).

> NOTE: For styling examples, see the built-in theme's [stylesheet](https://github.com/mipatterson/typedoc-plugin-pages/blob/master/theme/v2/assets/css/pages.css).
2 changes: 1 addition & 1 deletion docs/assets/js/search.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions docs/classes/links.pagelinkparser.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L29">src/links/page-link-parser.ts:29</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L29">src/links/page-link-parser.ts:29</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -179,7 +179,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _current<wbr>Page<wbr>T
<div class="tsd-signature tsd-kind-icon">_current<wbr>Page<wbr>Title<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L27">src/links/page-link-parser.ts:27</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L27">src/links/page-link-parser.ts:27</a></li>
</ul>
</aside>
</section>
Expand All @@ -189,7 +189,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _current<wbr>Page<wbr>U
<div class="tsd-signature tsd-kind-icon">_current<wbr>Page<wbr>Url<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L28">src/links/page-link-parser.ts:28</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L28">src/links/page-link-parser.ts:28</a></li>
</ul>
</aside>
</section>
Expand All @@ -199,7 +199,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _invalide<wbr>Page<wbr>
<div class="tsd-signature tsd-kind-icon">_invalide<wbr>Page<wbr>Links<span class="tsd-signature-symbol">:</span> <a href="../interfaces/links.invalidpagelink.html" class="tsd-signature-type">InvalidPageLink</a><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L29">src/links/page-link-parser.ts:29</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L29">src/links/page-link-parser.ts:29</a></li>
</ul>
</aside>
</section>
Expand All @@ -209,7 +209,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _logger</h3>
<div class="tsd-signature tsd-kind-icon">_logger<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Logger</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L24">src/links/page-link-parser.ts:24</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L24">src/links/page-link-parser.ts:24</a></li>
</ul>
</aside>
</section>
Expand All @@ -219,7 +219,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _options</h3>
<div class="tsd-signature tsd-kind-icon">_options<span class="tsd-signature-symbol">:</span> <a href="../interfaces/options.pluginoptions-1.html" class="tsd-signature-type">PluginOptions</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L25">src/links/page-link-parser.ts:25</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L25">src/links/page-link-parser.ts:25</a></li>
</ul>
</aside>
</section>
Expand All @@ -229,7 +229,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _pages</h3>
<div class="tsd-signature tsd-kind-icon">_pages<span class="tsd-signature-symbol">:</span> <a href="pages.pagedictionary-1.html" class="tsd-signature-type">PageDictionary</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L26">src/links/page-link-parser.ts:26</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L26">src/links/page-link-parser.ts:26</a></li>
</ul>
</aside>
</section>
Expand All @@ -246,7 +246,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _get<wbr>Relative<wbr>U
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L148">src/links/page-link-parser.ts:148</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L148">src/links/page-link-parser.ts:148</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -284,7 +284,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _handle<wbr>Page<wbr>Li
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L100">src/links/page-link-parser.ts:100</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L100">src/links/page-link-parser.ts:100</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -344,7 +344,7 @@ <h3>list<wbr>Invalid<wbr>Page<wbr>Links</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L74">src/links/page-link-parser.ts:74</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L74">src/links/page-link-parser.ts:74</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -367,7 +367,7 @@ <h3>parse<wbr>Page<wbr>Links</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L59">src/links/page-link-parser.ts:59</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L59">src/links/page-link-parser.ts:59</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -399,7 +399,7 @@ <h3>set<wbr>Current<wbr>Page</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/cfd8937/src/links/page-link-parser.ts#L48">src/links/page-link-parser.ts:48</a></li>
<li>Defined in <a href="https://github.com/mipatterson/typedoc-plugin-pages/blob/8df5a61/src/links/page-link-parser.ts#L48">src/links/page-link-parser.ts:48</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
Loading

0 comments on commit 9ac3392

Please sign in to comment.