document-materials-pipeline は何をしますか?
Codexスキル:Word/PDF教材をクリーニング、ページ付け、並べ替え、マージして学生用・教師用版を作成します。
概要
このスキルは、教育用教材(Word文書やPDFファイル)を自動処理するためのCodexスキルです。入力された教材ファイルを以下の手順で処理します:
- クリーニング:コメント、変更履歴、不要なメタデータを削除します。
- ページ付け:一貫したページ番号を全ドキュメントに付与します。
- 並べ替え:指定された順序(例:章や単元ごと)でドキュメントを整列します。
- マージ:学生用版(解答・注釈なし)と教師用版(解答・注釈あり)の2つの統合ドキュメントを生成します。
必要な環境
- Codex(GitHub Copilot CLIエージェント)
- Python 3.8+
- Pythonパッケージ:
python-docx、PyPDF2、reportlab(インストールは後述)
インストール
# リポジトリをクローン
gh repo clone littleyi22/document-materials-pipeline
cd document-materials-pipeline
# Python依存パッケージをインストール
pip install -r requirements.txt
使い方
- 入力教材ファイルを
input/ディレクトリに配置します。各ファイルはWord(.docx)またはPDF形式である必要があります。 - 設定ファイル
config.yamlを編集して、学生用版と教師用版の設定を指定します(下記の例を参照)。 - 以下のコマンドを実行します:
python run_pipeline.py --config config.yaml
これにより、output/ ディレクトリに以下のファイルが生成されます:
student_edition.docx/student_edition.pdfteacher_edition.docx/teacher_edition.pdf
設定例 (config.yaml)
input:
- file: input/chapter1.docx
order: 1
type: content
include_in: [student, teacher]
- file: input/chapter2.pdf
order: 2
type: content
include_in: [student, teacher]
- file: input/answers.docx
order: 10
type: answer
include_in: [teacher] # 教師用版のみに含める
output:
formats: [docx, pdf]
page_numbers: true
page_start: 1
オプション
--clean-only:クリーニングのみ実行(ページ付け・並べ替え・マージはスキップ)--output-format:出力フォーマットを指定(docx、pdf、またはboth、デフォルトはboth)--verbose:詳細なログを出力
制限事項
- PDFファイルのクリーニング機能は限定的です。可能な場合はWord文書の使用を推奨します。
- 大規模な教材(100ページ以上)の処理には時間がかかる場合があります。
- 現在のバージョンでは日本語と英語の教材をサポートしています。
ライセンス
MIT