koriym / app-state-diagram
应用程序图生成器
0.11.8
2024-06-15 18:54 UTC
Requires
- php: ^7.3 || ^8.0
- ext-dom: *
- ext-filter: *
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
- bamarni/composer-bin-plugin: ^1.4
- koriym/data-file: ^1.0
- michelf/php-markdown: ^1.9
- seld/jsonlint: ^1.8
Requires (Dev)
- phpunit/phpunit: ^9.6.10
- roave/security-advisories: dev-master
- dev-master
- 0.11.8
- 0.11.7
- 0.11.6
- 0.11.5
- 0.11.4
- 0.11.3
- 0.11.2
- 0.11.1
- 0.11.0
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.8
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-spike
- dev-asd-action
This package is auto-updated.
Last update: 2024-08-30 04:21:01 UTC
README
从 ALPS 文件生成完整的应用程序状态图和超链接文档。
该图是 SVG 格式的超媒体,其中应用程序状态和状态转换链接到相应的语义描述符文档 HTML。语义描述符文档 HTML 也相互链接,以表示 REST 应用的结构。
文档
输出演示
查看在线演示。
运行
有三种运行方式: 本地运行, 使用 docker 运行,和 Git Hub Action。
使用 GitHub action 运行
您可以在一分钟内尝试 ASD,无需安装任何工具。
- 点击 使用此模板 在 alps-skeleton 网站上创建 ALPS 框架。请将存储库公开以用于 GitHub Pages。
- 配置 GitHub Pages 网站的发布源。选择
gh-pages
和/(root)
作为源。 - 每次提交时,ASD 图和超链接文档将在
https://{user}.github.io/{repository}/
中生成。
使用 Docker 运行
这是最标准的方式。
curl -L https://alps-asd.github.io/app-state-diagram/asd.sh > ./asd && chmod +x ./asd && sudo mv ./asd /usr/local/bin
运行演示
执行以下步骤,然后打开 http://localhost:3000
mkdir work
curl -L curl https://alps-asd.github.io/app-state-diagram/blog/profile.json > work/profile.json
asd --watch ./work/profile.json
ASD 文档出现?恭喜!按此存储库中的星标以庆祝。🌟
用法
asd [options] [alpsFile]
-c, --config=asd.xml
Path to a asd.xml configuration file
-w, --watch
Watch mode
-m, --mode={markdown|html}
Output format
--port
Port number used in watch mode
- 支持 XML 和 JSON 格式。
- 如果您不使用参数运行它,则使用同一文件夹中的
asd.xml
配置文件。
本地运行
此方法目前主要用于开发者。它既繁琐又耗时。
要求
您可以使用以下命令进行检查。
% php -v
PHP 8.0.6 (cli) (built: May 8 2021 01:58:51) ( NTS )
% composer -V
Composer version 2.0.13 2021-04-27 13:11:08
% npm -v
7.17.0
安装
composer global require koriym/app-state-diagram
更新
composer global update koriym/app-state-diagram
用法
composer global exec asd -- [options] [alpsFile]
选项与 Docker 版本相同。
配置
ASD 使用 XML 配置文件(默认为 asd.xml)。一个简单的示例如下
<?xml version="1.0"?> <asd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://alps-asd.github.io/app-state-diagram/asd.xsd"> <alpsFile>profile.xml</alpsFile> </asd>
可选属性
watch
<asd> <watch>[bool]</watch> </asd>
您可以使用监视模式启动 ASD 开发服务器。每次配置文件更改时,页面都会重新加载。
如果您想以特定的端口号启动,您可以在启动时指定端口号,如下所示。
<asd> <port>3001</port> </asd>
markdown 格式
如果您的存储库是私有的,并且您的帐户不是 GHE 或 GHE Cloud 帐户,则无法将 GitHub Pages 设置为私有。在这种情况下,您可以输出 Markdown 格式的文档并使文档私有。
不幸的是,没有方法托管 Markdown 中的链接 SVG(图表),在 Markdown 中对话框会丢失链接。
如果无法公开 HTML,则此选项可用。
<asd> <mode>markdown</mode> </asd>