kalyashka/srcdoc

将源文件转换为HTML,您可以稍后将其转换为.docx、.pdf格式

0.1.0 2019-01-09 08:38 UTC

This package is auto-updated.

Last update: 2024-09-09 21:29:12 UTC


README

A命令行工具,用于在HTML文档中收集和粘贴源代码。使用scrivo/highlight.php进行语法高亮。

安装

composer global require kalyashka/srcdoc

使用方法

srcdoc [options] [<directory>]

其中 <directory> - 包含源文件的根目录(默认为当前目录) options

  • --help, -h - 显示帮助
  • --extensions, -e - 文件扩展名(以逗号分隔,例如"php,js,css,scss")
  • --exclude, -x - 排除的文件/目录模式(例如"vendor,assets",以逗号分隔)
  • --output, -o - 输出文件名(如果不提供,则使用stdout)
  • --list, -l - 不扫描目录,使用列表文件(每行一个文件)
  • --no-syntax, -s - 禁用语法高亮
  • --theme, t - 使用highlight.php主题之一
  • --theme-list - 输出highlight.php主题列表
  • --heading - 标题标签(默认h3)

示例

srcdoc -e vendor -x "php,js,css" --heading h2 --theme idea -o doc.html