Skip to content

Commit ee15687

Browse files
committed
docs: update README
1 parent 4bfbd23 commit ee15687

2 files changed

Lines changed: 54 additions & 104 deletions

File tree

README-zh_CN.md

Lines changed: 28 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
# Dash TailwindCSS 插件
1+
# Dash TailwindCSS Plugin
22

3-
[![GitHub](https://shields.io/badge/license-MIT-informational)](https://github.com/HogaStack/dash-tailwindcss-plugin/blob/main/LICENSE)
4-
[![PyPI](https://img.shields.io/pypi/v/dash-tailwindcss-plugin.svg?color=dark-green)](https://pypi.org/project/dash-tailwindcss-plugin/)
3+
一个用于将 TailwindCSS 集成到 Plotly Dash 应用程序中的插件,使用 Dash 3.x hooks。支持 Tailwind CSS v3 和 v4。
4+
5+
[![Tests](https://github.com/HogaStack/dash-tailwindcss-plugin/workflows/Tests/badge.svg)](https://github.com/HogaStack/dash-tailwindcss-plugin/actions)
6+
[![Coverage](https://codecov.io/gh/HogaStack/dash-tailwindcss-plugin/branch/main/graph/badge.svg)](https://codecov.io/gh/HogaStack/dash-tailwindcss-plugin)
7+
[![Python Version](https://img.shields.io/pypi/pyversions/dash-tailwindcss-plugin)](https://pypi.org/project/dash-tailwindcss-plugin/)
8+
[![PyPI](https://img.shields.io/pypi/v/dash-tailwindcss-plugin)](https://pypi.org/project/dash-tailwindcss-plugin/)
59
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
10+
[![GitHub](https://shields.io/badge/license-MIT-informational)](https://github.com/HogaStack/dash-tailwindcss-plugin/blob/main/LICENSE)
611

712
简体中文 | [English](./README.md)
813

9-
一个用于将 TailwindCSS 集成到 Plotly Dash 应用程序中的插件,使用 Dash 3.x hooks。支持 Tailwind CSS v3 和 v4。
10-
1114
## 功能特性
1215

1316
1. **在线模式**:使用 Tailwind CSS CDN 快速设置
@@ -34,16 +37,10 @@ pip install dash-tailwindcss-plugin
3437
pip install -e .
3538
```
3639

37-
用于开发和测试依赖
40+
用于开发和所有依赖(包括测试依赖)
3841

3942
```bash
40-
pip install -e .[test]
41-
```
42-
43-
用于开发和所有依赖:
44-
45-
```bash
46-
pip install -e .[dev,test]
43+
pip install -e .[dev]
4744
```
4845

4946
## 使用方法
@@ -231,23 +228,24 @@ if __name__ == "__main__":
231228

232229
```bash
233230
dash-tailwindcss-plugin/
231+
├── .github/
232+
│ └── workflows/
233+
│ └── test.yml # GitHub Actions 测试工作流
234234
├── dash_tailwindcss_plugin/
235235
│ ├── __init__.py # 导出主插件函数
236236
│ ├── plugin.py # 主插件实现,包含 _TailwindCSSPlugin 类
237237
│ ├── cli.py # 命令行界面,包含 _TailwindCLI 类
238238
│ └── utils.py # Node.js 管理、文件操作等实用函数
239239
├── tests/
240-
│ ├── test_plugin.py # 插件核心功能的单元测试
241-
│ ├── test_utils.py # 实用函数的单元测试
240+
│ ├── README.md # 英文测试文档
241+
│ ├── README-zh_CN.md # 中文测试文档
242+
│ ├── conftest.py # Pytest 配置夹具
242243
│ ├── test_cli.py # CLI 接口的单元测试
243-
│ ├── test_integration.py # 构建过程的集成测试
244-
│ ├── test_dash_simple.py # 简单的 Dash 集成测试(无需浏览器)
245-
│ ├── test_dash_integration.py # Dash 端到端集成测试(需要浏览器自动化)
246-
│ └── test_dash_callbacks.py # Dash 回调和布局测试
244+
│ ├── test_dash_integration.py # Dash 端到端集成测试
245+
│ ├── test_plugin.py # 插件核心功能的单元测试
246+
│ └── test_utils.py # 实用函数的单元测试
247247
├── example_app.py # 示例 Dash 应用
248-
├── requirements.txt # 运行时依赖
249-
├── requirements-test.txt # 测试依赖
250-
├── setup.py # 安装脚本
248+
├── requirements-dev.txt # 开发和测试依赖
251249
├── pyproject.toml # 构建配置
252250
├── pytest.ini # Pytest 配置
253251
├── ruff.toml # Ruff 配置(代码检查)
@@ -304,47 +302,24 @@ dash-tailwindcss-plugin/
304302
## 开发
305303

306304
1. 克隆仓库
307-
2. 安装依赖:`pip install -r requirements.txt`
308-
3. 安装测试依赖:`pip install -r requirements-test.txt`
309-
4. 以开发模式安装:`pip install -e .`
310-
5. 运行示例:`python example_app.py`
311-
312-
### 可选依赖
313-
314-
用于开发和测试依赖:
315-
316-
```bash
317-
pip install -e .[test]
318-
```
319-
320-
用于开发和所有依赖:
321-
322-
```bash
323-
pip install -e .[dev,test]
324-
```
305+
2. 安装开发依赖:`pip install -r requirements-dev.txt`
306+
3. 以开发模式安装:`pip install -e .`
307+
4. 运行示例:`python example_app.py`
325308

326309
## 运行测试
327310

328-
该项目使用分层测试方法:
329-
330-
1. **基础测试** - 无需浏览器自动化运行(推荐用于大多数情况)
331-
2. **高级测试** - 需要浏览器自动化进行端到端测试
332-
333311
```bash
334-
# 安装测试依赖
335-
pip install -r requirements-test.txt
336-
337-
# 运行基础测试(无需浏览器自动化)
338-
python -m pytest tests/test_plugin.py tests/test_utils.py tests/test_cli.py tests/test_integration.py tests/test_dash_simple.py
312+
# 安装开发依赖(包含测试依赖)
313+
pip install -r requirements-dev.txt
339314

340-
# 运行所有测试(包括需要浏览器自动化的测试)
315+
# 运行所有测试
341316
python -m pytest tests/
342317

343318
# 运行特定测试文件
344319
python -m pytest tests/test_plugin.py
345320
python -m pytest tests/test_utils.py
346321
python -m pytest tests/test_cli.py
347-
python -m pytest tests/test_dash_simple.py
322+
python -m pytest tests/test_dash_integration.py
348323

349324
# 运行带详细输出的测试
350325
python -m pytest tests/ -v
@@ -353,7 +328,7 @@ python -m pytest tests/ -v
353328
python -m pytest tests/ --cov=dash_tailwindcss_plugin --cov-report=html
354329
```
355330

356-
更多信息请参见 [tests/README.md](tests/README.md)
331+
更多信息请参见 [tests/README-zh_CN.md](tests/README-zh_CN.md)
357332

358333
## 构建包
359334

README.md

Lines changed: 26 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Dash TailwindCSS Plugin
22

3-
[![GitHub](https://shields.io/badge/license-MIT-informational)](https://github.com/HogaStack/dash-tailwindcss-plugin/blob/main/LICENSE)
4-
[![PyPI](https://img.shields.io/pypi/v/dash-tailwindcss-plugin.svg?color=dark-green)](https://pypi.org/project/dash-tailwindcss-plugin/)
3+
A plugin for integrating TailwindCSS with Plotly Dash applications using Dash 3.x hooks. Supports both Tailwind CSS v3 and v4.
4+
5+
[![Tests](https://github.com/HogaStack/dash-tailwindcss-plugin/workflows/Tests/badge.svg)](https://github.com/HogaStack/dash-tailwindcss-plugin/actions)
6+
[![Coverage](https://codecov.io/gh/HogaStack/dash-tailwindcss-plugin/branch/main/graph/badge.svg)](https://codecov.io/gh/HogaStack/dash-tailwindcss-plugin)
7+
[![Python Version](https://img.shields.io/pypi/pyversions/dash-tailwindcss-plugin)](https://pypi.org/project/dash-tailwindcss-plugin/)
8+
[![PyPI](https://img.shields.io/pypi/v/dash-tailwindcss-plugin)](https://pypi.org/project/dash-tailwindcss-plugin/)
59
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
10+
[![GitHub](https://shields.io/badge/license-MIT-informational)](https://github.com/HogaStack/dash-tailwindcss-plugin/blob/main/LICENSE)
611

712
English | [简体中文](./README-zh_CN.md)
813

9-
A plugin for integrating TailwindCSS with Plotly Dash applications using Dash 3.x hooks. Supports both Tailwind CSS v3 and v4.
10-
1114
## Features
1215

1316
1. **Online Mode**: Uses Tailwind CSS CDN for quick setup
@@ -34,16 +37,10 @@ Or for development:
3437
pip install -e .
3538
```
3639

37-
For development with test dependencies:
40+
For development with all dependencies (including test dependencies):
3841

3942
```bash
40-
pip install -e .[test]
41-
```
42-
43-
For development with both development and test dependencies:
44-
45-
```bash
46-
pip install -e .[dev,test]
43+
pip install -e .[dev]
4744
```
4845

4946
## Usage
@@ -231,23 +228,24 @@ if __name__ == "__main__":
231228

232229
```bash
233230
dash-tailwindcss-plugin/
231+
├── .github/
232+
│ └── workflows/
233+
│ └── test.yml # GitHub Actions workflow for testing
234234
├── dash_tailwindcss_plugin/
235235
│ ├── __init__.py # Exports main plugin function
236236
│ ├── plugin.py # Main plugin implementation with _TailwindCSSPlugin class
237237
│ ├── cli.py # Command-line interface with _TailwindCLI class
238238
│ └── utils.py # Utility functions for Node.js management, file operations, etc.
239239
├── tests/
240-
│ ├── test_plugin.py # Unit tests for plugin core functionality
241-
│ ├── test_utils.py # Unit tests for utility functions
240+
│ ├── README.md # English test documentation
241+
│ ├── README-zh_CN.md # Chinese test documentation
242+
│ ├── conftest.py # Pytest configuration fixtures
242243
│ ├── test_cli.py # Unit tests for CLI interface
243-
│ ├── test_integration.py # Integration tests for build process
244-
│ ├── test_dash_simple.py # Simple Dash integration tests (no browser required)
245-
│ ├── test_dash_integration.py # Dash end-to-end integration tests (requires browser automation)
246-
│ └── test_dash_callbacks.py # Dash callback and layout tests
244+
│ ├── test_dash_integration.py # Dash end-to-end integration tests
245+
│ ├── test_plugin.py # Unit tests for plugin core functionality
246+
│ └── test_utils.py # Unit tests for utility functions
247247
├── example_app.py # Example Dash application
248-
├── requirements.txt # Runtime dependencies
249-
├── requirements-test.txt # Test dependencies
250-
├── setup.py # Setup script for installation
248+
├── requirements-dev.txt # Development and test dependencies
251249
├── pyproject.toml # Build configuration
252250
├── pytest.ini # Pytest configuration
253251
├── ruff.toml # Ruff configuration (linting)
@@ -304,47 +302,24 @@ The plugin accepts the following parameters:
304302
## Development
305303

306304
1. Clone the repository
307-
2. Install dependencies: `pip install -r requirements.txt`
308-
3. Install test dependencies: `pip install -r requirements-test.txt`
309-
4. Install in development mode: `pip install -e .`
310-
5. Run example: `python example_app.py`
311-
312-
### Optional Dependencies
313-
314-
For development with test dependencies:
315-
316-
```bash
317-
pip install -e .[test]
318-
```
319-
320-
For development with both development and test dependencies:
321-
322-
```bash
323-
pip install -e .[dev,test]
324-
```
305+
2. Install development dependencies: `pip install -r requirements-dev.txt`
306+
3. Install in development mode: `pip install -e .`
307+
4. Run example: `python example_app.py`
325308

326309
## Running Tests
327310

328-
This project uses a layered testing approach:
329-
330-
1. **Basic tests** - Run without browser automation (recommended for most cases)
331-
2. **Advanced tests** - Require browser automation for end-to-end testing
332-
333311
```bash
334-
# Install test dependencies
335-
pip install -r requirements-test.txt
336-
337-
# Run basic tests (no browser automation required)
338-
python -m pytest tests/test_plugin.py tests/test_utils.py tests/test_cli.py tests/test_integration.py tests/test_dash_simple.py
312+
# Install development dependencies (includes test dependencies)
313+
pip install -r requirements-dev.txt
339314

340-
# Run all tests (including those requiring browser automation)
315+
# Run all tests
341316
python -m pytest tests/
342317

343318
# Run specific test files
344319
python -m pytest tests/test_plugin.py
345320
python -m pytest tests/test_utils.py
346321
python -m pytest tests/test_cli.py
347-
python -m pytest tests/test_dash_simple.py
322+
python -m pytest tests/test_dash_integration.py
348323

349324
# Run tests with verbose output
350325
python -m pytest tests/ -v

0 commit comments

Comments
 (0)