Skip to content
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

Extend toc in sidebar indentation #852

Merged
merged 7 commits into from
Feb 25, 2020

Conversation

s-weigand
Copy link
Contributor

@s-weigand s-weigand commented Nov 2, 2019

Since for some auto-generated documentation, only having indentation till navigation_depth==4 might lead to problems (see), I followed @agjohnson 's comment and implemented indentation until navigation_depth==10.

What this PR does:

  • Indentation for elements of the toc in sidebar up to navigation_depth==10
  • Fontsize shrinking only for elements of levels-{2,3,4}, as before, but with a placeholder selector.
  • Generalization of some properties for elements of the toc in sidebar with placeholder selectors and for loop.

Before

before

After

after

@eine
Copy link

eine commented Jan 3, 2020

ping @Blendify @ericholscher @agjohnson

eine pushed a commit to buildthedocs/sphinx.theme that referenced this pull request Jan 3, 2020
eine pushed a commit to buildthedocs/sphinx.theme that referenced this pull request Jan 4, 2020
@Blendify Blendify requested review from agjohnson, davidfischer, Blendify and jessetan and removed request for agjohnson and davidfischer January 20, 2020 18:00
.gitignore Outdated Show resolved Hide resolved
eine pushed a commit to buildthedocs/sphinx.theme that referenced this pull request Feb 3, 2020
@Blendify Blendify merged commit ca015a5 into readthedocs:master Feb 25, 2020
@s-weigand s-weigand deleted the indent-all-toc-levels branch February 25, 2020 08:04
@Alexdara
Copy link

Alexdara commented Mar 19, 2020

@s-weigand
I can not update my python lib thought
pip install git+https://github.com/readthedocs/sphinx_rtd_theme.git@master
it returns:
Installing collected packages: sphinx-rtd-theme Attempting uninstall: sphinx-rtd-theme Found existing installation: sphinx-rtd-theme 0.4.3 Uninstalling sphinx-rtd-theme-0.4.3: Successfully uninstalled sphinx-rtd-theme-0.4.3 Running setup.py install for sphinx-rtd-theme ... error ERROR: Command errored out with exit status 1: command: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TOH-WZ~1\\AppData\\Local\\Temp\\pip-req-build-60liz4ry\\setup.py'"'"'; __file__='"'"'C:\\Users\\TOH-WZ~1\\AppData\\Local\\Temp\\pip-req-build-60liz4ry\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\TOH-WZ~1\AppData\Local\Temp\pip-record-uh7x79kq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\program files\python37\Include\sphinx-rtd-theme' cwd: C:\Users\TOH-WZ~1\AppData\Local\Temp\pip-req-build-60liz4ry\ Complete output (4 lines): running install running build running build_py error: [WinError 2] The system cannot find the file specified. ---------------------------------------- Rolling back uninstall of sphinx-rtd-theme Moving to c:\program files\python37\lib\site-packages\sphinx_rtd_theme-0.4.3.dist-info\ from c:\program files\python37\lib\site-packages\~phinx_rtd_theme-0.4.3.dist-info Moving to c:\program files\python37\lib\site-packages\sphinx_rtd_theme\ from c:\program files\python37\lib\site-packages\~phinx_rtd_theme ERROR: Command errored out with exit status 1: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TOH-WZ~1\\AppData\\Local\\Temp\\pip-req-build-60liz4ry\\setup.py'"'"'; __file__='"'"'C:\\Users\\TOH-WZ~1\\AppData\\Local\\Temp\\pip-req-build-60liz4ry\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\TOH-WZ~1\AppData\Local\Temp\pip-record-uh7x79kq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\program files\python37\Include\sphinx-rtd-theme' Check the logs for full command output.

Are there any suggestions?Thanks a lot.

@Alexdara
Copy link

@s-weigand
I can not update my python lib thought
pip install git+https://github.com/readthedocs/sphinx_rtd_theme.git@master
it returns:
Installing collected packages: sphinx-rtd-theme Attempting uninstall: sphinx-rtd-theme Found existing installation: sphinx-rtd-theme 0.4.3 Uninstalling sphinx-rtd-theme-0.4.3: Successfully uninstalled sphinx-rtd-theme-0.4.3 Running setup.py install for sphinx-rtd-theme ... error ERROR: Command errored out with exit status 1: command: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TOH-WZ~1\\AppData\\Local\\Temp\\pip-req-build-60liz4ry\\setup.py'"'"'; __file__='"'"'C:\\Users\\TOH-WZ~1\\AppData\\Local\\Temp\\pip-req-build-60liz4ry\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\TOH-WZ~1\AppData\Local\Temp\pip-record-uh7x79kq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\program files\python37\Include\sphinx-rtd-theme' cwd: C:\Users\TOH-WZ~1\AppData\Local\Temp\pip-req-build-60liz4ry\ Complete output (4 lines): running install running build running build_py error: [WinError 2] The system cannot find the file specified. ---------------------------------------- Rolling back uninstall of sphinx-rtd-theme Moving to c:\program files\python37\lib\site-packages\sphinx_rtd_theme-0.4.3.dist-info\ from c:\program files\python37\lib\site-packages\~phinx_rtd_theme-0.4.3.dist-info Moving to c:\program files\python37\lib\site-packages\sphinx_rtd_theme\ from c:\program files\python37\lib\site-packages\~phinx_rtd_theme ERROR: Command errored out with exit status 1: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TOH-WZ~1\\AppData\\Local\\Temp\\pip-req-build-60liz4ry\\setup.py'"'"'; __file__='"'"'C:\\Users\\TOH-WZ~1\\AppData\\Local\\Temp\\pip-req-build-60liz4ry\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\TOH-WZ~1\AppData\Local\Temp\pip-record-uh7x79kq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\program files\python37\Include\sphinx-rtd-theme' Check the logs for full command output.

Are there any suggestions?Thanks a lot.

Solved this by use
pip install -e git+https://github.com/readthedocs/sphinx_rtd_theme.git@master#egg=sphinx-rtd-theme

@s-weigand
Copy link
Contributor Author

s-weigand commented Mar 20, 2020

I think that the problem with directly installing it from from git, in none dev mode, is that the setup needs a local installation of webpack.
See:

class WebpackBuildCommand(setuptools.command.build_py.build_py):
"""Prefix Python build with Webpack asset build"""
def run(self):
if not 'CI' in os.environ:
subprocess.run(['npm', 'install'], check=True)
subprocess.run(['node_modules/.bin/webpack', '--config', 'webpack.prod.js'], check=True)
setuptools.command.build_py.build_py.run(self)

@Alexdara
Copy link

Alexdara commented Mar 20, 2020

I think that the problem with directly installing it from from git, in none dev mode, is that the setup needs a local installation of webpack.
See:

class WebpackBuildCommand(setuptools.command.build_py.build_py):
"""Prefix Python build with Webpack asset build"""
def run(self):
if not 'CI' in os.environ:
subprocess.run(['npm', 'install'], check=True)
subprocess.run(['node_modules/.bin/webpack', '--config', 'webpack.prod.js'], check=True)
setuptools.command.build_py.build_py.run(self)

After install webpack,still returns error as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants