Skip to content

Commit

Permalink
[DOCS] Rewrite getting started guide (#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbannon authored Dec 21, 2024
1 parent ebe9908 commit 07d8101
Show file tree
Hide file tree
Showing 11 changed files with 386 additions and 298 deletions.
2 changes: 1 addition & 1 deletion docs/source/config_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This section contains direct references to the code of ``ytdl-sub`` and informat

.. toctree::
config_yaml
subscriptions_yaml
subscription_yaml
plugins
scripting/index
prebuilt_presets/index
121 changes: 121 additions & 0 deletions docs/source/config_reference/subscription_yaml.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
==================
Subscription File
==================

A subscription file is designed to both define and organize many things
to download in condensed YAML.

.. hint::

Read the :ref:`getting started guide <guides/getting_started/index:Getting Started>`
first before reviewing this section.

File Preset
-----------
Many examples show ``__preset__`` at the top. This is known as the *subscription file preset*.
It is where a single :ref:`preset <guides/getting_started/first_config:Custom Preset Definition>`
can be defined that gets applied to each subscription within the file.

This is a good place to apply file-wide variables such as ``tv_show_directory`` or
supply a cookies file path.

.. code-block:: yaml
__preset__:
overrides:
tv_show_directory: "/tv_shows"
ytdl_options:
cookiefile: "/config/cookie.txt"
Layout
------
A subscription file is comprised of YAML keys and values. Keys can be either

- a preset
- an override value
- a subscription name

Take the following example:

.. code-block:: yaml
Jellyfin TV Show by Date:
= News:
"Breaking News": "https://www.youtube.com/@SomeBreakingNews"
"BBC News": "https://www.youtube.com/@BBCNews"
All three types of keys are used for the following:

- ``Jellyfin TV Show by Date`` - a prebuilt preset
- ``= News`` - an override value for genre
- ``Breaking News``, ``BBC News`` - The subscription names

The bottom-most keys, or leaf keys, should always be the subscription name.
It is good practice to put subscription names in quotes to differentiate
between preset names and subscription names.

Values should always be the subscription itself. The simplest form is
just the URL. Further sections will show more exotic examples that go beyond
a single URL.


Inheritance
-----------
A subscription inherits every key above it. In the above example,
both ``Breaking News`` and ``BBC News`` inherits the ``Jellyfin TV Show by Date``
preset and the ``= News`` override value.

.. note::

There are no limits or boundaries on how one structures
their presets. This flexibility is intended for subscription authors
to organize their downloads as they see fit.

Multi Keys
----------
Subscription keys support pipe syntax, or ``|``, which allows multiple
keys to be defined on a single line. The following is equivalent to the above
example:

.. code-block:: yaml
Jellyfin TV Show by Date | = News:
"Breaking News": "https://www.youtube.com/@SomeBreakingNews"
"BBC News": "https://www.youtube.com/@BBCNews"
Override Mode
-------------
Often times, it is convenient to set multiple override values for
a single subscription. We can put a preset in *override mode* by
using tilda syntax, or ``~``.

Suppose we want to apply the :ref:`Only Recent <prebuilt_presets/helpers:Only Recent>`
preset to the above examples. But for ``BBC News`` specifically, we want to
set the date range to be different than the default ``2months`` value to
``2weeks``.

We can change it as follows:

.. code-block:: yaml
Jellyfin TV Show by Date
= News | Only Recent:
"Breaking News": "https://www.youtube.com/@SomeBreakingNews"
"~BBC News":
url: "https://www.youtube.com/@BBCNews"
only_recent_date_range: "2weeks"
.. important::

When using override mode, we need to set the ``url``
variable since we are no longer using the simplified
*subscription_value*. For more info on how this works,
read about :ref:`subscription variables <config_reference/scripting/static_variables:Subscription Variables>`.

Map Mode
--------
Map mode is for highly advanced presets that benefit
from a more complex subscription definition. TODO: Show music video
example here.
114 changes: 0 additions & 114 deletions docs/source/config_reference/subscriptions_yaml.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/deprecation_notices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Oct 2023
subscription preset and value
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The use of ``__value__`` will go away in Dec 2023 in favor of the method found in
:ref:`config_reference/subscriptions_yaml:beautifying subscriptions`. ``__preset__`` will still be supported for the time being.
:ref:`config_reference/subscription_yaml:Subscription File`. ``__preset__`` will still be supported for the time being.

July 2023
---------
Expand Down
56 changes: 0 additions & 56 deletions docs/source/guides/getting_started/advanced_configuration.rst

This file was deleted.

4 changes: 3 additions & 1 deletion docs/source/guides/getting_started/automating_downloads.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Automating Downloads
====================

One of the key capabilities of ``ytdl-sub`` is how well it runs without user input, but to take advantage of this you must set up scheduling to execute the commands at some interval. How you set up this scheduling depends on which version of ``ytdl-sub`` you downloaded.
One of the key capabilities of ``ytdl-sub`` automating new downloads.
To take advantage of this, you must set up scheduling to execute the commands at some interval.
How you set up this scheduling depends on which version of ``ytdl-sub`` you downloaded.


:ref:`Guide for Docker and Unraid Containers <guides/getting_started/automating_downloads:docker and unraid>`
Expand Down
15 changes: 0 additions & 15 deletions docs/source/guides/getting_started/examples.rst

This file was deleted.

Loading

0 comments on commit 07d8101

Please sign in to comment.