[AI]
MVP готов
This commit is contained in:
101
README.md
Normal file
101
README.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# md-to-docx
|
||||
|
||||
Конвертер Markdown в Word (.docx) с поддержкой стилей, тем и плагинов.
|
||||
|
||||
## Установка
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Использование
|
||||
|
||||
### Структура входных данных:
|
||||
|
||||
```
|
||||
inputs/
|
||||
├── my_doc/
|
||||
│ ├── document.md
|
||||
│ └── images/
|
||||
│ ├── img1.png
|
||||
│ └── img2.jpg
|
||||
```
|
||||
|
||||
### Простой запуск:
|
||||
|
||||
```bash
|
||||
python -m src --input inputs --output outputs
|
||||
```
|
||||
|
||||
### С использованием темы:
|
||||
|
||||
```bash
|
||||
python -m src --input inputs --output outputs --theme academic
|
||||
```
|
||||
|
||||
### С шаблоном .dotx:
|
||||
|
||||
```bash
|
||||
python -m src --input inputs --output outputs --template template.dotx
|
||||
```
|
||||
|
||||
### С плагинами:
|
||||
|
||||
```bash
|
||||
python -m src --input inputs --output outputs --plugins my_plugins/
|
||||
```
|
||||
|
||||
### Дополнительные опции:
|
||||
|
||||
- `--verbose` / `-v` — подробный лог
|
||||
- `--quiet` / `-q` — без логов
|
||||
- `--dry-run` — показать, что будет сделано
|
||||
- `--style path/to/style.yaml` — использовать свой стиль
|
||||
|
||||
## Поддерживаемые элементы
|
||||
|
||||
- Заголовки `#`, `##`, `###`
|
||||
- Параграфы
|
||||
- Списки: `-`, `1.`
|
||||
- **Жирный**, *курсив*, [ссылки](https://example.com)
|
||||
- Изображения: ``
|
||||
- Таблицы
|
||||
- `<br>` внутри таблиц и параграфов
|
||||
|
||||
## Стили
|
||||
|
||||
Стили задаются в `resources/style_config.yaml` или через `--theme`.
|
||||
|
||||
Пример:
|
||||
|
||||
```yaml
|
||||
styles:
|
||||
Heading 1:
|
||||
font:
|
||||
name: "Times New Roman"
|
||||
size: 16
|
||||
bold: true
|
||||
```
|
||||
|
||||
## Плагины
|
||||
|
||||
Можно создать свой обработчик:
|
||||
|
||||
```python
|
||||
# plugins/my_block.py
|
||||
from src.handlers import register_handler
|
||||
|
||||
@register_handler("my_block")
|
||||
def handle_my_block(node, doc, images_dir, style_reg):
|
||||
# ваш код
|
||||
pass
|
||||
```
|
||||
|
||||
И использовать: `--plugins plugins/`
|
||||
|
||||
## Docker
|
||||
|
||||
```bash
|
||||
docker build -t md2docx .
|
||||
docker run -v ./inputs:/app/inputs -v ./outputs:/app/outputs md2docx --input inputs --output outputs
|
||||
```
|
||||
Reference in New Issue
Block a user