Skip to content

Commit

Permalink
Merge pull request #9 from voicevox-client/docs
Browse files Browse the repository at this point in the history
Fix: docs
  • Loading branch information
tuna2134 authored Mar 18, 2023
2 parents 6a0e8b1 + de1419a commit 6d1b4e6
Show file tree
Hide file tree
Showing 12 changed files with 259 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"esbonio.sphinx.confDir": ""
}
42 changes: 42 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
voicevox client for python.
===========================

Unoffical API wrapper that you can use voicevox easy!

Requirements
------------

``Voicevox engine`` only!

Well if you want install voicevox engine, please read
`this <https://github.com/VOICEVOX/voicevox_engine/blob/master/README.md>`__.

Install
-------

.. code:: sh
pip install voicevox-client
All that!

Example
-------

.. code:: python
from voicevox import Client
import asyncio
async def main():
async with Client() as client:
audio_query = await client.create_audio_query(
"こんにちは!", speaker=1
)
with open("voice.wav", "wb") as f:
f.write(await audio_query.synthesis())
if __name__ == "__main__":
asyncio.run(main())
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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

import os
import sys
sys.path.insert(0, os.path.abspath('../'))

project = 'voicevox-client'
copyright = '2023, tuna2134'
author = 'tuna2134'
release = '0.1.4'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'furo'
html_static_path = ['_static']
22 changes: 22 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. voicevox-client documentation master file, created by
sphinx-quickstart on Tue Mar 14 13:14:15 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to voicevox-client's documentation!
===========================================

.. toctree::
:maxdepth: 2
:caption: Contents:

voicevox
voicevox.types


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
python
======

.. toctree::
:maxdepth: 4

voicevox
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
furo
sphinx
61 changes: 61 additions & 0 deletions docs/voicevox.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
voicevox package
================

Subpackages
-----------

.. toctree::
:maxdepth: 4

voicevox.types

Submodules
----------

voicevox.audio\_query module
----------------------------

.. automodule:: voicevox.audio_query
:members:
:undoc-members:
:show-inheritance:

voicevox.client module
----------------------

.. automodule:: voicevox.client
:members:
:undoc-members:
:show-inheritance:

voicevox.errors module
----------------------

.. automodule:: voicevox.errors
:members:
:undoc-members:
:show-inheritance:

voicevox.http module
--------------------

.. automodule:: voicevox.http
:members:
:undoc-members:
:show-inheritance:

voicevox.speakers module
------------------------

.. automodule:: voicevox.speakers
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: voicevox
:members:
:undoc-members:
:show-inheritance:
29 changes: 29 additions & 0 deletions docs/voicevox.types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
voicevox.types package
======================

Submodules
----------

voicevox.types.audio\_query module
----------------------------------

.. automodule:: voicevox.types.audio_query
:members:
:undoc-members:
:show-inheritance:

voicevox.types.speakers module
------------------------------

.. automodule:: voicevox.types.speakers
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: voicevox.types
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_version():
return re.search(r'__version__ = "([^"]+)"', f.read()).group(1)


with open("README.md", "r", encoding='utf-8') as f:
with open("README.rst", "r", encoding='utf-8') as f:
long_description = f.read()


Expand All @@ -25,7 +25,7 @@ def get_version():
},
version=get_version(),
long_description=long_description,
long_description_content_type="text/markdown",
long_description_content_type="text/x-rst",
author="tuna2134",
license="MIT",
packages=["voicevox", "voicevox.types"],
Expand Down
2 changes: 1 addition & 1 deletion voicevox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
.. include:: ../README.md
.. include:: ../README.rst
"""

from .client import Client
Expand Down

0 comments on commit 6d1b4e6

Please sign in to comment.