Merge branch 'release/0.1.0'
Browse files- .gitattributes +3 -0
- .github/workflows/run.yaml +19 -0
- .gitignore +3 -0
- .streamlit/config.toml +2 -0
- Dockerfile +38 -0
- README.md +102 -1
- app.py +74 -0
- docker-compose.yml +14 -0
- docs/SlideNova_icon.png +3 -0
- docs/page_front.md +15 -0
- run_slidev.py +7 -0
- slides/demo.md +82 -0
- slides/sample/001.png +3 -0
- slides/sample/002.png +3 -0
- slides/sample/003.png +3 -0
- slides/sample/004.png +3 -0
- slides/sample/005.png +3 -0
- slides/sample/006.png +3 -0
- slides/sample/007.png +3 -0
- slides/sample/008.png +3 -0
- slides/sample/009.png +3 -0
- slides/temp.md +19 -0
.gitattributes
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
.github/workflows/run.yaml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Sync to Hugging Face hub
|
2 |
+
on:
|
3 |
+
push:
|
4 |
+
branches: [main]
|
5 |
+
|
6 |
+
# to run this workflow manually from the Actions tab
|
7 |
+
workflow_dispatch:
|
8 |
+
jobs:
|
9 |
+
sync-to-hub:
|
10 |
+
runs-on: ubuntu-latest
|
11 |
+
steps:
|
12 |
+
- uses: actions/checkout@v3
|
13 |
+
with:
|
14 |
+
fetch-depth: 0
|
15 |
+
lfs: true
|
16 |
+
- name: Push to hub
|
17 |
+
env:
|
18 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
19 |
+
run: git push --force https://MakiAi:$HF_TOKEN@huggingface.co/spaces/MakiAi/SlideNova main
|
.gitignore
CHANGED
@@ -158,3 +158,6 @@ cython_debug/
|
|
158 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
159 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
160 |
#.idea/
|
|
|
|
|
|
|
|
158 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
159 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
160 |
#.idea/
|
161 |
+
SourceSageAssets
|
162 |
+
node_modules
|
163 |
+
slides/out
|
.streamlit/config.toml
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[theme]
|
2 |
+
base="light"
|
Dockerfile
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Dockerfile
|
2 |
+
FROM node:18
|
3 |
+
|
4 |
+
USER root
|
5 |
+
RUN useradd -m -u 1001 user
|
6 |
+
WORKDIR /app
|
7 |
+
RUN chown -R user:user /app
|
8 |
+
|
9 |
+
# Pythonのインストール
|
10 |
+
RUN apt-get update && apt-get install -y python3 python3-pip
|
11 |
+
|
12 |
+
# 作業ディレクトリの設定
|
13 |
+
WORKDIR /app
|
14 |
+
|
15 |
+
RUN npm install -g @slidev/cli@latest
|
16 |
+
RUN npx playwright install-deps
|
17 |
+
RUN npx playwright install
|
18 |
+
RUN chown -R user:user /app
|
19 |
+
RUN chown -R user:user /usr/local/lib/node_modules/@slidev/
|
20 |
+
USER user
|
21 |
+
|
22 |
+
# Slidevのインストール
|
23 |
+
|
24 |
+
RUN npm install -D playwright-chromium
|
25 |
+
RUN npm install @slidev/theme-seriph
|
26 |
+
|
27 |
+
COPY --chown=user:user . /app
|
28 |
+
RUN yes | npx slidev export slides/demo.md --format png --output slides/out/ --dark
|
29 |
+
RUN npm install
|
30 |
+
|
31 |
+
|
32 |
+
USER user
|
33 |
+
|
34 |
+
RUN pip install streamlit --break-system-packages
|
35 |
+
ENV PATH="/home/user/.local/bin:${PATH}"
|
36 |
+
|
37 |
+
|
38 |
+
CMD ["python3", "-m", "streamlit", "run", "app.py"]
|
README.md
CHANGED
@@ -1 +1,102 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: SlideNova
|
3 |
+
emoji: 🐠
|
4 |
+
colorFrom: indigo
|
5 |
+
colorTo: green
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
license: mit
|
9 |
+
app_port: 8501
|
10 |
+
---
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
<p align="center">
|
15 |
+
<img src="https://media.githubusercontent.com/media/Sunwood-ai-labs/SlideNova/develop/docs/SlideNova_icon.png" width="100%">
|
16 |
+
<br>
|
17 |
+
<h1 align="center">SlideNova</h1>
|
18 |
+
<h3 align="center">
|
19 |
+
~Experience Slide-Making Reinvented~
|
20 |
+
|
21 |
+
[![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Sunwood-ai-labs/SlideNova)
|
22 |
+
[![GitHub Stars](https://img.shields.io/github/stars/Sunwood-ai-labs/SlideNova)](https://github.com/Sunwood-ai-labs/SlideNova)
|
23 |
+
[![GitHub Last Commit](https://img.shields.io/github/last-commit/Sunwood-ai-labs/SlideNova)](https://github.com/Sunwood-ai-labs/SlideNova)
|
24 |
+
[![GitHub Top Language](https://img.shields.io/github/languages/top/Sunwood-ai-labs/SlideNova)](https://github.com/Sunwood-ai-labs/SlideNova)
|
25 |
+
[![GitHub Release](https://img.shields.io/github/v/release/Sunwood-ai-labs/SlideNova?sort=date&color=red)](https://github.com/Sunwood-ai-labs/SlideNova)
|
26 |
+
</h3>
|
27 |
+
</p>
|
28 |
+
|
29 |
+
## 🚀 はじめに
|
30 |
+
|
31 |
+
SlideNovaは、Markdownからモダンで美しいスライドを簡単に作成できるWebアプリケーションです。
|
32 |
+
[Slidev](https://sli.dev/)を使用しており、スライドの生成はDockerコンテナ内で行われます。
|
33 |
+
Streamlitを使用した直感的なユーザーインターフェイスで、Markdownを入力するだけですぐにスライドを作成できます。
|
34 |
+
|
35 |
+
## 更新情報
|
36 |
+
|
37 |
+
### [2024/04/13] SlideNova v0.1.0 [リリースノート](https://github.com/Sunwood-ai-labs/SlideNova/releases/tag/v0.1.0)
|
38 |
+
- Markdownからスライド生成するWebアプリの公開
|
39 |
+
- Dockerを使った環境構築の自動化
|
40 |
+
- Streamlitによる直感的なユーザーインターフェイス
|
41 |
+
- スライドのダウンロード機能
|
42 |
+
- ドキュメントの拡充
|
43 |
+
- 開発環境の整備とGitHub Actionsの設定
|
44 |
+
|
45 |
+
## 🌟 主な特徴
|
46 |
+
|
47 |
+
- 📝 Markdownでスライド作成
|
48 |
+
- 🎨 Slidevを使用したモダンなスライドデザイン
|
49 |
+
- 🐳 Dockerによる環境構築の簡易化
|
50 |
+
- 🖥️ Streamlitによる使いやすいWebUI
|
51 |
+
|
52 |
+
## 📦 インストール
|
53 |
+
|
54 |
+
SlideNovaを使用するには、DockerとDocker Composeが必要です。以下の手順に従ってください。
|
55 |
+
|
56 |
+
1. このリポジトリをクローンします。
|
57 |
+
|
58 |
+
```bash
|
59 |
+
git clone https://github.com/Sunwood-ai-labs/SlideNova.git
|
60 |
+
```
|
61 |
+
|
62 |
+
2. プロジェクトディレクトリに移動します。
|
63 |
+
|
64 |
+
```bash
|
65 |
+
cd SlideNova
|
66 |
+
```
|
67 |
+
|
68 |
+
3. Docker Composeを使用してSlideNovaを起動します。
|
69 |
+
|
70 |
+
```bash
|
71 |
+
docker-compose up --build
|
72 |
+
```
|
73 |
+
|
74 |
+
4. ブラウザで `http://localhost:8502` を開きます。
|
75 |
+
|
76 |
+
## 🛠️ 使い方
|
77 |
+
|
78 |
+
1. Markdownエディタにスライドのコンテンツを入力します。
|
79 |
+
2. 「Generate Slides」ボタンをクリックします。
|
80 |
+
3. 生成されたスライドが表示されます。
|
81 |
+
|
82 |
+
## Develop command
|
83 |
+
|
84 |
+
```bash
|
85 |
+
yes | npx slidev export slides/demo.md --format png --output slides/out/ --dark
|
86 |
+
```
|
87 |
+
|
88 |
+
## 📖 ドキュメント
|
89 |
+
|
90 |
+
より詳細な情報は、[ドキュメント](docs/)を参照してください。
|
91 |
+
|
92 |
+
## 🤝 コントリビューション
|
93 |
+
|
94 |
+
コントリビューションは歓迎します!詳細は[コントリビューションガイド](CONTRIBUTING.md)を参照してください。
|
95 |
+
|
96 |
+
## 📜 ライセンス
|
97 |
+
|
98 |
+
このプロジェクトは[MITライセンス](LICENSE)の下で公開されています。
|
99 |
+
|
100 |
+
## 📧 お問い合わせ
|
101 |
+
|
102 |
+
ご質問やご提案がありましたら、[Issue](https://github.com/Sunwood-ai-labs/SlideNova/issues)を作成してください。
|
app.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# app.py
|
2 |
+
import streamlit as st
|
3 |
+
import os
|
4 |
+
import subprocess
|
5 |
+
import zipfile
|
6 |
+
import shutil
|
7 |
+
import base64
|
8 |
+
|
9 |
+
def load_markdown(file_path):
|
10 |
+
with open(file_path, encoding="utf8") as f:
|
11 |
+
return f.read()
|
12 |
+
|
13 |
+
|
14 |
+
def display_front_page():
|
15 |
+
html_front = load_markdown('docs/page_front.md')
|
16 |
+
st.markdown(f"{html_front}", unsafe_allow_html=True)
|
17 |
+
|
18 |
+
def main():
|
19 |
+
display_front_page()
|
20 |
+
|
21 |
+
# マークダウンファイルの内容を入力するテキストエリア
|
22 |
+
markdown_text = st.text_area("Enter your markdown content here:", height=400)
|
23 |
+
|
24 |
+
# スライドを生成するボタン
|
25 |
+
if st.button("Generate Slides"):
|
26 |
+
# slides/outフォルダを綺麗にする
|
27 |
+
if os.path.exists("slides/out"):
|
28 |
+
shutil.rmtree("slides/out")
|
29 |
+
os.makedirs("slides/out")
|
30 |
+
|
31 |
+
# 一時ファイルにマークダウンの内容を書き込む
|
32 |
+
with open("temp.md", "w") as f:
|
33 |
+
f.write(markdown_text)
|
34 |
+
|
35 |
+
# slidevコマンドを実行してスライドを生成
|
36 |
+
subprocess.run(["npx", "slidev", "export", "temp.md", "--format", "png", "--output", "slides/out/", "--dark", "-t"])
|
37 |
+
|
38 |
+
# 生成されたスライドを表示
|
39 |
+
slides = []
|
40 |
+
for filename in os.listdir("slides/out"):
|
41 |
+
if filename.endswith(".png"):
|
42 |
+
slides.append(filename)
|
43 |
+
slides.sort()
|
44 |
+
|
45 |
+
for slide in slides:
|
46 |
+
# 画像を表示
|
47 |
+
st.image(f"slides/out/{slide}")
|
48 |
+
|
49 |
+
# 画像をダウンロードするリンクを表示
|
50 |
+
with open(f"slides/out/{slide}", "rb") as f:
|
51 |
+
img_bytes = f.read()
|
52 |
+
b64 = base64.b64encode(img_bytes).decode()
|
53 |
+
href = f'<a href="data:image/png;base64,{b64}" download="{slide}">Download {slide}</a>'
|
54 |
+
st.markdown(href, unsafe_allow_html=True)
|
55 |
+
|
56 |
+
# スライドをZIPファイルに圧縮
|
57 |
+
zip_filename = "slides.zip"
|
58 |
+
with zipfile.ZipFile(zip_filename, "w") as zip_file:
|
59 |
+
for slide in slides:
|
60 |
+
zip_file.write(f"slides/out/{slide}", slide)
|
61 |
+
|
62 |
+
# ZIPファイルをダウンロードするリンクを表示
|
63 |
+
with open(zip_filename, "rb") as f:
|
64 |
+
bytes = f.read()
|
65 |
+
b64 = base64.b64encode(bytes).decode()
|
66 |
+
href = f'<a href="data:application/zip;base64,{b64}" download="{zip_filename}">Download All Slides</a>'
|
67 |
+
st.markdown(href, unsafe_allow_html=True)
|
68 |
+
|
69 |
+
# 一時ファイルとZIPファイルを削除
|
70 |
+
os.remove("temp.md")
|
71 |
+
os.remove(zip_filename)
|
72 |
+
|
73 |
+
if __name__ == "__main__":
|
74 |
+
main()
|
docker-compose.yml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# docker-compose.yml
|
2 |
+
version: '3'
|
3 |
+
services:
|
4 |
+
slidev:
|
5 |
+
build:
|
6 |
+
context: .
|
7 |
+
dockerfile: Dockerfile
|
8 |
+
volumes:
|
9 |
+
- ./slides:/app/slides
|
10 |
+
ports:
|
11 |
+
- "3030:3030"
|
12 |
+
- "8502:8501"
|
13 |
+
tty: true
|
14 |
+
user: user
|
docs/SlideNova_icon.png
ADDED
Git LFS Details
|
docs/page_front.md
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<p align="center">
|
3 |
+
<img src="https://media.githubusercontent.com/media/Sunwood-ai-labs/SlideNova/develop/docs/SlideNova_icon.png" width="100%">
|
4 |
+
<br>
|
5 |
+
<h1 align="center">SlideNova</h1>
|
6 |
+
<h3 align="center">
|
7 |
+
~Experience Slide-Making Reinvented~
|
8 |
+
|
9 |
+
[![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Sunwood-ai-labs/SlideNova)
|
10 |
+
[![GitHub Stars](https://img.shields.io/github/stars/Sunwood-ai-labs/SlideNova)](https://github.com/Sunwood-ai-labs/SlideNova)
|
11 |
+
[![GitHub Last Commit](https://img.shields.io/github/last-commit/Sunwood-ai-labs/SlideNova)](https://github.com/Sunwood-ai-labs/SlideNova)
|
12 |
+
[![GitHub Top Language](https://img.shields.io/github/languages/top/Sunwood-ai-labs/SlideNova)](https://github.com/Sunwood-ai-labs/SlideNova)
|
13 |
+
[![GitHub Release](https://img.shields.io/github/v/release/Sunwood-ai-labs/SlideNova?sort=date&color=red)](https://github.com/Sunwood-ai-labs/SlideNova)
|
14 |
+
</h3>
|
15 |
+
</p>
|
run_slidev.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# run_slidev.py
|
2 |
+
import os
|
3 |
+
import subprocess
|
4 |
+
|
5 |
+
|
6 |
+
# slidevコマンドを実行してスライドをビルド
|
7 |
+
subprocess.run(["npx slidev export slides/demo.md --format png --output slides/out/ --dark -t"])
|
slides/demo.md
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
theme: seriph
|
3 |
+
---
|
4 |
+
|
5 |
+
# SlideNova
|
6 |
+
|
7 |
+
~Experience Slide-Making Reinvented~
|
8 |
+
|
9 |
+
---
|
10 |
+
|
11 |
+
# SlideNova
|
12 |
+
|
13 |
+
- Markdownからモダンで美しいスライドを簡単に作成できるWebアプリケーション
|
14 |
+
- Slidevを使用しスライドの生成はDockerコンテナ内で実行
|
15 |
+
- Streamlitを使用した直感的なユーザーインターフェイス
|
16 |
+
- Markdownを入力するだけですぐにスライドを作成可能
|
17 |
+
|
18 |
+
---
|
19 |
+
|
20 |
+
# 主な特徴
|
21 |
+
|
22 |
+
- Markdownでスライド作成
|
23 |
+
- Slidevを使用したモダンなスライドデザイン
|
24 |
+
- Dockerによる環境構築の簡易化
|
25 |
+
- Streamlitによる使いやすいWebUI
|
26 |
+
|
27 |
+
---
|
28 |
+
|
29 |
+
# インストール
|
30 |
+
|
31 |
+
1. リポジトリをクローン
|
32 |
+
|
33 |
+
```bash
|
34 |
+
git clone https://github.com/Sunwood-ai-labs/SlideNova.git
|
35 |
+
```
|
36 |
+
|
37 |
+
2. プロジェクトディレクトリに移動
|
38 |
+
|
39 |
+
```bash
|
40 |
+
cd SlideNova
|
41 |
+
```
|
42 |
+
|
43 |
+
3. Docker Composeを使用してSlideNovaを起動
|
44 |
+
|
45 |
+
```bash
|
46 |
+
docker-compose up --build
|
47 |
+
```
|
48 |
+
|
49 |
+
4. ブラウザで `http://localhost:8502` を開く
|
50 |
+
|
51 |
+
---
|
52 |
+
|
53 |
+
# 使い方
|
54 |
+
|
55 |
+
1. Markdownエディタにスライドのコンテンツを入力
|
56 |
+
2. 「Generate Slides」ボタンをクリック
|
57 |
+
3. 生成されたスライドが表示される
|
58 |
+
|
59 |
+
---
|
60 |
+
|
61 |
+
# ドキュメント
|
62 |
+
|
63 |
+
- 詳細な情報は、ドキュメントを参照
|
64 |
+
|
65 |
+
---
|
66 |
+
|
67 |
+
# コントリビューション
|
68 |
+
|
69 |
+
- コントリビューションは歓迎
|
70 |
+
- 詳細はコントリビューションガイドを参照
|
71 |
+
|
72 |
+
---
|
73 |
+
|
74 |
+
# ライセンス
|
75 |
+
|
76 |
+
- MITライセンスの下で公開
|
77 |
+
|
78 |
+
---
|
79 |
+
|
80 |
+
# お問い合わせ
|
81 |
+
|
82 |
+
- ご質問やご提案がありましたら、Issueを作成
|
slides/sample/001.png
ADDED
Git LFS Details
|
slides/sample/002.png
ADDED
Git LFS Details
|
slides/sample/003.png
ADDED
Git LFS Details
|
slides/sample/004.png
ADDED
Git LFS Details
|
slides/sample/005.png
ADDED
Git LFS Details
|
slides/sample/006.png
ADDED
Git LFS Details
|
slides/sample/007.png
ADDED
Git LFS Details
|
slides/sample/008.png
ADDED
Git LFS Details
|
slides/sample/009.png
ADDED
Git LFS Details
|
slides/temp.md
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Slidev
|
2 |
+
|
3 |
+
Hello World
|
4 |
+
あああああ
|
5 |
+
|
6 |
+
|
7 |
+
---
|
8 |
+
|
9 |
+
# Page 2
|
10 |
+
|
11 |
+
Directly use code blocks for highlighting
|
12 |
+
|
13 |
+
```ts
|
14 |
+
console.log('Hello, World!')
|
15 |
+
```
|
16 |
+
|
17 |
+
---
|
18 |
+
|
19 |
+
# Page 3
|