Skip to content

Commit

Permalink
config to default to docs pages as default
Browse files Browse the repository at this point in the history
  • Loading branch information
kalisjoshua committed Jan 14, 2025
1 parent 954aa9c commit 3b4207c
Show file tree
Hide file tree
Showing 18 changed files with 143 additions and 386 deletions.
2 changes: 1 addition & 1 deletion .ls-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ ignore:
- '**/documentation'
- '**/node_modules'
- 'apps/docs/.docusaurus'
- 'apps/docs/docs/typedoc'
- 'apps/docs/content/api'
75 changes: 26 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,46 @@
<br />
![Hypergiant an Accelint company](assets/banner.jpg)

<p align="center">
<img src="assets/banner.jpg" />
</p>
# Development Toolkit (DevTK)

<h1 align="center">Accelint Standard Toolkit</h1>

<p align="center">The web "standard library" for the <a href="https://accelint.com">Accelint</a> family of systems.</p>

<br />

> [!IMPORTANT]
> Standard Toolkit is currently only intended for usage within the Accelint family of systems.<br />
> Contributions are more than welcome but please consider that this project may not fit your needs.<br />
> Please read the [contributing guidelines](CONTRIBUTING.md) and the [roadmap](#roadmap-link) of our Technical Steering Committee (TSC).
<br />
A "standard library" for web applications in the [Accelint] family of systems.

## 📦 Libraries

Libraries are exposed via individual packages. Refer to each package documentation for available utilities.

| Documentation | Package |
| ---------------------------------------------------------|---------------------------- |
| [Constants](./packages/constants/documentation) | `@accelint/constants` |
| [Converters](./packages/converters/documentation) | `@accelint/converters` |
| [Design System](./packages/design-system/documentation) | `@accelint/design-system` |
| [Formatters](./packages/formatters/documentation) | `@accelint/formatters` |
| [Geo](./packages/geo/documentation) | `@accelint/geo` |
| [Math](./packages/math/documentation) | `@accelint/math` |
| [Predicates](./packages/predicates/documentation) | `@accelint/predicates` |
| [Predicates](./packages/temporal/documentation) | `@accelint/temporal` |
| [Web Worker](./packages/web-worker/documentation) | `@accelint/web-worker` |
| [Websocket](./packages/websocket/documentation) | `@accelint/websocket` |
Libraries are exposed via individual packages. Refer to the [documentation site][docs] for detailed information.

## 💡 Contributing

Read the [contributing](CONTRIBUTING.md) guidelines file if you are interested in contributing.

We also export configurations for common tooling in our applications.
## ✨ Versioning

| Package |
| ----------------------------- |
| `@accelint/biome-config` |
| `@accelint/eslint-config` |
| `@accelint/prettier-config` |
| `@accelint/typescript-config` |
| `@accelint/vitest-config` |
DevTK follows [Semver](https://semver.org/) for versioning of packages to enable consumers to trust what is changing between versions.

## 💡 Contributing
Given a version number MAJOR.MINOR.PATCH, the meanings of each number changing follows these guidelines:

Read the [contributing guidelines](CONTRIBUTING.md) file if you are interested in contributing.
- __MAJOR__
- Any "breaking" changes; something used to work one way - and therefor consumers might be using a package in that way and thus relying on that functionality - and in the next available version that something now works in a different way
- __MINOR__
- Additional changes; adding functionality, enhancing/extending (without changing) existing functionality
- __PATCH__
- Fixing problems; making something work that should have worked but don't
- Adding documentation to better explain what is available
- Improved testing to make the expectations more explicit and automatically tested

## 🔍 License

Published under the [Apache License v2.0](https://www.apache.org/licenses/LICENSE-2.0) license. Read the [license instructions](LICENSE) if you are interested in contributing or using the Standard Toolkit.
Licensed under [Apache] License v2.0. Read the [license instructions](LICENSE) if you are interested in contributing or using any of the packages.

## 🚀 Attributions

The Standard Toolkit project is sponsored by:

<a href="https://accelint.com" target="_blank"><img src="assets/accelint.png" height="48" /></a>
<a href="https://hypergiant.com" target="_blank"><img src="assets/hypergiant.png" height="48" /></a>
Development Toolkit (DevTK) is sponsored by: [Hypergiant] (GitHub [@gohypergiant][go]) an [Accelint] company.

---
## 🔔 Disclaimer

> [Accelint](https://accelint.com) &nbsp;&middot;&nbsp;
> [Hypergiant](https://hypergiant.com) &nbsp;&middot;&nbsp;
> GitHub [@Gohypergiant](https://github.com/gohypergiant) &nbsp;&middot;&nbsp;
Standard Toolkit is currently only intended for usage within the Accelint family of systems. Contributions are more than welcome but please consider that this project may not fit your needs.

[Accelint]: https://accelint.com
[Apache]: https://www.apache.org/licenses/LICENSE-2.0
[docs]: https://gohypergiant.github.io/standard-toolkit
[go]: https://github.com/gohypergiant
[Hypergiant]: https://hypergiant.com
4 changes: 3 additions & 1 deletion apps/docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
# Generated files
.docusaurus
.cache-loader
docs/typedoc
content/api
content/CONTRIBUTING.md
content/LICENSE.md

# Misc
.DS_Store
Expand Down
15 changes: 11 additions & 4 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Accelint - Standard Toolkit - Documentation Website
# Development Toolkit - Documentation Website

This documentation website is built using [Docusaurus](https://docusaurus.io/) and [typedoc](https://typedoc.org/)

Expand Down Expand Up @@ -37,12 +37,12 @@ See all of the markdown features in docusaurus [here](https://docusaurus.io/docs

### JSDoc parsing via typedoc

We use [typedoc](https://typedoc.org/) to generate documentation from comments and markdown documents within our packages. Those generated docs live in the `/docs/typedoc` directory.
We use [typedoc](https://typedoc.org/) to generate documentation from comments and markdown documents within our packages. Those generated docs live in the `/content/api` directory.

the [autogenerated](https://docusaurus.io/docs/sidebar/autogenerated) docusaurus feature makes integrating the typedoc output into the site very straightforward.

> [!WARNING]
> Do not modify content in `/docs/typedoc` directly. To rerun typedoc, run the following command:
> Do not modify content in `/content/api` directly. To rerun typedoc, run the following command:
>
> ```
> pnpm run build:typedoc
Expand All @@ -55,7 +55,14 @@ For now, we are using the [@easyops-cn/docusaurus-search-local](https://github.c
> [!NOTE]
> Local search does not work in dev mode. the search index is created at build time. to test search locally, you can run the `build` script followed by the `serve` script
## Potential Future Features
## Potential Future Features
- [i18n](https://docusaurus.io/docs/i18n/introduction)
- [blog](https://docusaurus.io/docs/blog)
# Notes
- There are three Docusaurus groupings that can house content: pages (can NOT have a sidebar), docs, and blog. We will primarily use docs as our content organization grouping strategy in Docusaurus.
- Pages (src/pages)
- Highest priority for resolution it seems because with a default page in `content/README.md`
- Docs (`docs/` renamed to `content/`)
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 14 additions & 8 deletions apps/docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import rehypeKatex from 'rehype-katex';
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

const config: Config = {
title: 'Accelint Standard Toolkit (DevTK)',
tagline: 'The web "standard library" for the Accelint family of systems.',
title: 'Development Toolkit (DevTK)',
tagline:
'A "standard library" for web applications in the Accelint family of systems.',
favicon: 'img/favicon.ico',

url: 'https://gohypergiant.github.io',
Expand All @@ -30,9 +31,11 @@ const config: Config = {
organizationName: 'gohypergiant',
projectName: 'standard-toolkit',

onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
onBrokenAnchors: 'warn', // for now
// TODO: change "ignore" to "warn" or "error" when the site is more complete.
// "ignore" for now to make the output during build less noisy.
onBrokenLinks: 'ignore',
onBrokenMarkdownLinks: 'ignore',
onBrokenAnchors: 'ignore',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
Expand All @@ -47,9 +50,12 @@ const config: Config = {
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
remarkPlugins: [remarkMath],
breadcrumbs: false,
path: './content',
rehypePlugins: [rehypeKatex],
remarkPlugins: [remarkMath],
routeBasePath: '/',
sidebarPath: './sidebars.ts',
// Add this to enable the "edit this page" links.
// editUrl: 'https://github.com/facebook/docusaurus/tree/main/docs/',
},
Expand All @@ -64,7 +70,7 @@ const config: Config = {
themeConfig: {
image: 'img/banner.jpg',
navbar: {
title: 'Accelint Standard Toolkit (DevTK)',
title: 'Development Toolkit (DevTK)',
items: [
{
type: 'docSidebar',
Expand Down
57 changes: 57 additions & 0 deletions apps/docs/lib/typedoc-plugin-hypergiant.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

import { MarkdownPageEvent } from 'typedoc-plugin-markdown';

// some files output by TypeDoc are not in the correct location for Docusaurus
// to link them correctly; moving the files is handled by the npm script
function fixLink(page, from, to) {
if (page.contents.includes(from)) {
page.contents = page.contents.replace(from, to);
}
}

/**
* TypeDoc plugin that customizes the behavior of TypeDoc for our purposes.
* There may be more than one customization in this file and there may be
* additional plugin files for TypeDoc depending on the complexity of the
* needed customization.
*
* @param {import('typedoc').Application} app
*
* @remarks
* pure: no; event handlers are registered on the app
* idempotent: yes
*/
export function load(app) {
app.renderer.off(MarkdownPageEvent.END, renderMarkdown);
app.renderer.on(MarkdownPageEvent.END, renderMarkdown);
}

/**
* @param {import('typedoc').PageEvent<Reflection>} page
*
* @remarks
* pure: no; mutates page.contents
* idempotent: no; will add the slug to the page.contents each time it is called
*/
function renderMarkdown(page) {
if (page.url === 'README.md') {
// the slug is used by Docusaurus to determine the URL of the page
// in combination with `routeBasePath: '/'` in docusaurus.config.js
// makes the README the index - landing page - page of the site
page.contents = `---\nslug: /\n---\n\n${page.contents}`;
}

fixLink(page, '_media/CONTRIBUTING.md', 'CONTRIBUTING');
fixLink(page, '_media/LICENSE', 'LICENSE');
}
11 changes: 6 additions & 5 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@accelint/docs",
"version": "0.0.1",
"version": "0.1.0",
"private": true,
"scripts": {
"build:docusaurus": "docusaurus build",
"build:typedoc": "typedoc",
"build": "pnpm run build:typedoc && pnpm run build:docusaurus",
"build:docusaurus": "docusaurus build",
"build:contributing": "mv ./content/api/_media/CONTRIBUTING.md ./content/CONTRIBUTING.md",
"build:license": "mv ./content/api/_media/LICENSE ./content/LICENSE.md",
"build:typedoc": "typedoc && pnpm run build:contributing && pnpm run build:license",
"clear": "docusaurus clear",
"dev": "docusaurus start",
"docusaurus": "docusaurus",
"dev": "pnpm run build && docusaurus start",
"serve": "docusaurus serve"
},
"dependencies": {
Expand Down
26 changes: 21 additions & 5 deletions apps/docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

const TYPEDOC_OUTPUT_DIR = 'api';

/**
* Creating a sidebar enables you to:
- create an ordered group of docs
Expand All @@ -25,17 +27,31 @@ import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
Create as many sidebars as you want.
*/
const sidebars: SidebarsConfig = {
apiSidebar: [{ type: 'autogenerated', dirName: 'typedoc/@accelint' }],
demoSidebar: [
apiSidebar: [
{
id: `${TYPEDOC_OUTPUT_DIR}/README`,
label: 'DevTK',
type: 'doc',
},
{
collapsed: false,
label: 'Packages',
items: [
{ dirName: `${TYPEDOC_OUTPUT_DIR}/@accelint`, type: 'autogenerated' },
],
type: 'category',
label: 'group 1',
items: [{ type: 'autogenerated', dirName: 'packages' }],
},
],
demoSidebar: [
{
items: [{ type: 'autogenerated', dirName: 'packages' }],
label: 'group 1',
type: 'category',
label: 'group 2',
},
{
items: [{ type: 'autogenerated', dirName: 'config' }],
label: 'group 2',
type: 'category',
},
],
};
Expand Down
32 changes: 0 additions & 32 deletions apps/docs/src/pages/CONTRIBUTING.md

This file was deleted.

Loading

0 comments on commit 3b4207c

Please sign in to comment.