Skip to content

Commit 47fafcb

Browse files
author
arch
committed
add docs to windows manual build
1 parent f83510a commit 47fafcb

File tree

7 files changed

+40
-8
lines changed

7 files changed

+40
-8
lines changed

.github/workflows/windows_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: conda-incubator/setup-miniconda@v2
2020
with:
2121
activate-environment: build
22-
environment-file: environment.yaml
22+
environment-file: environment_windows.yaml
2323
python-version: 3.9
2424
auto-activate-base: false
2525
- name: Collect Conda Info

build.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
@echo off
22
rmdir /Q /S "build" 2>NUL
33
rmdir /Q /S "dist/funscript-editor" 2>NUL
4+
del "dist\\funscript-editor.zip" 2>NUL
45
del funscript-editor.spec 2>NUL
5-
pyinstaller --add-data="funscript_editor/config/*;funscript_editor/config" --add-data="assets/*;." --hidden-import "pynput.keyboard._win32" --hidden-import "pynput.mouse._win32" funscript-editor.py
6+
cd docs/app
7+
mkdocs build
8+
cd ../..
9+
pyinstaller --add-data="funscript_editor/config/*;funscript_editor/config/" --add-data="assets/*;./" --hidden-import "pynput.keyboard._win32" --hidden-import "pynput.mouse._win32" funscript-editor.py
10+
move "docs\\app\\site" "dist\\funscript-editor\\funscript_editor\\docs"
611
copy /Y "funscript_editor\\VERSION.txt" "dist\\funscript-editor\\funscript_editor"
712
powershell Compress-Archive -LiteralPath "dist/funscript-editor" -DestinationPath "dist/funscript-editor.zip"
813

docs/app/docs/user-guide/build.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ We use [pyinstaller](https://pypi.org/project/pyinstaller/) in [miniconda](https
99
First download and install [miniconda](https://docs.conda.io/en/latest/miniconda.html) (If you have already [anaconda](https://www.anaconda.com/) installed on your computer you can skip this step). Then run the following commands in the project root directory:
1010

1111
```
12-
conda env create -f environment.yaml
12+
conda env create -f environment_windows.yaml
1313
conda activate build
1414
build.bat
1515
```
@@ -23,10 +23,11 @@ Finally you can remove the build environment with `conda env remove -n build`
2323
```bash
2424
sudo apt update
2525
sudo add-apt-repository ppa:savoury1/ffmpeg4
26-
sudo apt install git python3 python3-pip python3-sphinx python3-opencv mkdocs python3-pyqt5 ffmpeg libmpv-dev
26+
sudo apt install git python3 python3-pip python3-sphinx sphinx-rtd-theme-common python3-opencv mkdocs python3-pyqt5 ffmpeg libmpv-dev
2727
git clone https://github.com/michael-mueller-git/Python-Funscript-Editor.git
2828
cd Python-Funscript-Editor
2929
pip install -r requirements.txt
30-
make all
31-
python3 funscript-editor.py
30+
make docs
3231
```
32+
33+
Now you can run the code direct with `python3 funscript-editor.py` or install install a pip package with `make all`.

docs/code/generate_doc.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ if ! command -v sphinx-apidoc ; then
1818
fi
1919
fi
2020

21+
if [ -z "$(pip3 list | grep "sphinx-rtd-theme")" ] ; then
22+
pip3 install sphinx-rtd-theme
23+
fi
24+
2125
WDIR=$PWD
2226

2327
if [ -f index.rst ]; then
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,23 @@ dependencies:
4444
- zstd=1.4.9=h19a0ad4_0
4545
- pip:
4646
- altgraph==0.17
47+
- click==8.0.1
48+
- colorama==0.4.4
4749
- coloredlogs==15.0.1
4850
- cycler==0.10.0
4951
- future==0.18.2
52+
- ghp-import==2.0.1
5053
- humanfriendly==9.2
54+
- importlib-metadata==4.6.1
55+
- jinja2==3.0.1
5156
- kiwisolver==1.3.1
57+
- markdown==3.3.4
58+
- markupsafe==2.0.1
5259
- matplotlib==3.4.2
60+
- mergedeep==1.3.4
61+
- mkdocs==1.2.1
5362
- opencv-contrib-python==4.5.2.54
63+
- packaging==21.0
5464
- pefile==2021.5.24
5565
- pyinstaller==4.3
5666
- pyinstaller-hooks-contrib==2021.2
@@ -60,5 +70,8 @@ dependencies:
6070
- python-dateutil==2.8.1
6171
- python-mpv==0.5.2
6272
- pywin32-ctypes==0.2.0
73+
- pyyaml-env-tag==0.1
6374
- screeninfo==0.6.7
75+
- watchdog==2.1.3
76+
- zipp==3.5.0
6477
prefix: C:\Users\win10\miniconda3\envs\build

funscript_editor/definitions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
elif os.path.exists(os.path.join(ROOT_DIR, '..', 'usr', 'share', os.path.basename(ROOT_DIR), 'docs')):
2525
APP_DOCUMENTATION_DIR = os.path.join(ROOT_DIR, '..', 'usr', 'share', os.path.basename(ROOT_DIR), 'docs', 'app', 'site')
2626
CODE_DOCUMENTATION_DIR = os.path.join(ROOT_DIR, '..', 'usr', 'share', os.path.basename(ROOT_DIR), 'docs', 'code', '_build', 'html')
27+
elif os.path.exists(os.path.join(ROOT_DIR, 'docs')):
28+
APP_DOCUMENTATION_DIR = os.path.join(ROOT_DIR, 'docs')
29+
CODE_DOCUMENTATION_DIR = '' # code documentation not included
2730
else:
2831
APP_DOCUMENTATION_DIR = ''
2932
CODE_DOCUMENTATION_DIR = ''

funscript_editor/ui/funscript_editor_window.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,20 @@ def __setup_ui_binding(self):
124124

125125
helpMenu = self.ui.menubar.addMenu("Help")
126126
# TODO we schold use an http server to show the documentation
127-
helpMenu.addAction("App Documentation", lambda : webbrowser.open(os.path.join(APP_DOCUMENTATION_DIR, 'index.html')))
128-
helpMenu.addAction("Code Documentation", lambda : webbrowser.open(os.path.join(CODE_DOCUMENTATION_DIR, 'index.html')))
127+
helpMenu.addAction("App Documentation", self.__open_docs)
128+
# helpMenu.addAction("Code Documentation", lambda : webbrowser.open(os.path.join(CODE_DOCUMENTATION_DIR, 'index.html')))
129129
helpMenu.addAction(str('Version '+VERSION))
130130
self.ui.seekBar.sliderReleased.connect(lambda: self.video_player.seek_frame(self.ui.seekBar.value()))
131131

132132
self.__openVideo.connect(self.__open_video)
133133
self.__generateFunscript.connect(self.__generate_funscript)
134134

135+
def __open_docs(self):
136+
app_docs = os.path.join(APP_DOCUMENTATION_DIR, 'index.html')
137+
self.__logger.info("Open Application Documentation: %s", app_docs)
138+
browser = webbrowser.get()
139+
browser.open_new(app_docs)
140+
135141
def __setup_shortcut_bindings(self):
136142
QtWidgets.QShortcut('CTRL+Left', self).activated.connect(self.__seek_prev)
137143
QtWidgets.QShortcut('CTRL+Right', self).activated.connect(self.__seek_next)

0 commit comments

Comments
 (0)