mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-14 15:22:35 +00:00
Readthedocs support (#107)
Authored-by: shirtjs <2660574+shirtjs@users.noreply.github.com>
This commit is contained in:
parent
5b1ecbb327
commit
a17417e8ca
6 changed files with 49 additions and 64 deletions
23
.readthedocs.yml
Normal file
23
.readthedocs.yml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# .readthedocs.yaml
|
||||||
|
# Read the Docs configuration file
|
||||||
|
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||||
|
|
||||||
|
# Required
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
# Build documentation in the docs/ directory with Sphinx
|
||||||
|
sphinx:
|
||||||
|
configuration: docs/conf.py
|
||||||
|
|
||||||
|
# Optionally build your docs in additional formats such as PDF
|
||||||
|
formats:
|
||||||
|
- epub
|
||||||
|
- pdf
|
||||||
|
- htmlzip
|
||||||
|
|
||||||
|
# Optionally set the version of Python and requirements required to build your docs
|
||||||
|
python:
|
||||||
|
version: 3
|
||||||
|
install:
|
||||||
|
- requirements: docs/requirements.txt
|
||||||
|
- requirements: requirements.txt
|
33
docs/conf.py
33
docs/conf.py
|
@ -14,30 +14,33 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
# Allows to import youtube_dlc
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
# Allows to import yt-dlp
|
||||||
|
sys.path.insert(0, os.path.abspath('..'))
|
||||||
|
from recommonmark.transform import AutoStructify
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
|
# The suffix of source filenames.
|
||||||
|
source_suffix = ['.rst', '.md']
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [
|
extensions = [
|
||||||
'sphinx.ext.autodoc',
|
'sphinx.ext.autodoc',
|
||||||
|
'recommonmark',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ['_templates']
|
||||||
|
|
||||||
# The suffix of source filenames.
|
|
||||||
source_suffix = '.rst'
|
|
||||||
|
|
||||||
# The master toctree document.
|
# The master toctree document.
|
||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'youtube-dlc'
|
project = u'yt-dlp'
|
||||||
copyright = u'2014, Ricardo Garcia Gonzalez'
|
copyright = u'UNLICENSE'
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
|
@ -62,10 +65,20 @@ pygments_style = 'sphinx'
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
html_theme = 'default'
|
html_theme = 'default'
|
||||||
|
|
||||||
|
# Disable highlights
|
||||||
|
highlight_language = 'none'
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# 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,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
# html_static_path = ['_static']
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
|
||||||
htmlhelp_basename = 'youtube-dlcdoc'
|
def setup(app):
|
||||||
|
app.add_config_value('recommonmark_config', {
|
||||||
|
'enable_math': False,
|
||||||
|
'enable_inline_math': False,
|
||||||
|
'enable_eval_rst': True,
|
||||||
|
'enable_auto_toc_tree': True,
|
||||||
|
}, True)
|
||||||
|
app.add_transform(AutoStructify)
|
||||||
|
|
31
docs/faq.md
31
docs/faq.md
|
@ -1,31 +0,0 @@
|
||||||
- Q: How to redirect to another extractor?
|
|
||||||
- A:
|
|
||||||
- Most simple using only `url_result`
|
|
||||||
```
|
|
||||||
# get proper url first if needed.
|
|
||||||
return self.url_result(url)
|
|
||||||
```
|
|
||||||
- Using `_request_webpage` and `to_screen` in addition
|
|
||||||
```
|
|
||||||
urlh = self._request_webpage(
|
|
||||||
url, id, note='Downloading redirect page')
|
|
||||||
url = urlh.geturl()
|
|
||||||
self.to_screen('Following redirect: %s' % url)
|
|
||||||
return self.url_result(url)
|
|
||||||
```
|
|
||||||
- Using `return` construction
|
|
||||||
```
|
|
||||||
return {
|
|
||||||
'_type': 'url_transparent',
|
|
||||||
'url': url,
|
|
||||||
'ie_key': ExampleIE.ie_key(),
|
|
||||||
'id': id,
|
|
||||||
}
|
|
||||||
# Alternative if extractor supports internal uri like kaltura
|
|
||||||
return {
|
|
||||||
'_type': 'url_transparent',
|
|
||||||
'url': 'kaltura:%s:%s' % (partner_id, kaltura_id),
|
|
||||||
'ie_key': KalturaIE.ie_key(),
|
|
||||||
'id': id,
|
|
||||||
}
|
|
||||||
```
|
|
1
docs/index.md
Symbolic link
1
docs/index.md
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../README.md
|
|
@ -1,23 +0,0 @@
|
||||||
Welcome to youtube-dlc's documentation!
|
|
||||||
======================================
|
|
||||||
|
|
||||||
*youtube-dlc* is a command-line program to download videos from YouTube.com and more sites.
|
|
||||||
It can also be used in Python code.
|
|
||||||
|
|
||||||
Developer guide
|
|
||||||
---------------
|
|
||||||
|
|
||||||
This section contains information for using *youtube-dlc* from Python programs.
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 2
|
|
||||||
|
|
||||||
module_guide
|
|
||||||
|
|
||||||
Indices and tables
|
|
||||||
==================
|
|
||||||
|
|
||||||
* :ref:`genindex`
|
|
||||||
* :ref:`modindex`
|
|
||||||
* :ref:`search`
|
|
||||||
|
|
2
docs/requirements.txt
Normal file
2
docs/requirements.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
recommonmark>=0.6.0
|
||||||
|
m2r2
|
Loading…
Reference in a new issue