-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(sphinx): restructure documentation and update configuration
This commit significantly restructures the documentation and updates the Sphinx configuration. Key changes include: • Reorganize documentation files and structure • Add new RST files for CLI usage, introduction, and API reference • Update Sphinx configuration with new extensions and theme settings • Remove old documentation files • Update pyproject.toml with new documentation dependencies
- Loading branch information
Showing
22 changed files
with
747 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
CLI Usage | ||
========= | ||
|
||
The ``nrk-psapi`` library includes a command-line interface (CLI) script to interact with the API. Below are examples of how to use the CLI script. | ||
|
||
|
||
Browse Podcasts | ||
--------------- | ||
|
||
To browse podcasts by a specific letter: | ||
|
||
.. code-block:: bash | ||
poetry run nrk browse A | ||
Get Podcast | ||
----------- | ||
|
||
To get details of a specific podcast: | ||
|
||
.. code-block:: bash | ||
poetry run nrk podcast <podcast_id> | ||
To get episodes of a specific podcast: | ||
|
||
.. code-block:: bash | ||
poetry run nrk podcast <podcast_id> --episodes | ||
Get Episode | ||
----------- | ||
|
||
To get details of a specific episode: | ||
|
||
.. code-block:: bash | ||
poetry run nrk episode <podcast_id> <episode_id> | ||
To get metadata of a specific episode: | ||
|
||
.. code-block:: bash | ||
poetry run nrk episode <podcast_id> <episode_id> --metadata | ||
Build RSS Feed | ||
-------------- | ||
|
||
To build a RSS feed for a specific podcast: | ||
|
||
.. code-block:: bash | ||
poetry run nrk rss <podcast_id> <output_path> | ||
Search | ||
------ | ||
|
||
To search for podcasts or other content: | ||
|
||
.. code-block:: bash | ||
poetry run nrk search <query> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from importlib.metadata import Distribution | ||
from pathlib import Path | ||
import sys | ||
|
||
import sphinx_book_theme | ||
|
||
sys.path.insert(0, Path("../").resolve().as_posix()) | ||
|
||
project = 'NRK Podcast API' | ||
author = '@bendikrb' | ||
release = Distribution.from_name("nrk_psapi").version | ||
|
||
html_theme = "sphinx_book_theme" | ||
html_theme_path = [sphinx_book_theme.get_html_theme_path()] | ||
html_theme_options = { | ||
"repository_url": "https://github.com/bendikrb/nrk-psapi", | ||
"use_repository_button": True, | ||
} | ||
|
||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.autodoc.typehints", | ||
"sphinx.ext.viewcode", | ||
"sphinx_autodoc_typehints", | ||
"sphinx.ext.napoleon", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.autosectionlabel", | ||
"enum_tools.autoenum", | ||
] | ||
templates_path = ['_templates'] | ||
html_static_path = ["_static"] | ||
intersphinx_mapping = {"python": ("http://docs.python.org/3", None)} | ||
|
||
autodoc_typehints = "description" | ||
autodoc_typehints_description_target = "documented_params" | ||
|
||
source_suffix = '.rst' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Welcome to NRK Podcast API | ||
========================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
introduction.rst | ||
|
||
cli.rst | ||
|
||
reference.rst | ||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Introduction | ||
============ | ||
|
||
The ``NrkPodcastAPI`` library provides an asynchronous interface to interact with the NRK Podcast API. It allows users to fetch podcast data, episodes, series, and more using a variety of methods. | ||
|
||
Requirements | ||
------------ | ||
|
||
Rich requires Python 3.11 and above. | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
To install the library, use pip: | ||
|
||
.. code-block:: bash | ||
pip install nrk-psapi | ||
Usage | ||
----- | ||
|
||
To use the ``NrkPodcastAPI``, you need to create an instance of the class and call its methods asynchronously. | ||
|
||
Example: | ||
|
||
.. code-block:: python | ||
import asyncio | ||
from nrk_psapi import NrkPodcastAPI | ||
async def main(): | ||
async with NrkPodcastAPI(user_agent="YourApp/1.0") as api: | ||
podcasts = await api.get_all_podcasts() | ||
for podcast in podcasts: | ||
print(podcast.title) | ||
asyncio.run(main()) | ||
Logging | ||
------- | ||
|
||
The library uses a logger named ``nrk_psapi`` to log debug information. You can configure this logger to capture logs as needed. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Reference | ||
========= | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
reference/api.rst | ||
reference/caching.rst | ||
reference/utils.rst | ||
reference/rss.rst | ||
|
||
reference/catalog.rst | ||
reference/channels.rst | ||
reference/common.rst | ||
reference/metadata.rst | ||
reference/pages.rst | ||
reference/playback.rst | ||
reference/recommendations.rst | ||
reference/search.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Client | ||
====== | ||
|
||
.. autoclass:: nrk_psapi.api.NrkPodcastAPI | ||
:members: | ||
:undoc-members: | ||
:exclude-members: close, request_header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Caching | ||
======= | ||
|
||
.. automodule:: nrk_psapi.caching | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Catalog | ||
======= | ||
|
||
.. automodule:: nrk_psapi.models.catalog | ||
:members: Availability, Contributor, Episode, EpisodeContext, EpisodeType, Image, IndexPoint, Link, Podcast, PodcastSequential, PodcastSeries, PodcastStandard, PodcastType, PodcastUmbrella, Program, ProgramInformation, ProgramInformationDetails, Season, SeasonBase, SeasonDisplayType, SeasonEmbedded, Series, SeriesType, Titles, UsageRights | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Channels | ||
======== | ||
|
||
.. automodule:: nrk_psapi.models.channels | ||
:members: Channel, ChannelEntry, ChannelImage, ChannelType, DistrictChannel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Common | ||
====== | ||
|
||
.. automodule:: nrk_psapi.models.common | ||
:members: IpCheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Metadata | ||
======== | ||
|
||
.. automodule:: nrk_psapi.models.metadata | ||
:members: Manifest, PodcastEpisodeMetadata, PodcastMetadata, PodcastMetadataEmbedded, Preplay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Pages | ||
===== | ||
|
||
.. automodule:: nrk_psapi.models.pages | ||
:members: ChannelPlug, Curated, CuratedPodcast, CuratedSection, EpisodePlug, Included, IncludedSection, LinkPlug, Page, PageListItem, PagePlug, Pages, PlaceholderSection, Plug, PluggedChannel, PluggedEpisode, PluggedPodcast, PluggedPodcastEpisode, PluggedPodcastSeason, PluggedSeries, PluggedStandaloneProgram, PlugType, PodcastEpisodePlug, PodcastPlug, PodcastSeasonPlug, Section, SeriesPlug, StandaloneProgramPlug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Playback | ||
======== | ||
|
||
.. automodule:: nrk_psapi.models.playback | ||
:members: AvailabilityDetailed, Playable, PodcastManifest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Recommendations | ||
=============== | ||
|
||
.. automodule:: nrk_psapi.models.recommendations | ||
:members: Recommendation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
RSS | ||
=== | ||
|
||
.. autoclass:: nrk_psapi.rss.NrkPodcastFeed | ||
:members: | ||
:undoc-members: | ||
:exclude-members: api, base_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Search | ||
====== | ||
|
||
.. automodule:: nrk_psapi.models.search | ||
:members: CategoriesResponse, LetterListItem, PodcastSearchResponse, SearchedSeries, SearchResponse, SearchResponseResultCategory, SearchResponseResultChannel, SearchResponseResultCustomSeason, SearchResponseResultCustomSeasonEpisode, SearchResponseResultEpisode, SearchResponseResultPodcast, SearchResponseResultSeries, SearchResponseResultSeriesEpisode, SearchResultType, SeriesListItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Utilities | ||
========= | ||
|
||
.. automodule:: nrk_psapi.utils | ||
:members: |
Oops, something went wrong.