Browse Source

Merge pull request #9588 from weseek/support/157930-160692-add-pdf-converter-readme

add README for pdf-converter
Yuki Takei 1 năm trước cách đây
mục cha
commit
df3ce48bee
2 tập tin đã thay đổi với 77 bổ sung0 xóa
  1. 38 0
      apps/pdf-converter/README.md
  2. 39 0
      apps/pdf-converter/README_JP.md

+ 38 - 0
apps/pdf-converter/README.md

@@ -0,0 +1,38 @@
+[日本語 🇯🇵](./README_JP.md)
+
+# About this app
+GROWI provides a feature that bulk exports pages in PDF format, which can be executed from the page menu.
+This app (PDF-Converter) is necessary to convert markdown pages to PDF during that process.
+
+# Development
+## Spec (only in Japanese)
+[/資料/内部仕様/Page Bulk Export/PDF エクスポート](https://dev.growi.org/66ee8495830566b31e02c953)
+
+## Developing inside a devcontainer
+1. Open VSCode
+1. Open command palette (Windows: Ctrl + Shift + P, Mac: Cmd + Shift + P)
+1. Choose `Dev Containers: Open folder in Container...`
+1. Choose the root growi directory you have cloned from https://github.com/weseek/growi
+    - **Not the PDF-Converter directory (growi/apps/pdf-converter)**
+1. Choose `GROWI-PDF-Converter` as the container to open
+1. Execute `cd apps/pdf-converter && turbo dev:pdf-converter` to start the pdf-converter app
+1. Edit files in apps/pdf-converter for development
+
+## Requesting PDF-Converter from GROWI (both running in a devcontainer)
+1. Open VSCode and open GROWI devcontainer
+    - Choose `GROWI-Dev` for the container to open
+1. Open a new VSCode window and open PDF-Converter devcontainer
+    - Follow [Developing inside a devcontainer](#developing-inside-a-devcontainer)
+1. Start both apps
+1. Request PDF bulk export from the page menu in the GROWI app
+    - It might take a few minutes, depending on GROWI's configurations
+
+## PDF-Converter client library
+[pdf-converter-client](../../packages/pdf-converter-client) is a client library for requesting PDF-Converter, and is used by GROWI internally. It's code is auto-generated from the PDF-Converter code.
+
+When you update the PDF-Converter API, you should also always update the client library.
+
+You can update the client library by one of the following ways:
+- Execute `cd ${growi_root_path}/packages/pdf-converter-client && pnpm gen:client-code`
+- Start GROWI app
+    - Inside GROWI devcontainer (not PDF-Converter devcontainer), execute `cd ${growi_root_path}/apps/app && turbo dev`

+ 39 - 0
apps/pdf-converter/README_JP.md

@@ -0,0 +1,39 @@
+[English 🇺🇸](./README.md)
+
+# このアプリについて
+GROWI には、ページを PDF 形式で一括エクスポートする機能があり、ページメニューから実行できます。
+このアプリ(PDF-Converter)は、そのプロセスの中で Markdown ページを PDF に変換するために必要です。
+
+# 開発
+## 内部仕様
+[/資料/内部仕様/Page Bulk Export/PDF エクスポート](https://dev.growi.org/66ee8495830566b31e02c953)
+
+## Devcontainer 内での開発
+1. VSCode を開く
+1. コマンドパレットを開く(Windows: `Ctrl + Shift + P`、Mac: `Cmd + Shift + P`)
+1. `Dev Containers: Open folder in Container...` を選択
+1. [https://github.com/weseek/growi](https://github.com/weseek/growi) からクローンした GROWI のルートディレクトリを選択
+   - **PDF-Converter のディレクトリ(growi/apps/pdf-converter)ではなく、GROWI のルートディレクトリを選択すること**
+1. `GROWI-PDF-Converter` をコンテナとして選択
+1. `cd apps/pdf-converter && turbo dev:pdf-converter` を実行し、PDF-Converter アプリを起動
+1. `apps/pdf-converter` 内のファイルを編集して開発を行う
+
+## GROWI から PDF-Converter へのリクエストを実行(両方とも devcontainer 内で起動)
+1. VSCode を開き、GROWI の devcontainer を開く
+   - `GROWI-Dev` をコンテナとして選択
+1. 新しい VSCode ウィンドウを開き、PDF-Converter の devcontainer を開く
+   - [Devcontainer 内での開発](#devcontainer-内での開発) の手順に従う
+1. 両方のアプリを起動
+1. GROWI アプリのページメニューから PDF の一括エクスポートをリクエスト
+   - GROWI の設定によっては、処理に数分かかる場合があります
+
+## PDF-Converter クライアントライブラリ
+[pdf-converter-client](../../packages/pdf-converter-client) は、PDF-Converter へのリクエストを行うクライアントライブラリであり、GROWI 内部で使用されています。このコードは PDF-Converter のコードから自動生成されます。
+
+PDF-Converter API を更新した際は、必ずクライアントライブラリも更新してください。
+
+クライアントライブラリは以下のいずれかの方法で更新可能です:
+- `cd ${growi_root_path}/packages/pdf-converter-client && pnpm gen:client-code` を実行
+- GROWI アプリを起動
+    - GROWI の devcontainer 内 **(PDF-Converter の devcontainer ではない)** で
+      `cd ${growi_root_path}/apps/app && turbo dev` を実行