承接 bitandblack/markdown-idml-converter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bitandblack/markdown-idml-converter

最新稳定版本:2.0.0

Composer 安装命令:

composer require bitandblack/markdown-idml-converter

包简介

Convert Markdown into (parts of) Adobe InDesign Markup Language Files (IDML).

README 文档

README

PHP from Packagist Total Downloads License

Bit&Black Logo

Bit&Black Markdown-IDML-Converter

Convert Markdown into (parts of) Adobe InDesign Markup Language Files (IDML).

Installation

This library is written in PHP and made for the use with Composer. Be sure to have both of them installed on your system.

As this library requires the IDML Creator — which requires a licence — be sure to get one at first. If not already part of your project, add the Composer credentials. (This is explained for example here.)

Add the library then to your project by running $ composer require bitandblack/markdown-idml-converter.

Usage

Converting Markdown into IDML Formatted Text

This library can convert a few Markdown formats into Paragraph and Character Styles. It can handle:

  • The base "copy" paragraph
  • Headlines from hierarchy 1 to 6
  • An italic formatting
  • A bold formatting

Therefore, the first step is to create an array with the styles, that should be used:

<?php

use BitAndBlack\IdmlCreator\Content\Style\CharacterStyle;
use BitAndBlack\IdmlCreator\Content\Style\ParagraphStyle;
use BitAndBlack\MarkdownIdmlConverter\MarkdownToStyles;

$formats = [
    MarkdownToStyles::PARAGRAPH_STYLE_BODY => new ParagraphStyle('Body'),
    MarkdownToStyles::CHARACTER_STYLE_ITALIC => new CharacterStyle('Italic'),
    MarkdownToStyles::CHARACTER_STYLE_BOLD => new CharacterStyle('Bold'),
];

Second, the MarkdownToStyles class can be initialised with those styles and text can be converted:

<?php

use BitAndBlack\MarkdownIdmlConverter\MarkdownToStyles;

$markdownToStyles = new MarkdownToStyles($formats);

$paragraphStyleRange = $markdownToStyles->convert($markdownFormattedText);

The result is a IDML ParagraphStyleRange, that can be handled using the IDML Creator.

Other Tools

Bit&Black offers some more tools to handle IDML files:

  • The IDML-Creator library that allows creating IDML content natively in PHP in an object-oriented way. (A demo is available here.)
  • The IDML-Writer library that can write IDML content into a valid IDML file.
  • The IDML-Validator library that allows validating IDML files against the official schema from Adobe.
  • The IDML-JSON-Converter library that allows converting Adobe InDesign Markup Language Files (IDML) into JSON and JSON into IDML.

Feel free to visit www.idml.dev for more information!

Help

If you have any questions feel free to contact us under hello@bitandblack.com.

Further information about Bit&Black can be found under www.bitandblack.com.

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固