Merge pull request #5039 from stsewd/remove-static-path
Remove sphinx static and template dirghowardsit
commit
f4d3a93a5c
|
@ -27,7 +27,7 @@ from readthedocs.restapi.client import api
|
|||
from readthedocs.projects.models import Feature
|
||||
|
||||
from ..base import BaseBuilder, restoring_chdir
|
||||
from ..constants import PDF_RE, SPHINX_STATIC_DIR, SPHINX_TEMPLATE_DIR
|
||||
from ..constants import PDF_RE
|
||||
from ..environments import BuildCommand, DockerBuildCommand
|
||||
from ..exceptions import BuildEnvironmentError
|
||||
from ..signals import finalize_sphinx_context_data
|
||||
|
@ -63,7 +63,6 @@ class BaseSphinx(BaseBuilder):
|
|||
'sphinx/conf.py.conf', {
|
||||
'project': self.project,
|
||||
'version': self.version,
|
||||
'template_dir': SPHINX_TEMPLATE_DIR,
|
||||
'master_doc': master_doc,
|
||||
})
|
||||
conf_file = os.path.join(docs_dir, 'conf.py')
|
||||
|
@ -114,8 +113,6 @@ class BaseSphinx(BaseBuilder):
|
|||
'project': self.project,
|
||||
'version': self.version,
|
||||
'settings': settings,
|
||||
'static_path': SPHINX_STATIC_DIR,
|
||||
'template_path': SPHINX_TEMPLATE_DIR,
|
||||
'conf_py_path': conf_py_path,
|
||||
'api_host': getattr(
|
||||
settings,
|
||||
|
|
|
@ -12,19 +12,12 @@ from django.conf import settings
|
|||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
SPHINX_TEMPLATE_DIR = os.path.join(
|
||||
settings.SITE_ROOT,
|
||||
'readthedocs',
|
||||
'templates',
|
||||
'sphinx',
|
||||
)
|
||||
MKDOCS_TEMPLATE_DIR = os.path.join(
|
||||
settings.SITE_ROOT,
|
||||
'readthedocs',
|
||||
'templates',
|
||||
'mkdocs',
|
||||
)
|
||||
SPHINX_STATIC_DIR = os.path.join(SPHINX_TEMPLATE_DIR, '_static')
|
||||
|
||||
PDF_RE = re.compile('Output written on (.*?)')
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ from .constants import (
|
|||
DOCKER_TIMEOUT_EXIT_CODE,
|
||||
DOCKER_VERSION,
|
||||
MKDOCS_TEMPLATE_DIR,
|
||||
SPHINX_TEMPLATE_DIR,
|
||||
)
|
||||
from .exceptions import (
|
||||
BuildEnvironmentCreationFailed,
|
||||
|
@ -866,10 +865,6 @@ class DockerBuildEnvironment(BuildEnvironment):
|
|||
``client.create_container``.
|
||||
"""
|
||||
binds = {
|
||||
SPHINX_TEMPLATE_DIR: {
|
||||
'bind': SPHINX_TEMPLATE_DIR,
|
||||
'mode': 'ro',
|
||||
},
|
||||
MKDOCS_TEMPLATE_DIR: {
|
||||
'bind': MKDOCS_TEMPLATE_DIR,
|
||||
'mode': 'ro',
|
||||
|
|
|
@ -37,7 +37,6 @@ if not 'html_static_path' in globals():
|
|||
html_static_path = []
|
||||
if os.path.exists('_static'):
|
||||
html_static_path.append('_static')
|
||||
html_static_path.append('{{ static_path }}')
|
||||
|
||||
# Add RTD Theme only if they aren't overriding it already
|
||||
using_rtd_theme = (
|
||||
|
|
|
@ -7,7 +7,7 @@ from datetime import datetime
|
|||
from recommonmark.parser import CommonMarkParser
|
||||
|
||||
extensions = []
|
||||
templates_path = ['/tmp/sphinx-template-dir', 'templates', '_templates', '.templates']
|
||||
templates_path = ['templates', '_templates', '.templates']
|
||||
source_suffix = ['.rst', '.md']
|
||||
source_parsers = {
|
||||
'.md': CommonMarkParser,
|
||||
|
|
|
@ -71,10 +71,6 @@ class SphinxBuilderTest(TestCase):
|
|||
expected
|
||||
)
|
||||
|
||||
@patch(
|
||||
'readthedocs.doc_builder.backends.sphinx.SPHINX_TEMPLATE_DIR',
|
||||
'/tmp/sphinx-template-dir',
|
||||
)
|
||||
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.docs_dir')
|
||||
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.create_index')
|
||||
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.get_config_params')
|
||||
|
@ -131,10 +127,6 @@ class SphinxBuilderTest(TestCase):
|
|||
ef.readlines()[:autogenerated_confpy_lines]
|
||||
)
|
||||
|
||||
@patch(
|
||||
'readthedocs.doc_builder.backends.sphinx.SPHINX_TEMPLATE_DIR',
|
||||
'/tmp/sphinx-template-dir',
|
||||
)
|
||||
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.docs_dir')
|
||||
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.create_index')
|
||||
@patch('readthedocs.doc_builder.backends.sphinx.BaseSphinx.get_config_params')
|
||||
|
|
|
@ -7,7 +7,7 @@ from datetime import datetime
|
|||
from recommonmark.parser import CommonMarkParser
|
||||
|
||||
extensions = []
|
||||
templates_path = ['{{ template_dir }}', 'templates', '_templates', '.templates']
|
||||
templates_path = ['templates', '_templates', '.templates']
|
||||
source_suffix = ['.rst', '.md']
|
||||
source_parsers = {
|
||||
'.md': CommonMarkParser,
|
||||
|
|
Loading…
Reference in New Issue