diff --git a/sample-docs/kitchen-sink/all_in_one_restructuredtext.py b/sample-docs/kitchen-sink/all_in_one_restructuredtext.py new file mode 100644 index 000000000..e22b1d45c --- /dev/null +++ b/sample-docs/kitchen-sink/all_in_one_restructuredtext.py @@ -0,0 +1,305 @@ +""" +This is the module-level docstring of the module :py:mod:`all_in_one_restructuredtext`. + +The module's docstrings use reStructuredText markup. +""" + +# TODO: +# - show roles to refer to elements +# - async with +# - async for +# - Python 3.12 type parameters +# - add example of numpy-style docstrings + +import abc +from typing import TypeAlias, TypeVar, final + +ParameterT = TypeVar("ParameterT") #: Docstring of type ParameterT + +ReturnT = TypeVar("ReturnT") +"""Docstring of type ReturnT.""" + +# Python 3.12: type MyType = list[float] #: The docstring. +MyType: TypeAlias = list[float] #: The docstring. + +my_module_level_variable: MyType = [0.0, 1.1] #: The docstring. + + +def my_function_pure_sphinx(*args, **kwargs): + r''' + This function accepts any number of arguments and keyword arguments. + + Note: + If you do *not* use ``sphinx.ext.napoleon``: + + In the source code, + the docstring for this function is a "raw" docstring using ``r"""..."""``, + and ``*args`` and ``**kwargs`` below are escaped with a backslash + (``\*args`` and ``\*\*kwargs``). + + See also https://github.com/sphinx-doc/sphinx/issues/9893. + + :param \*args: Variable length argument list. + :param \*\*kwargs: Arbitrary keyword arguments. + + :return: None + + Text at end of docstring. + ''' + pass + + +def my_function_google_style(*args, **kwargs): + r''' + This function accepts any number of arguments and keyword arguments. + + Note: + If you do *not* use ``sphinx.ext.napoleon``: + + In the source code, + the docstring for this function is a "raw" docstring using ``r"""..."""``, + and ``*args`` and ``**kwargs`` below are escaped with a backslash + (``\*args`` and ``\*\*kwargs``). + + See also https://github.com/sphinx-doc/sphinx/issues/9893. + + Args: + \*args: Variable length argument list. + \*\*kwargs: Arbitrary keyword arguments. + + Returns: + None + + Text at end of docstring. + ''' + pass + + +def my_function_needs_napoleon(*args, **kwargs): + """ + This function accepts any number of arguments and keyword arguments. + + Note: + If you use ``sphinx.ext.napoleon`` (and only then), + there is no need to escape ``*args`` and ``**kwargs`` below. + + Args: + *args: Variable length argument list. + **kwargs: Arbitrary keyword arguments. + + Returns: + None + + Text at end of docstring. + """ + pass + + +def my_function2(foo: int, bar: str): + """ + A simple function. + + Args: + foo: A regular argument. + bar: Another regular argument. + + Returns: + None + + .. deprecated:: 2.0 + Use :func:`my_function_pure_sphinx` instead. + + Text at end of docstring. + """ + pass + + +def my_generator(): + """A generator. + + Yields: + None + """ + yield None + + +class MyException(Exception): + """Custom exception class.""" + + pass + + +class AllInOne: + """This is a class that demonstrates various Python features. + + Uses Google-style docstrings + (https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html). + + + Attributes: + _my_property: A private property of the class. + """ + + __metaclass__ = abc.ABCMeta + + def __init__(self): + """Initialize the :py:class:`AllInOne` class.""" + pass + + def my_method( + self, my_param: ParameterT = "default_value", /, *, keyword_only_param=None + ) -> ReturnT: + """A normal method. + + We are using both positional-only and keyword-only syntax. + + Here is some code in a literal block:: + + foo = True # assign ``True`` + + Note: + Do not include the *self* parameter in the ``Args`` section. + + Args: + my_param: Documenting *my_param*. + Another sentence on the next docstring line, still belonging to *my_param*. + keyword_only_param: Documenting *keyword_only_param*. + Another sentence on the next docstring line, still belonging to *keyword_only_param*. + + Returns: + The value of the local variable ``my_var``. + + Raises: + :py:exc:`MyException`: if something went wrong. + + Example: + >>> retval = my_method() # doctest format + "return_value" + + Text at end of docstring. + """ + my_var: ReturnT = "return_value" + return my_var + + async def my_async_method(self, my_param: ParameterT = "default_value") -> ReturnT: + """An :term:`async` method. + + Text at end of docstring. + """ + self.my_var: ReturnT = "return_value" + return self.my_var + + @abc.abstractmethod + def my_abstractmethod(my_param: ParameterT = "default_value") -> ReturnT: + """An abstract method. + + Text at end of docstring. + """ + my_var: ReturnT = "return_value" + return my_var + + @classmethod + def my_classmethod(cls, my_param: ParameterT = "default_value") -> ReturnT: + """A :any:`classmethod`. + + Text at end of docstring. + """ + my_var: ReturnT = "return_value" + return my_var + + @staticmethod + def my_staticmethod(my_param: ParameterT = "default_value") -> ReturnT: + """A :any:`staticmethod`. + + Text at end of docstring. + """ + my_var: ReturnT = "return_value" + return my_var + + @property + def my_property(self): + """ + Getter for the private property :py:attr:`_my_property`. + + Returns: + The value of :py:attr:`_my_property`. + + Text at end of docstring. + """ + return self._my_property + + @my_property.setter + def my_property(self, value): + """ + Setter for the private property :py:attr:`_my_property`. + + Args: + value: The value to set :py:attr:`_my_property` to. + + Text at end of docstring. + """ + self._my_property = value + + def my_decorator_method(method): + """ + A decorator method that wraps the provided method. + + Args: + method: The method to decorate. + + Returns: + The decorated method. + + Text at end of docstring. + """ + + def decorate_method(): + """The decorated method.""" + method() + + return decorate_method + + @my_decorator_method + def my_decorated_method(): + """A method that is decorated by :py:meth:`my_decorator_method`.""" + pass + + +@final +class MyFinalClass: + """A class that cannot be subclassed.""" + + @final + def my_final_method(self) -> None: + """A method that cannot be overridden by subclasses.""" + pass + + +def my_decorator_function(function): + """ + A decorator function that wraps the provided function. + + Args: + function: The function to decorate. + + Returns: + The decorated function. + + Text at end of docstring. + """ + + def decorate_function(): + """The decorated function.""" + function() + + return decorate_function + + +@my_decorator_function +def my_decorated_function(): + """ + A function that is decorated by the :py:func:`my_decorator_function`. + + This docstring is not shown, just the one of ``decorate_function()``. + """ + pass diff --git a/sample-docs/kitchen-sink/api.rst b/sample-docs/kitchen-sink/api.rst index 877636b81..4acc24b0c 100644 --- a/sample-docs/kitchen-sink/api.rst +++ b/sample-docs/kitchen-sink/api.rst @@ -7,6 +7,15 @@ API documentation ***************** +.. toctree:: + :titlesonly: + :glob: + + domains/api_*_domain + +Using autodoc +============= + Using Sphinx's :any:`sphinx.ext.autodoc` plugin, it is possible to auto-generate documentation of a Python module. .. tip:: @@ -25,5 +34,14 @@ Using Sphinx's :any:`sphinx.ext.autodoc` plugin, it is possible to auto-generate # Don't show class signature with the class' name. autodoc_class_signature = "separated" -.. automodule:: urllib.parse + +The ``automodule`` Directive with reStructuredText Markup +--------------------------------------------------------- + +What follows is an example showing usage of the ``.. automodule::`` directive. + +.. currentmodule:: all_in_one_restructuredtext + +.. automodule:: all_in_one_restructuredtext :members: + :member-order: bysource diff --git a/sample-docs/kitchen-sink/domains/api_c_domain.rst b/sample-docs/kitchen-sink/domains/api_c_domain.rst new file mode 100644 index 000000000..3dd884b7a --- /dev/null +++ b/sample-docs/kitchen-sink/domains/api_c_domain.rst @@ -0,0 +1,56 @@ +.. + Copyright (c) 2021 Pradyun Gedam + Licensed under Creative Commons Attribution-ShareAlike 4.0 International License + SPDX-License-Identifier: CC-BY-SA-4.0 + +Directives in the C domain +-------------------------- + +The domain name is ``c``, see https://www.sphinx-doc.org/en/master/usage/domains/c.html + +.. c:member:: PyObject *PyTypeObject.tp_bases + + The ``.. c:member::`` directive, showing a struct member. + +.. c:var:: int my_var + + The ``.. c:var::`` directive, showing a variable. + +.. c:function:: PyObject *PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems) + + The ``.. c:function::`` directive, showing a function. The signature should be given as in C. + + :param type: description of the first parameter. + :param nitems: description of the second parameter. + :returns: a result. + :retval NULL: under some conditions. + :retval NULL: under some other conditions as well. + +.. c:macro:: MY_MACRO + + The ``.. c:macro::`` directive, showing a macro, i.e., a C-language #define, without the replacement text. + +.. c:macro:: MY_MACRO_ARGS(arg_list) + :single-line-parameter-list: + + The ``.. c:macro::`` directive, showing a macro, i.e., a C-language #define, without the replacement text. + +.. c:struct:: MyStruct + + The ``.. c:struct::`` directive, showing a struct. + +.. c:union:: MyUnion + + The ``.. c:union::`` directive, showing a union. + +.. c:enum:: MyEnum + + The ``.. c:enum::`` directive, showing an enum. + +.. c:enumerator:: myEnumerator + + The ``.. c:enumerator::`` directive, showing an enumerator. + +.. c:type:: my_type + + The ``.. c:type::`` directive, showing a type. diff --git a/sample-docs/kitchen-sink/domains/api_cpp_domain.rst b/sample-docs/kitchen-sink/domains/api_cpp_domain.rst new file mode 100644 index 000000000..4188fdf3a --- /dev/null +++ b/sample-docs/kitchen-sink/domains/api_cpp_domain.rst @@ -0,0 +1,136 @@ +.. + Copyright (c) 2021 Pradyun Gedam + Licensed under Creative Commons Attribution-ShareAlike 4.0 International License + SPDX-License-Identifier: CC-BY-SA-4.0 + +Directives in the C++ domain +---------------------------- + +The domain name is ``cpp``, see https://www.sphinx-doc.org/en/master/usage/domains/cpp.html. + +The following directives are available. All declarations can start with a +visibility statement (``public``, ``private`` or ``protected``). + +.. cpp:class:: MyClass : public MyBase, MyOtherBase + + The ``.. cpp:class::`` directive, showing a class/struct. + +.. cpp:class:: OuterScope::MyClass2 : public MyBase, MyOtherBase + + The ``.. cpp:class::`` directive, showing a class/struct. + +.. cpp:class:: template std::array + + The ``.. cpp:class::`` directive, showing a class/struct. + +.. cpp:class:: template<> std::array2 + + The ``.. cpp:class::`` directive, showing a class/struct. + +.. cpp:class:: template std::array3 + + The ``.. cpp:class::`` directive, showing a class/struct. + +.. cpp:function:: bool myMethod(int arg1, std::string arg2) + + The ``.. cpp:function::`` directive, showing a function or member function with parameters and types. + +.. cpp:function:: bool myMethod2(int, double) + + The ``.. cpp:function::`` directive, showing a function or member function with unnamed parameters. + +.. cpp:function:: const T &MyClass::operator[](std::size_t i) const + + The ``.. cpp:function::`` directive, showing an overload for the indexing operator. + +.. cpp:function:: operator bool() const + + The ``.. cpp:function::`` directive, showing a casting operator. + +.. cpp:function:: constexpr void my_constexpr_function(std::string &bar[2]) noexcept + + The ``.. cpp:function::`` directive, showing a constexpr function. + +.. cpp:function:: MyClass::MyClass4(const MyClass&) = default + + The ``.. cpp:function::`` directive, showing a copy constructor with default implementation. + +.. cpp:function:: template void my_function_template(U &&u) + + The ``.. cpp:function::`` directive, showing a function template. + +.. cpp:function:: template<> void my_function_template_specialisation(int i) + + The ``.. cpp:function::`` directive, showing a function template specialisation. + +.. cpp:member:: std::string MyClass::myMember + + The ``.. cpp:member::`` directive, showing a variable or member variable. + +.. cpp:var:: std::string MyClass::myOtherMember[N][M] + + The ``.. cpp:var::`` directive, showing a variable. + +.. cpp:member:: int my_member_variable = 42 + + The ``.. cpp:member::`` directive, showing a member variable. + +.. cpp:member:: template constexpr T my_constexpr = T(3.1415926535897932385) + + The ``.. cpp:member::`` directive, showing a variable template. + +.. cpp:type:: std::vector MyListType + + The ``.. cpp:type::`` directive, showing a typedef-like declaration of a type. + +.. cpp:type:: MyContainerType::const_iterator + + The ``.. cpp:type::`` directive, showing a declaration of a type alias with unspecified type. + +.. cpp:type:: MyTypeAlias = std::unordered_map + + The ``.. cpp:type::`` directive, showing a declaration of a type alias. + +.. cpp:type:: template MyTemplatedTypeAlias = std::vector + + The ``.. cpp:type::`` directive, showing a templated type alias can also be + +.. cpp:enum:: MyEnum + + The ``.. cpp:enum::`` directive, showing an unscoped enum. + +.. cpp:enum:: MySpecificEnum : long + + The ``.. cpp:enum::`` directive, showing an unscoped enum with specified underlying type. + +.. cpp:enum-class:: MyScopedEnum + + The ``.. cpp:enum-class::`` directive, showing a scoped enum. + +.. cpp:enum-struct:: protected MyScopedVisibilityEnum : std::underlying_type::type + + The ``.. cpp:enum-struct::`` directive, showing a scoped enum with non-default visibility, and with a specified underlying type. + +.. cpp:enumerator:: MyEnum::myEnumerator + + The ``.. cpp:enumerator::`` directive, showing an enumerator. + +.. cpp:enumerator:: MyEnum::myOtherEnumerator = 42 + + The ``.. cpp:enumerator::`` directive, showing a enumerator with a value. + +.. cpp:union:: my_union + + The ``.. cpp:union::`` directive, showing a union. + +.. cpp:concept:: template std::Iterator + + The ``.. cpp:concept::`` directive, showing a proxy to an element of a notional sequence. + + - :cpp:expr:`*r`, when :cpp:expr:`r` is dereferenceable. + - :cpp:expr:`++r`, with return type :cpp:expr:`It&`, when + :cpp:expr:`r` is incrementable. + +.. cpp:alias:: myAlias myMethod(int arg1, std::string arg2) + + The ``.. cpp:alias::`` directive, showing an alias declaration. diff --git a/sample-docs/kitchen-sink/domains/api_javascript_domain.rst b/sample-docs/kitchen-sink/domains/api_javascript_domain.rst new file mode 100644 index 000000000..1b057b4f7 --- /dev/null +++ b/sample-docs/kitchen-sink/domains/api_javascript_domain.rst @@ -0,0 +1,41 @@ +.. + Copyright (c) 2021 Pradyun Gedam + Licensed under Creative Commons Attribution-ShareAlike 4.0 International License + SPDX-License-Identifier: CC-BY-SA-4.0 + +Directives in the JavaScript domain +----------------------------------- + +The domain name is ``js``, see https://www.sphinx-doc.org/en/master/usage/domains/javascript.html + +.. js:function:: $.myFunction(href, callback[, errback]) + + The ``.. js:function::`` directive, showing a JavaScript function or method. + + :param string href: An URI to the location of the resource. + :param callback: Gets called with the object. + :param errback: + Gets called in case the request fails. And a lot of other + text so we need multiple lines. + :throws SomeError: For whatever reason in that case. + :returns: Something. + +.. js:method:: $.myMethod(href, callback[, errback]) + + The ``.. js:method::`` directive (an alias for ``.. js:function::``, + showing a function that is implemented as a method on a class object. + +.. js:class:: MyClass(name[, num]) + + The ``.. js:class::`` directive, showing a JavaScript object. + + :param string name: A name + :param number num: An optional number + +.. js:data:: my_variable + + The ``.. js:data::`` directive, showing a global variable or constant. + +.. js:attribute:: object.name + + The ``.. js:attribute::`` directive, showing an attribute *name* of *object*. diff --git a/sample-docs/kitchen-sink/domains/api_python_domain.rst b/sample-docs/kitchen-sink/domains/api_python_domain.rst new file mode 100644 index 000000000..009929f25 --- /dev/null +++ b/sample-docs/kitchen-sink/domains/api_python_domain.rst @@ -0,0 +1,187 @@ +.. + Copyright (c) 2021 Pradyun Gedam + Licensed under Creative Commons Attribution-ShareAlike 4.0 International License + SPDX-License-Identifier: CC-BY-SA-4.0 + +Directives in the Python domain +------------------------------- + +The domain name is ``py``, see https://www.sphinx-doc.org/en/master/usage/domains/python.html + +.. py:module:: my_module + :platform: platform1, platform2 + :synopsis: purpose + :deprecated: + + The ``py:module`` directive, showing the docstring for the whole module. + + The second line of the module docstring. + +.. py:function:: my_function(parameter: ParameterT = default_value) -> ReturnT + :async: + :canonical: my_module.my_function + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:function`` directive. + +.. py:function:: my_function_type_parameters[ParameterT](parameter: ParameterT) -> ParameterT + :async: + :canonical: my_module.my_function_type_parameters + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:function`` directive; using Python 3.12 *type parameters*. + +.. py:data:: my_data + :type: type + :value: initial_value + :canonical: my_module.my_data + + The ``py:data`` directive. + +.. py:exception:: MyException + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:exception`` directive. + +.. py:exception:: MyExceptionFinal + :final: + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:exception`` directive, ``final``. + +.. py:exception:: MyException_type_parameters(parameters) + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:exception`` directive. + +.. py:exception:: MyExceptionTypeParameters[ParameterT](parameter: ParameterT) + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:exception`` directive; using Python 3.12 *type parameters*. + +.. py:class:: MyClass + :canonical: my_module.MyClass + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:class`` directive. + +.. py:class:: MyClassFinal + :canonical: my_module.MyClassFinal + :final: + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:class`` directive, ``final``. + +.. py:class:: MyClassParameters(parameters) + :canonical: my_module.MyClass2 + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:class`` directive. + +.. py:class:: MyClassTypeParameters[ParameterT](parameter: ParameterT) + :canonical: my_module.MyClassTypeParameters + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:class`` directive; using Python 3.12 *type parameters*. + +.. py:attribute:: my_attribute + :type: type + :value: initial_value + :canonical: my_module.my_attribute + + The ``py:attribute`` directive. + +.. py:property:: my_property + :type: type + + The ``py:property`` directive. + +.. py:property:: my_property2 + :abstractmethod: + :classmethod: + :type: type + + The ``py:property`` directive; + using the ``:abstractmethod:``, ``:classmethod:`` flags. + +.. py:type:: MyType + :canonical: my_module.MyType + + The ``py:type`` directive. + +.. py:method:: my_method(parameters) -> ReturnT + :canonical: my_module.my_method + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:method`` directive. + +.. py:method:: my_method_type_parameters[ParameterT](parameter: ParameterT) -> ParameterT + :abstractmethod: + :async: + :canonical: my_module.my_method_type_parameters + :classmethod: + :final: + :single-line-parameter-list: + :single-line-type-parameter-list: + :staticmethod: + + The ``py:method`` directive; + using all of the ``:abstractmethod:``, ``:async:``, ``:classmethod:``, ``:final:``, ``:staticmethod:`` flags; + using Python 3.12 *type parameters*. + +.. py:staticmethod:: my_staticmethod(parameters) + + The ``py:staticmethod`` directive. + +.. py:staticmethod:: my_staticmethod_type_parameters[ParameterT](parameter: ParameterT) -> ParameterT + + The ``py:staticmethod`` directive; using Python 3.12 *type parameters*. + +.. py:classmethod:: my_classmethod(parameters) + + The ``py:classmethod`` directive. + +.. py:classmethod:: my_classmethod_type_parameters[ParameterT](parameter: ParameterT) -> ParameterT + + The ``py:classmethod`` directive; using Python 3.12 *type parameters*. + +.. py:decorator:: my_decorator + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:decorator`` directive. + +.. py:decorator:: my_decorator_parameters(parameters) + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:decorator`` directive. + +.. py:decorator:: my_decorator_type_parameters[ParameterT](parameter: ParameterT) + :single-line-parameter-list: + :single-line-type-parameter-list: + + The ``py:decorator`` directive; using Python 3.12 *type parameters*. + +.. py:decoratormethod:: my_decoratormethod + + The ``py:decoratormethod`` directive. + +.. py:decoratormethod:: my_decoratormethod_signature(signature) + + The ``py:decoratormethod`` directive. + +.. py:decoratormethod:: my_decoratormethod_signature_type_parameters[ParameterT](signature) + + The ``py:decoratormethod`` directive; using Python 3.12 *type parameters*. diff --git a/sample-docs/kitchen-sink/domains/api_restructuredtext_domain.rst b/sample-docs/kitchen-sink/domains/api_restructuredtext_domain.rst new file mode 100644 index 000000000..951b1d708 --- /dev/null +++ b/sample-docs/kitchen-sink/domains/api_restructuredtext_domain.rst @@ -0,0 +1,36 @@ +.. + Copyright (c) 2021 Pradyun Gedam + Licensed under Creative Commons Attribution-ShareAlike 4.0 International License + SPDX-License-Identifier: CC-BY-SA-4.0 + +Directives in the reStructuredText domain +----------------------------------------- + +The domain name is ``rst``, see https://www.sphinx-doc.org/en/master/usage/domains/restructuredtext.html + +.. rst:directive:: my_directive + + The ``.. rst:directive::`` directive, showing the directive ``my_directive``. + +.. rst:directive:: .. my_directive2:: my_argument + + The ``.. rst:directive::`` directive, showing the directive ``my_directive2`` with argument ``my_argument``. + +.. rst:directive:: my_directive3 + + The ``.. rst:directive::`` directive, showing the directive ``my_directive3``. + + .. rst:directive:option:: my_option1 + + .. rst:directive:option:: my_option2: my_argument + + The ``.. rst:directive:option::`` directive, showing the directive option ``my_option2`` that has an argument. + + .. rst:directive:option:: my_option3: my_argument2 + :type: my_argument2_type + + The ``.. rst:directive:option::`` directive, showing the directive option ``my_option3`` that has an argument with a type definition. + +.. rst:role:: role_name + + The ``.. rst:role::`` directive, showing a role. diff --git a/sample-docs/placeholder-four.rst b/sample-docs/placeholder-four.rst index 7095a9567..263000560 100644 --- a/sample-docs/placeholder-four.rst +++ b/sample-docs/placeholder-four.rst @@ -2,4 +2,4 @@ Placeholder Page Four ===================== -This page is here, to provide some content for the site structure. +This page is here to provide some content for the site structure. diff --git a/sample-docs/placeholder-one.rst b/sample-docs/placeholder-one.rst index be83e1014..b675be272 100644 --- a/sample-docs/placeholder-one.rst +++ b/sample-docs/placeholder-one.rst @@ -2,4 +2,4 @@ Placeholder Page One ==================== -This page is here, to provide some content for the site structure. +This page is here to provide some content for the site structure. diff --git a/sample-docs/placeholder-three.rst b/sample-docs/placeholder-three.rst index ac714139a..8b5178566 100644 --- a/sample-docs/placeholder-three.rst +++ b/sample-docs/placeholder-three.rst @@ -2,4 +2,4 @@ Placeholder Page Three ====================== -This page is here, to provide some content for the site structure. +This page is here to provide some content for the site structure. diff --git a/sample-docs/placeholder-two.rst b/sample-docs/placeholder-two.rst index 4bcff82d0..c26fd91dc 100644 --- a/sample-docs/placeholder-two.rst +++ b/sample-docs/placeholder-two.rst @@ -2,4 +2,4 @@ Placeholder Page Two ==================== -This page is here, to provide some content for the site structure. +This page is here to provide some content for the site structure. diff --git a/src/templates/conf.template.py b/src/templates/conf.template.py index e40f0ed00..a892b19f4 100644 --- a/src/templates/conf.template.py +++ b/src/templates/conf.template.py @@ -1,3 +1,5 @@ +import os +import sys import textwrap from docutils import nodes @@ -12,6 +14,8 @@ html_title = "{{ theme.display }}" +sys.path.insert(0, os.path.abspath("sample-docs/kitchen-sink/")) + extensions = [ "sphinx.ext.autodoc", "sphinx.ext.extlinks",