Skip to content

Remove sphinx static and template dir #5039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions readthedocs/doc_builder/backends/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
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
Expand Down Expand Up @@ -63,7 +63,6 @@ def _write_config(self, master_doc='index'):
'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')
Expand Down Expand Up @@ -114,8 +113,6 @@ def get_config_params(self):
'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,
Expand Down
7 changes: 0 additions & 7 deletions readthedocs/doc_builder/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@

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 (.*?)')

Expand Down
5 changes: 0 additions & 5 deletions readthedocs/doc_builder/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
DOCKER_TIMEOUT_EXIT_CODE,
DOCKER_VERSION,
MKDOCS_TEMPLATE_DIR,
SPHINX_TEMPLATE_DIR,
)
from .exceptions import (
BuildEnvironmentCreationFailed,
Expand Down Expand Up @@ -866,10 +865,6 @@ def get_container_host_config(self):
``client.create_container``.
"""
binds = {
SPHINX_TEMPLATE_DIR: {
'bind': SPHINX_TEMPLATE_DIR,
'mode': 'ro',
},
MKDOCS_TEMPLATE_DIR: {
'bind': MKDOCS_TEMPLATE_DIR,
'mode': 'ro',
Expand Down
1 change: 0 additions & 1 deletion readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ if not 'html_static_path' in globals():
html_static_path = []
if os.path.exists('_static'):
html_static_path.append('_static')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to remove this whole block too

html_static_path.append('{{ static_path }}')

# Add RTD Theme only if they aren't overriding it already
using_rtd_theme = (
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/templates/sphinx/conf.py.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down