Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject css and html element via JSX and plugin #122

Merged
merged 11 commits into from Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yaml
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: 🔨 Build Docs
run: |
nix develop --show-trace --command bash -c "npm i && npm run build && npm run docs"
nix develop --show-trace --command bash -c "npm i && npm run build && npm --prefix ./doc/theme/ run build && npm run docs"

- name: 📘 Upload artifact
uses: actions/upload-pages-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yaml
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: 🏥 Check docs generation
run: |
nix develop --show-trace --command bash -c "npm run docs"
nix develop --show-trace --command bash -c "npm --prefix ./doc/theme/ run build && npm run docs"
- name: 📝 Check formatting
run: |
nix develop --show-trace --command bash -c "treefmt --fail-on-change"
3 changes: 3 additions & 0 deletions changelog.d/20240105_164037_hrajchert_plt_8836.md
@@ -0,0 +1,3 @@
### General

- Changed documentation theme
Binary file added doc/image/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions doc/image/github.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions doc/image/logo-header.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions doc/theme/.editorconfig
@@ -0,0 +1,11 @@
# https://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
22 changes: 22 additions & 0 deletions doc/theme/.gitignore
@@ -0,0 +1,22 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Compiled output
dist

# Dependency directories
node_modules/

# Output of 'npm pack'
*.tgz

# Output of running `yarn typedoc src` on this repo
docs
17 changes: 17 additions & 0 deletions doc/theme/README.md
@@ -0,0 +1,17 @@
## Marlowe Typedoc Theme

Theme for typedoc is done through a plugin that expands upon the default theme and allows JSX hooks/overrides to modify DOM.

Configurations for running this can be found in the root `package.json` file where `npm run docs` will run typedoc with configurations found in `typedoc.json`.

Typedoc's [example demo theme](https://github.com/Gerrit0/typedoc-custom-theme-demo) shows how various hooks are called within `index.tsx`. This entrypoint also contains a sync script for processing files in `/assets`.

Elements that are replaced from the default theme can be found under `/templates`. Additional templates can be added for more granular control (See toolbar as an example).

To build the theme:

```
npm run build
```

This creates a `/dist` directory which is configured by `typedoc.json` as the plugin. Continue to build the docs `npm run docs` from the directory root, then preview any changes locally with `npm run serve`.