docusaurus-theme-plantuml
v1.0.2
Published
PlantUML components for Docusaurus. Renders PlantUML diagrams in markdown using a PlantUML server.
Maintainers
Readme
docusaurus-theme-plantuml
Theme for displaying PlantUML in docusaurus.
What is this?
en
- this is a theme for displaying plantuml diagrams on docusaurus.
- at first, I tried to make it as a plugin, but it did not work, so I made it as a theme
- the default setting is to display the results rendered by the plantuml server via https communication.
ja
- これはdocusaurusにplantumlの図を表示するためのテーマです
- 最初、pluginとして作ろうとしましたがうまくいかなかったのでテーマとして作っています
- デフォルト設定ではhttps通信でplantuml serverにレンダリングさせた結果を表示します
image
- light mode
- dark mode
Precautions before use
en
- The default rendering destination is the official PlantUML server.
- Even though it is official, rendering is done via http, so if you handle confidential information, please set up your own server, etc., and use at your own risk.
- see below
- plantuml.com/en/faq - https://plantuml.com/en/faq
- How long do the images generated by PlantUML Server live for?
- plantuml.com/en/faq - https://plantuml.com/en/faq
ja
- デフォルトのレンダリング先はPlantUML公式のサーバーです。
- 公式とはいえ、httpを介してレンダリングしているので、機密情報を扱う場合には自分でサーバーを立てるなどして、自己責任のうえ活用してください。
- 以下を参照
- plantuml.com/ja/faq - https://plantuml.com/ja/faq
- PlantUML Serverで生成した画像はいつまで保持されますか?
- plantuml.com/ja/faq - https://plantuml.com/ja/faq
How to Use?
install
pnpm add docusaurus-theme-plantumlor
npm install plugin-docusaurus-plantumlor
yarn add plugin-docusaurus-plantumlHow to set up on docusaurus
docusaurus.config.js
module.exports = {
// ...other settings
themes: [
require.resolve('docusaurus-theme-plantuml'),
]
};Example of description in markdown
## plantuml example
```pumld
@startuml
Alice -> Bob: Hello
@enduml
```
or
```plantuml-diagram
@startuml
start
:Hello world;
:This is defined on
several **lines**;
stop
@enduml
```en
- We also take into account the case where you want to display PlantUML code as markdown and not “plantuml” to render it when
plantuml-diagrampumld
ja
- markdownとしてPlantUMLのコードを表示したい場合も考慮して「plantuml」ではなく、以下の場合にレンダリングするようにしています。
plantuml-diagrampumld
Then build your Docusaurus project
pnpm run buildor
npm run buildor
yarn run buildOptions available
| Option | Type | Default | Description |
| ---------------- | --------- | ----------------------------------------- | ------------------------- |
| serverUrlLight | string | https://www.plantuml.com/plantuml/svg/ | Server URL for light mode |
| serverUrlDark | string | https://www.plantuml.com/plantuml/dsvg/ | Server URL for dark mode |
| debug | boolean | false | Turn on debug log output |
en
- by default, the official PlantUML server renders the image in SVG format
- docker is recommended if you want to prepare your own PlantUML server. specify its server URL as
serverUrlLightetc.- reference: dockerhub - https://hub.docker.com/r/plantuml/plantuml-server
- for example, if you want to render in PNG format, configure as follows
ja
- デフォルトはPlantUML公式のサーバーでSVG形式にレンダリングしています
- 自分でPlantUMLサーバーを用意するのであればdockerがオススメです。そのサーバーURLを
serverUrlLightなどに指定してください- 参考: dockerhub - https://hub.docker.com/r/plantuml/plantuml-server
- 例えばPNG形式でレンダリングしたければ以下のように設定します
module.exports = {
// ...other settings
themeConfig: [
plantuml: {
serverUrlLight: 'https://www.plantuml.com/plantuml/png/',
serverUrlDark: 'https://www.plantuml.com/plantuml/dpng/',
},
],
};- Note that the destination is
themeConfig, notthemes. - 設定先が
themesではなく、themeConfigであることに注意してください
Compatibility
en
- This theme is compatible with Docusaurus v3.9.2 and later versions
- Tested with Node.js 18.x and later
- Package manager: pnpm (recommended), npm, or yarn
ja
- このテーマはDocusaurus v3.9.2以降のバージョンに対応しています
- Node.js 18.x以降でテスト済み
- パッケージマネージャー: pnpm(推奨)、npm、またはyarn
Troubleshooting
npm configuration warnings
en
- If you encounter warnings like "Unknown env config" when running pnpm commands, check your
.npmrcfiles - Common deprecated settings that cause warnings:
verify-deps-before-run- This setting is deprecated and should be removed_jsr-registry- This setting is no longer supported
- Solution:
- Check for
.npmrcfiles in both project root and user home directory (~/.npmrc) - Remove or comment out deprecated settings
- Run
pnpm run formatagain to verify warnings are resolved
- Check for
ja
- pnpmコマンド実行時に「Unknown env config」のような警告が表示される場合、
.npmrcファイルを確認してください - 警告の原因となる一般的な非推奨設定:
verify-deps-before-run- この設定は非推奨のため削除してください_jsr-registry- この設定はサポートされなくなりました
- 解決方法:
- プロジェクトルートとユーザーホームディレクトリ(
~/.npmrc)の両方で.npmrcファイルを確認 - 非推奨設定を削除またはコメントアウト
pnpm run formatを再実行して警告が解消されたことを確認
- プロジェクトルートとユーザーホームディレクトリ(
Biome configuration issues
en
- If formatting or linting fails, verify your
biome.jsoncconfiguration file - Common issues:
- Invalid JSON syntax in configuration file
- Missing or incorrect formatter settings
- Incompatible rule configurations
- Solution:
- Validate JSON syntax using a JSON validator
- Check Biome documentation for correct configuration format
- Run
pnpm run lintto identify specific configuration problems
ja
- フォーマットやリントが失敗する場合、
biome.jsonc設定ファイルを確認してください - よくある問題:
- 設定ファイルの無効なJSON構文
- フォーマッター設定の欠落または誤り
- 互換性のないルール設定
- 解決方法:
- JSONバリデーターを使用して構文を検証
- Biomeドキュメントで正しい設定フォーマットを確認
pnpm run lintを実行して具体的な設定問題を特定
Build or test failures
en
- If build or test commands fail after updating dependencies:
- Clear node_modules and reinstall:
rm -rf node_modules && pnpm install - Clear build cache:
rm -rf lib && pnpm run build - Verify TypeScript configuration is compatible with updated dependencies
- Check for breaking changes in dependency changelogs
- Clear node_modules and reinstall:
- For persistent issues, check the issues page or create a new issue
ja
- 依存関係更新後にビルドやテストコマンドが失敗する場合:
- node_modulesをクリアして再インストール:
rm -rf node_modules && pnpm install - ビルドキャッシュをクリア:
rm -rf lib && pnpm run build - TypeScript設定が更新された依存関係と互換性があることを確認
- 依存関係の変更履歴で破壊的変更を確認
- node_modulesをクリアして再インストール:
- 問題が解決しない場合は、issuesページを確認するか、新しいissueを作成してください
Changelog
Checkout the releases page for changelog.


