Skip to content

Commit 5894156

Browse files
committed
chore(docs): add typedoc-generated API reference docs
1 parent c8da3a3 commit 5894156

File tree

15 files changed

+2823
-2386
lines changed

15 files changed

+2823
-2386
lines changed

.github/workflows/docs.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: API Reference Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: 'API Reference Documentation'
15+
cancel-in-progress: true
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout Code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js 22.x
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: 22.x
31+
cache: 'npm'
32+
33+
- name: Install Node Dependencies
34+
run: npm ci
35+
36+
- name: Build API Reference Documentation
37+
run: npm run build:docs
38+
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v5
41+
42+
- name: Upload Artifacts
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: './docs/dist'
46+
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ node_modules
33
bin/act
44
fortawesome-react-fontawesome-*.tgz
55
dist/
6+
docs/dist/
67
coverage/
78
.env

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/dist
2+
/docs/dist
23
/coverage
34
CHANGELOG.md

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 22.21.1
1+
nodejs 22.22.1

.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"editor.codeActionsOnSave": {
66
"source.fixAll.eslint": "explicit"
77
},
8-
"javascript.format.enable": false, // formatting is handled by prettier
9-
"javascript.validate.enable": false, // validation is handled by typescript and eslint
10-
"typescript.tsdk": "node_modules/typescript/lib", // ensure VSCode uses the local TypeScript version
8+
"js/ts.format.enabled": false, // formatting is handled by prettier
9+
"js/ts.validate.enabled": false, // validation is handled by typescript and eslint
10+
"js/ts.tsdk.path": "node_modules/typescript/lib", // ensure VSCode uses the local TypeScript version
1111
// Language-specific Overrides
1212
"[javascript]": {
1313
"editor.defaultFormatter": "esbenp.prettier-vscode"

docs/src/API-Reference-Readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Overview <i color="#428fdc" class="fa-solid fa-font-awesome" aria-label="FontAwesome"></i>
2+
3+
This documentation serves purely as an API Reference for the modules contained in the latest version of the `react-fontawesome` library.
4+
5+
It uses [TypeDoc](https://typedoc.org/) to generate documentation from the library's source code and code comments, giving us an overview of all the modules, interfaces, variables and functions available in this library, as well as descriptions of each prop available on the React component, what those props do, and examples of how to use them.
6+
7+
It is assumed if you are reading this API Reference that you're already familiar with the concepts and usage of FontAwesome and React.
8+
9+
For more detailed documentation on how to use FontAwesome with React in general, or how to use the `react-fontawesome` library, see here:
10+
11+
- [FontAwesome Documentation - Use With React](https://docs.fontawesome.com/web/use-with/react)
12+
- [react-fontawesome on GitHub](https://github.com/FortAwesome/react-fontawesome)
13+
14+
## How to use this reference
15+
16+
In the side-bar menu, the top level items are the two key module entry points that are exported by the library:
17+
18+
- `index` - includes anything exported via the main entry point
19+
- e.g. `import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'`
20+
- `components/rsc/CustomPrefixProvider` - special module for using custom FA prefixes with server-side rendering
21+
- e.g. `import { CustomPrefixProvider } from '@fortawesome/react-fontawesome/components/rsc/CustomPrefixProvider'`
22+
- `<internal>` - refers to types and interfaces that are used internally within the package but are not exported by the package to consumers

docs/src/assets/favicon.ico

6.37 KB
Binary file not shown.

eslint.config.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ import globals from 'globals'
1111
import tseslint from 'typescript-eslint'
1212

1313
const config = tseslint.config(
14-
{ ignores: ['**/dist/**', '**/node_modules/**', '**/coverage/**'] },
14+
{
15+
ignores: [
16+
'**/dist/**',
17+
'**/node_modules/**',
18+
'**/coverage/**',
19+
'**/examples/**',
20+
'**/docs/dist/**',
21+
],
22+
},
1523
{
1624
files: ['**/*.ts', '**/*.tsx'],
1725
extends: [

0 commit comments

Comments
 (0)