Почему мой параметр sphinx-apidoc --templateir не работает должным образом?Python

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Почему мой параметр sphinx-apidoc --templateir не работает должным образом?

Сообщение Anonymous »

Я пытаюсь настроить ./docs/conf.py, чтобы упростить управление документацией, поэтому выполнил следующую команду:

Код: Выделить всё

sphinx-apidoc -F -o "./docs" --templatedir=./templates "."
Я поместил следующий файл conf.py_t в каталог ./templates, но опция --templatedir, похоже, не работает так, как ожидал. (Я проверил сгенерированный файл ./docs/conf.py, и он отличается от файла шаблона в ./templates/conf.py_t. Конечно, я удаляю ./docs каждый раз перед выполнением этой команды).
Не могли бы вы помочь мне понять, как решить эту проблему?
Спасибо за сотрудничество.Вот подробности проблемы.
Спасибо за помощь.
  • ОС

    ОС: Windows
  • Оболочка: PowerShell
  • Среда Python:

    Miniconda: 24.1.2
    < li>Python: 3.12.2
[*]Версия Sphinx: 8.1.3

[*]выполненный результат

Код: Выделить всё

ファイル C:\Users\username\Downloads\test\docs\conf.py を作成しています。
ファイル C:\Users\username\Downloads\test\docs\index.rst を作成しています。
ファイル C:\Users\username\Downloads\test\docs\Makefile を作成しています。
ファイル C:\Users\username\Downloads\test\docs\make.bat を作成しています。
это говорит о том, что каждый файл генерируется без сообщения об ошибке. (язык — японский)

Код: Выделить всё

conf.py_t
Содержимое файла

Код: Выделить всё

#hogehoge
#hogehoge
#hogehoge
#hogehoge
#hogehoge
#hogehoge
#hogehoge
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

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

# -- Project information -----------------------------------------------------

project = '{{ project_name }}'
copyright = '{{ copyright_year }}, {{ author }}'
author = '{{ author }}'

# The full version, including alpha/beta/rc tags
release = '{{ version }}'

# -- General configuration ---------------------------------------------------

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode'
]

templates_path = ['_templates']
exclude_patterns = []

# -- Options for HTML output -------------------------------------------------

html_theme = 'alabaster'
html_static_path = ['_static']
Generated ./docs/conf.py Содержимое файла

Код: Выделить всё

# 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

project = 'test'
copyright = '2024, Author'
author = 'Author'

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

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.todo',
]

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

language = 'en'

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

html_theme = 'alabaster'
html_static_path = ['_static']

# -- Options for todo extension ----------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/todo.html#configuration

todo_include_todos = True
Примечание. Сгенерированный файл conf.py отличается от файла шаблона conf.py_t, и я не знаю, почему этот шаблон не применяется.
Примечание. Я создал репозиторий GitHub, в котором можно воспроизвести проблему. При необходимости посмотрите
https://github.com/wassawa1/sphinx-temp ... st/actions

Подробнее здесь: https://stackoverflow.com/questions/791 ... s-expected
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»