Spaces:
Running
Running
Add "Blank" description & Update default template
Browse files- main.py +5 -2
- template.pptx +0 -0
main.py
CHANGED
|
@@ -32,6 +32,9 @@ def convert_markdown_to_ppt(markdown_file, markdown_text, input_type, template_f
|
|
| 32 |
if template_file is not None:
|
| 33 |
template_path = template_file.name
|
| 34 |
command_pptx += f" --reference-doc='{template_path}'"
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
try:
|
| 37 |
# result = subprocess.run(command_pptx, shell=True, check=True)
|
|
@@ -69,7 +72,7 @@ with gr.Blocks() as iface:
|
|
| 69 |
2. **上傳或輸入 Markdown 檔案**:根據選擇進行上傳或輸入。
|
| 70 |
3. **選擇性上傳 PPT 模板**:如需指定模板,可點擊「PPT Template (Optional)」欄位上傳 PPT 模板檔案。否則將使用預設樣式轉換。<br>
|
| 71 |
a. **模板格式要求**:PPT 模板檔案需為 PPTX 格式的檔案。<br>
|
| 72 |
-
b. **模板名稱要求**:模板中的樣式名稱需符合 Pandoc 的樣式名稱,如「Title Slide」、「Section Header」、「Title and Content」、「Two Content」、「Comparison」、「Content with Caption」
|
| 73 |
c. **模板範例參考**: [PPT 模板範例](https://huggingface.co/spaces/u5ername/markdown2ppt-docker/blob/main/template.pptx) (可以在範例的 PPT 中查看模板的命名方式)<br>
|
| 74 |
4. **點擊提交**:點擊「Submit」按鈕進行轉換。
|
| 75 |
5. **下載轉換結果**:轉換完成後,下載生成的 PPT 文件。
|
|
@@ -79,7 +82,7 @@ with gr.Blocks() as iface:
|
|
| 79 |
2. **Upload or Enter Markdown File**: Proceed with upload or text input based on your choice.
|
| 80 |
3. **Optionally upload a PPT template**: If you want to use a specific template, click on the "PPT Template (Optional)" field to upload a PPT template file. Otherwise, the default style will be used.<br>
|
| 81 |
a. **Template Format Requirements**: The PPT template file must be in PPTX format.<br>
|
| 82 |
-
b. **Template Naming Requirements**: The style names in the template must conform to Pandoc's style naming conventions, such as "Title Slide", "Section Header", "Title and Content", "Two Content", "Comparison", "Content with Caption",
|
| 83 |
c. **Template Example Reference**: [PPT Template Example](https://huggingface.co/spaces/u5ername/markdown2ppt-docker/blob/main/template.pptx) (You can check the naming conventions in the example PPT)<br>
|
| 84 |
4. **Click Submit**: Press the "Submit" button to start the conversion.
|
| 85 |
5. **Download the result**: Once the conversion is complete, download the generated PPT file.
|
|
|
|
| 32 |
if template_file is not None:
|
| 33 |
template_path = template_file.name
|
| 34 |
command_pptx += f" --reference-doc='{template_path}'"
|
| 35 |
+
else:
|
| 36 |
+
# 使用預設樣式轉換
|
| 37 |
+
command_pptx += " --reference-doc=template.pptx"
|
| 38 |
|
| 39 |
try:
|
| 40 |
# result = subprocess.run(command_pptx, shell=True, check=True)
|
|
|
|
| 72 |
2. **上傳或輸入 Markdown 檔案**:根據選擇進行上傳或輸入。
|
| 73 |
3. **選擇性上傳 PPT 模板**:如需指定模板,可點擊「PPT Template (Optional)」欄位上傳 PPT 模板檔案。否則將使用預設樣式轉換。<br>
|
| 74 |
a. **模板格式要求**:PPT 模板檔案需為 PPTX 格式的檔案。<br>
|
| 75 |
+
b. **模板名稱要求**:模板中的樣式名稱需符合 Pandoc 的樣式名稱,如「Title Slide」、「Section Header」、「Title and Content」、「Two Content」、「Comparison」、「Content with Caption」、「Blank」。<br>
|
| 76 |
c. **模板範例參考**: [PPT 模板範例](https://huggingface.co/spaces/u5ername/markdown2ppt-docker/blob/main/template.pptx) (可以在範例的 PPT 中查看模板的命名方式)<br>
|
| 77 |
4. **點擊提交**:點擊「Submit」按鈕進行轉換。
|
| 78 |
5. **下載轉換結果**:轉換完成後,下載生成的 PPT 文件。
|
|
|
|
| 82 |
2. **Upload or Enter Markdown File**: Proceed with upload or text input based on your choice.
|
| 83 |
3. **Optionally upload a PPT template**: If you want to use a specific template, click on the "PPT Template (Optional)" field to upload a PPT template file. Otherwise, the default style will be used.<br>
|
| 84 |
a. **Template Format Requirements**: The PPT template file must be in PPTX format.<br>
|
| 85 |
+
b. **Template Naming Requirements**: The style names in the template must conform to Pandoc's style naming conventions, such as "Title Slide", "Section Header", "Title and Content", "Two Content", "Comparison", "Content with Caption", "Blank".<br>
|
| 86 |
c. **Template Example Reference**: [PPT Template Example](https://huggingface.co/spaces/u5ername/markdown2ppt-docker/blob/main/template.pptx) (You can check the naming conventions in the example PPT)<br>
|
| 87 |
4. **Click Submit**: Press the "Submit" button to start the conversion.
|
| 88 |
5. **Download the result**: Once the conversion is complete, download the generated PPT file.
|
template.pptx
CHANGED
|
Binary files a/template.pptx and b/template.pptx differ
|
|
|