diff --git a/Makefile b/Makefile index 30ca26b3..f5ec4228 100644 --- a/Makefile +++ b/Makefile @@ -41,14 +41,14 @@ executable: clean pyinstaller ytdl-sub.spec mv dist/ytdl-sub dist/ytdl-sub${EXEC_SUFFIX} docs: - sphinx-build -a -b html docs docs/_html + sphinx-build -M html docs/source/ docs/build/ clean: rm -rf \ .pytest_cache/ \ build/ \ dist/ \ src/ytdl_sub.egg-info/ \ - docs/_html/ \ + docs/build/ \ .coverage \ docker/root/*.whl \ docker/root/defaults/examples \ diff --git a/docs/Makefile b/docs/Makefile index d4bb2cbb..d0c3cbf1 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,8 +5,8 @@ # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build +SOURCEDIR = source +BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 47a478be..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,67 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -import sys - -sys.path.insert(0, os.path.abspath("../src")) - - -# -- Project information ----------------------------------------------------- - -project = "ytdl-sub" -copyright = "2022, Jesse Bannon" -author = "Jesse Bannon" - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.napoleon", -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = "sphinx_rtd_theme" - -html_theme_options = {"navigation_depth": 10} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ["_static"] - -# Do not show full module path in api docs -add_module_names = False -python_use_unqualified_type_names = False -napoleon_numpy_docstrings = True -napoleon_use_rtype = False - -# -- Options for autodocs ------------------------------------------------- - -autodoc_default_options = {"autodoc_typehints_format": "short"} diff --git a/docs/getting_started.rst b/docs/getting_started.rst deleted file mode 100644 index 8e1d449f..00000000 --- a/docs/getting_started.rst +++ /dev/null @@ -1,29 +0,0 @@ -Getting Started -=============== - -Walk-through Guide -------------------- -If you haven't read it yet, it's highly recommended to go through our -`walk-through guide `_ -to get familiar with how ``ytdl-sub`` works. - -Example Configs ---------------- -If you are ready to start downloading, see our -`examples directory `_ -for ready-to-use configs and subscriptions. Read through them carefully before use. - -Using Example Configs -^^^^^^^^^^^^^^^^^^^^^^ -Copy and paste the examples into local yaml files, modify the -``working_directory`` and ``output_directory`` with your desired paths, -and perform a dry-run using - -.. code-block:: bash - - ytdl-sub \ - --dry-run \ - --config path/to/config.yaml \ - sub path/to/subscriptions.yaml - -This will simulate what a download will look like. diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 246ff447..00000000 --- a/docs/index.rst +++ /dev/null @@ -1,29 +0,0 @@ -ytdl-sub readthedocs -==================== - -Our readthedocs page is dedicated towards ytdl-sub config documentation. - -If you are new to ytdl-sub, head over to the -`GitHub Wiki `_ -to see our -`walkthrough `_ and -`FAQ `_. For full examples of -ytdl-sub configs, check out the -`examples directory `_. - - -For navigating config docs, use the left-side bar on the -:ref:`config` page to find every available ytdl-sub field. - -Contents -======== - -.. toctree:: - :maxdepth: 2 - - install - usage - getting_started - presets - config - deprecation_notices diff --git a/docs/make.bat b/docs/make.bat index 32bb2452..747ffb7b 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -7,8 +7,8 @@ REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) -set SOURCEDIR=. -set BUILDDIR=_build +set SOURCEDIR=source +set BUILDDIR=build %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..9c199017 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,59 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'ytdl-sub' +copyright = '2023, Jesse Bannon' +author = 'Jesse Bannon' +release = '2023.12.15' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + ] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_book_theme" + +html_theme_options = { + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/jmbannon/ytdl-sub", + "icon": "fa-brands fa-square-github", + "type": "fontawesome", + }, + { + "name": "Discord", + "url": "https://discord.gg/v8j9RAHb4k", + "icon": "https://img.shields.io/discord/994270357957648404?logo=Discord", + "type": "url", + }, + ], + "announcement": ( + "Migration to beautiful subscriptions is now live" + ), +} + +html_sidebars ={ + # "**": [ + # "globaltoc.html", + # "sourcelink.html", + # "searchbox.html" + # ], +} + +html_static_path = ['_static'] diff --git a/docs/config.rst b/docs/source/config.rst similarity index 100% rename from docs/config.rst rename to docs/source/config.rst diff --git a/docs/deprecation_notices.rst b/docs/source/deprecation_notices.rst similarity index 100% rename from docs/deprecation_notices.rst rename to docs/source/deprecation_notices.rst diff --git a/docs/source/guides/development/index.rst b/docs/source/guides/development/index.rst new file mode 100644 index 00000000..e606005d --- /dev/null +++ b/docs/source/guides/development/index.rst @@ -0,0 +1,5 @@ +Development and Contributing +============================ + +.. toctree:: + \ No newline at end of file diff --git a/docs/source/guides/getting_started/examples.rst b/docs/source/guides/getting_started/examples.rst new file mode 100644 index 00000000..a8dcd75b --- /dev/null +++ b/docs/source/guides/getting_started/examples.rst @@ -0,0 +1,14 @@ +Using Example Configs +^^^^^^^^^^^^^^^^^^^^^^ +Copy and paste the examples into local yaml files, modify the +``working_directory`` and ``output_directory`` with your desired paths, +and perform a dry-run using + +.. code-block:: bash + + ytdl-sub \ + --dry-run \ + --config path/to/config.yaml \ + sub path/to/subscriptions.yaml + +This will simulate what a download will look like. \ No newline at end of file diff --git a/docs/source/guides/getting_started/index.rst b/docs/source/guides/getting_started/index.rst new file mode 100644 index 00000000..112ee1e4 --- /dev/null +++ b/docs/source/guides/getting_started/index.rst @@ -0,0 +1,7 @@ +Getting Started +=============== + +.. toctree:: + initial_setup + prebuilt_presets + examples \ No newline at end of file diff --git a/docs/source/guides/getting_started/initial_setup.rst b/docs/source/guides/getting_started/initial_setup.rst new file mode 100644 index 00000000..b0584d52 --- /dev/null +++ b/docs/source/guides/getting_started/initial_setup.rst @@ -0,0 +1,5 @@ +Initial Setup +============= +If you haven't read it yet, it's highly recommended to go through our +`walk-through guide `_ +to get familiar with how ``ytdl-sub`` works. \ No newline at end of file diff --git a/docs/source/guides/getting_started/prebuilt_presets.rst b/docs/source/guides/getting_started/prebuilt_presets.rst new file mode 100644 index 00000000..57ea0a45 --- /dev/null +++ b/docs/source/guides/getting_started/prebuilt_presets.rst @@ -0,0 +1,5 @@ +Example Configs +=============== +If you are ready to start downloading, see our +`examples directory `_ +for ready-to-use configs and subscriptions. Read through them carefully before use. \ No newline at end of file diff --git a/docs/source/guides/index.rst b/docs/source/guides/index.rst new file mode 100644 index 00000000..d6bba6ce --- /dev/null +++ b/docs/source/guides/index.rst @@ -0,0 +1,7 @@ +Guides +====== + +.. toctree:: + install/index + getting_started/index + development/index \ No newline at end of file diff --git a/docs/source/guides/install/agnostic.rst b/docs/source/guides/install/agnostic.rst new file mode 100644 index 00000000..de3a4671 --- /dev/null +++ b/docs/source/guides/install/agnostic.rst @@ -0,0 +1,35 @@ +Environment Agnostic +==================== + +PIP Install +-------------- +You can install our +`PyPI package `_. +Both ffmpeg and Python 3.10 or greater are required. + +.. code-block:: bash + + python3 -m pip install -U ytdl-sub + +Local Install +-------------- +With a Python 3.10 virtual environment, you can clone and install the repo. + +.. code-block:: bash + + git clone https://github.com/jmbannon/ytdl-sub.git + cd ytdl-sub + + pip install -e . + +Local Docker Build +------------------- +Run ``make docker`` in the root directory of this repo to build the image. This +will build the python wheel and install it in the Dockerfile. + +.. code-block:: bash + + git clone https://github.com/jmbannon/ytdl-sub.git + cd ytdl-sub + + make docker \ No newline at end of file diff --git a/docs/install.rst b/docs/source/guides/install/docker.rst similarity index 57% rename from docs/install.rst rename to docs/source/guides/install/docker.rst index bea0667b..c85d2603 100644 --- a/docs/install.rst +++ b/docs/source/guides/install/docker.rst @@ -1,11 +1,5 @@ -Install -======= -``ytdl-sub`` can be installed on the following platforms. - -.. contents:: - :depth: 3 - -All installations require a 64-bit CPU. 32-bit is not supported. +Docker +====== Docker Compose -------------- @@ -79,8 +73,8 @@ via exec'ing into the image using the command: - :/music # optional restart: unless-stopped -Passthrough -^^^^^^^^^^^ +CPU/GPU Passthrough +^^^^^^^^^^^^^^^^^^^ For CPU or GPU passthrough, you must use either the GUI image or the headless Ubuntu image ``ghcr.io/jmbannon/ytdl-sub:ubuntu-latest``. @@ -141,7 +135,7 @@ ____ - capabilities: [gpu] # GPU passthrough restart: unless-stopped -Docker +Docker CLI -------------- .. code-block:: bash @@ -157,100 +151,4 @@ Docker -v :/music_videos \ -v :/music \ --restart unless-stopped \ - ghcr.io/jmbannon/ytdl-sub-gui:latest - -Windows --------------- -From powershell, run: - -.. code-block:: powershell - - # Download ffmpeg/ffprobe dependencies from yt-dlp - curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip - tar -xf ffmpeg.zip - move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe" - move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe" - - # Download ytdl-sub - curl.exe -L -o ytdl-sub.exe https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub.exe - ytdl-sub.exe -h - -Unraid --------------- -See the -`community app `_ -``ytdl-sub``. Uses Docker under the hood. - -Linux --------------- -Requires ffmpeg as a dependency. Can typically be installed with any Linux package manager. - -.. code-block:: bash - - curl -L -o ytdl-sub https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub - chmod +x ytdl-sub - ytdl-sub -h - -You can also install using yt-dlp's ffmpeg builds. This ensures your ffmpeg is up to date: - -.. code-block:: bash - - curl -L -o ffmpeg.tar.gz https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz - tar -xf ffmpeg.tar.gz - chmod +x ffmpeg-master-latest-linux64-gpl/bin/ffmpeg - chmod +x ffmpeg-master-latest-linux64-gpl/bin/ffprobe - - # May need sudo / root permissions to perform - mv ffmpeg-master-latest-linux64-gpl/bin/ffmpeg /usr/bin/ffmpeg - mv ffmpeg-master-latest-linux64-gpl/bin/ffprobe /usr/bin/ffprobe - -Linux ARM --------------- -Requires ffmpeg as a dependency. Can typically be installed with any Linux package manager. - -.. code-block:: bash - - curl -L -o ytdl-sub https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub_aarch64 - chmod +x ytdl-sub - ytdl-sub -h - -You can also install using yt-dlp's ffmpeg builds. This ensures your ffmpeg is up to date: - -.. code-block:: bash - - curl -L -o ffmpeg.tar.gz https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linuxarm64-gpl.tar.xz - tar -xf ffmpeg.tar.gz - chmod +x ffmpeg-master-latest-linuxarm64-gpl/bin/ffmpeg - chmod +x ffmpeg-master-latest-linuxarm64-gpl/bin/ffprobe - - # May need sudo / root permissions to perform - mv ffmpeg-master-latest-linuxarm64-gpl/bin/ffmpeg /usr/bin/ffmpeg - mv ffmpeg-master-latest-linuxarm64-gpl/bin/ffprobe /usr/bin/ffprobe - - -PIP --------------- -You can install our -`PyPI package `_. -Both ffmpeg and Python 3.10 or greater are required. - -.. code-block:: bash - - python3 -m pip install -U ytdl-sub - -Local Install --------------- -With a Python 3.10 virtual environment, you can clone and install the repo using - -.. code-block:: bash - - git clone https://github.com/jmbannon/ytdl-sub.git - cd ytdl-sub - - pip install -e . - -Local Docker Build -------------------- -Run ``make docker`` in the root directory of this repo to build the image. This -will build the python wheel and install it in the Dockerfile. - + ghcr.io/jmbannon/ytdl-sub-gui:latest \ No newline at end of file diff --git a/docs/source/guides/install/index.rst b/docs/source/guides/install/index.rst new file mode 100644 index 00000000..935b6ee4 --- /dev/null +++ b/docs/source/guides/install/index.rst @@ -0,0 +1,12 @@ +Install by Platform +=================== +``ytdl-sub`` can be installed on the following platforms. + +All installations require a 64-bit CPU. 32-bit is not supported. + +.. toctree:: + docker + linux + unraid + windows + agnostic diff --git a/docs/source/guides/install/linux.rst b/docs/source/guides/install/linux.rst new file mode 100644 index 00000000..0c222aa8 --- /dev/null +++ b/docs/source/guides/install/linux.rst @@ -0,0 +1,45 @@ +Linux +-------------- +Requires ffmpeg as a dependency. Can typically be installed with any Linux package manager. + +.. code-block:: bash + + curl -L -o ytdl-sub https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub + chmod +x ytdl-sub + ytdl-sub -h + +You can also install using yt-dlp's ffmpeg builds. This ensures your ffmpeg is up to date: + +.. code-block:: bash + + curl -L -o ffmpeg.tar.gz https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz + tar -xf ffmpeg.tar.gz + chmod +x ffmpeg-master-latest-linux64-gpl/bin/ffmpeg + chmod +x ffmpeg-master-latest-linux64-gpl/bin/ffprobe + + # May need sudo / root permissions to perform + mv ffmpeg-master-latest-linux64-gpl/bin/ffmpeg /usr/bin/ffmpeg + mv ffmpeg-master-latest-linux64-gpl/bin/ffprobe /usr/bin/ffprobe + +Linux ARM +-------------- +Requires ffmpeg as a dependency. Can typically be installed with any Linux package manager. + +.. code-block:: bash + + curl -L -o ytdl-sub https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub_aarch64 + chmod +x ytdl-sub + ytdl-sub -h + +You can also install using yt-dlp's ffmpeg builds. This ensures your ffmpeg is up to date: + +.. code-block:: bash + + curl -L -o ffmpeg.tar.gz https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linuxarm64-gpl.tar.xz + tar -xf ffmpeg.tar.gz + chmod +x ffmpeg-master-latest-linuxarm64-gpl/bin/ffmpeg + chmod +x ffmpeg-master-latest-linuxarm64-gpl/bin/ffprobe + + # May need sudo / root permissions to perform + mv ffmpeg-master-latest-linuxarm64-gpl/bin/ffmpeg /usr/bin/ffmpeg + mv ffmpeg-master-latest-linuxarm64-gpl/bin/ffprobe /usr/bin/ffprobe \ No newline at end of file diff --git a/docs/source/guides/install/unraid.rst b/docs/source/guides/install/unraid.rst new file mode 100644 index 00000000..5953a526 --- /dev/null +++ b/docs/source/guides/install/unraid.rst @@ -0,0 +1,5 @@ +Unraid +-------------- +See the +`community app `_ +``ytdl-sub``. Uses Docker under the hood. \ No newline at end of file diff --git a/docs/source/guides/install/windows.rst b/docs/source/guides/install/windows.rst new file mode 100644 index 00000000..c3cfb0ed --- /dev/null +++ b/docs/source/guides/install/windows.rst @@ -0,0 +1,15 @@ +Windows +-------------- +From powershell, run: + +.. code-block:: powershell + + # Download ffmpeg/ffprobe dependencies from yt-dlp + curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip + tar -xf ffmpeg.zip + move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe" + move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe" + + # Download ytdl-sub + curl.exe -L -o ytdl-sub.exe https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub.exe + ytdl-sub.exe -h \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..1f4e35eb --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,23 @@ +.. ytdl-sub documentation master file, created by + sphinx-quickstart on Fri Dec 15 21:08:10 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to ytdl-sub's documentation! +==================================== +.. toctree:: + :maxdepth: 1 + + guides/index + config + deprecation_notices + presets + usage + +.. note:: End goal: https://picard-docs.musicbrainz.org/en/functions/list_by_type.html + + - step-by-step noob install instructions for each platform + - pages for each prebuilt preset, showing which variables that can be overridden to do different things (i.e. episode_title) + - new wiki walkthrough that uses the README config as a starting point, and gradually adds custom changes + - pages for how to enable custom metadata agents for Kodi/Plex/jellyfin + - page dedicated to explaining the structure of a config (it's only lightly touched on now, many folks struggle to understand the 'pattern' of presets/plugins/overrides) diff --git a/docs/presets.rst b/docs/source/presets.rst similarity index 100% rename from docs/presets.rst rename to docs/source/presets.rst diff --git a/docs/usage.rst b/docs/source/usage.rst similarity index 100% rename from docs/usage.rst rename to docs/source/usage.rst