Skip to content

Commit d29a636

Browse files
authored
👌 IMPROVE: Changes for readthedocs (#50)
* reformatted docs page * added things in gitignore * removing latex-tocd branch cloning * fixing version of bibtes * changed the cloning directory to executablebooks
1 parent c6b824f commit d29a636

File tree

11 files changed

+146
-46
lines changed

11 files changed

+146
-46
lines changed

‎.github/workflows/pdf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
- name: Build PDF from LaTeX (Docs)
4343
run: |
44-
git clone -b latex-tocd https://github.com/AakashGfude/jupyter-book.git
44+
git clone https://github.com/executablebooks/jupyter-book.git
4545
cd jupyter-book
4646
pip install -e .[sphinx]
4747
jb build docs --builder pdflatex -n -W --keep-going

‎.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ build/
55
dist/
66
*.egg-info/
77
_build/
8+
_static
9+
_templates
810
.DS_Store
911

1012

‎.readthedocs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/source/conf.py
11+
12+
python:
13+
version: 3.7
14+
install:
15+
- method: pip
16+
path: .
17+
extra_requirements:
18+
- rtd

‎docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

‎docs/_config.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎docs/_toc.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

‎docs/source/conf.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
import os
3+
4+
# -- Project information -----------------------------------------------------
5+
project = "Jupyterbook-latex"
6+
copyright = "2020, Executable Book Project"
7+
author = "Executable Book Project"
8+
master_doc = "intro"
9+
10+
11+
# -- General configuration ---------------------------------------------------
12+
13+
# Add any Sphinx extension module names here, as strings. They can be
14+
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
15+
# ones.
16+
extensions = ["jupyterbook_latex", "myst_parser"]
17+
18+
# Add any paths that contain templates here, relative to this directory.
19+
templates_path = ["_templates"]
20+
21+
# List of patterns, relative to source directory, that match files and
22+
# directories to ignore when looking for source files.
23+
# This pattern also affects html_static_path and html_extra_path.
24+
exclude_patterns = ["_build"]
25+
26+
html_static_path = ["_static"]
27+
28+
# -- Options for HTML output -------------------------------------------------
29+
30+
# The theme to use for HTML and HTML Help pages. See the documentation for
31+
# a list of builtin themes.
32+
#
33+
html_theme = "sphinx_book_theme"
34+
35+
36+
# Add any paths that contain custom static files (such as style sheets) here,
37+
# relative to this directory. They are copied after the builtin static files,
38+
# so a file named "default.css" will overwrite the builtin "default.css".
39+
# html_static_path = ["_static"]
40+
41+
html_theme_options = {
42+
"path_to_docs": "docs/",
43+
"repository_url": "https://github.com/executablebooks/jupyterbook-latex",
44+
"use_edit_page_button": True,
45+
}
46+
47+
jupyter_execute_notebooks = "cache"
48+
execution_show_tb = "READTHEDOCS" in os.environ
49+
execution_timeout = 60 # Note: 30 was timing out on RTD
File renamed without changes.

‎docs/intro.md renamed to ‎docs/source/intro.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1-
# jupyterbook-latex
1+
# Jupyterbook-latex
22

33
**Improvements to LaTeX for jupyter-book**.
44

55
This package contains a [Sphinx](http://www.sphinx-doc.org/en/master/)
66
extension to handle LaTeX builds for [jupyter-book](https://jupyterbook.org/)
77
projects and to implement features specific to LaTeX.
88

9+
## Site Contents
10+
11+
```{toctree}
12+
---
13+
maxdepth: 1
14+
---
15+
contributing.md
16+
```
17+
918
(getting-started)=
1019
## Getting Started
1120

@@ -22,7 +31,7 @@ extensions = ["jupyterbook_latex"]
2231
```
2332

2433
(feature-list)=
25-
## Feature List
34+
## Features List
2635

2736
A list of features that are implemented in this `jupyter-book` extension:
2837

@@ -35,27 +44,27 @@ A list of features that are implemented in this `jupyter-book` extension:
3544
to chapters in pdf output.
3645

3746
* Files specified under the `sections:` key are included
38-
in the parent `chapter` document with file title being `h2`
39-
headers in the document.
47+
in the parent `chapter` document, with the file title being the `h2`
48+
header in the document.
4049

4150
* The `master document` is not included in table of contents page
4251
and is instead treated as a `frontmatter`.
4352

4453
* `url` key in `_toc.yml` is being ignored in the final
4554
pdf output.
4655

47-
* Support for `tableofcontents`](https://jupyterbook.org/customize/toc.html#add-a-table-of-contents-to-a-page-s-content) directives in `LaTeX`
48-
is translated as a list with links preserved.
56+
* [`tableofcontents`](https://jupyterbook.org/customize/toc.html#add-a-table-of-contents-to-a-page-s-content) directive
57+
is translated as a list, with the links preserved.
4958

50-
* The table of contents page title is fixed to be `Contents` at present.
59+
* The `Table Of Contents` page title is fixed, with the value being "Contents".
5160

5261
### Master Document:
5362

5463
The `masterdoc` page is treated strictly as `front matter`. This is similar to an `Introduction` to the book and does not appear in Table Of Contents. All the sections and sub-sections in the `masterdoc` are internally converted to bolded text of varying sizes based on the level of the section.
5564

5665
### Code Cell Tags:
5766

58-
A list of available tags can be found in https://jupyterbook.org/reference/cheatsheet.html#tags
67+
A list of available tags can be found in [https://jupyterbook.org/reference/cheatsheet.html#tags]
5968

6069
* `hide-cell` is handled by removing the input and output cell content in the `pdf` output.
6170

@@ -67,18 +76,18 @@ A list of available tags can be found in https://jupyterbook.org/reference/cheat
6776

6877
* Handling of `png` and `gif` images using `sphinx.ext.imgconverter` package.
6978
Which uses [ImageMagick](https://www.imagemagick.org/script/index.php), which
70-
will need to be installed on your system to work.
79+
needs to be installed on your system to work.
7180

7281
```{note}
7382
[ImageMagick](https://www.imagemagick.org/script/index.php) is not installed by default
74-
so it is up to users to provide this software
83+
so it is up to the users to install this software.
7584
```
7685

7786
* Fonts used at the moment are [GNU Free Fonts](https://www.gnu.org/software/freefont/),
7887
but it may change in the near future owing to its handling of math characters.
7988

8089
* Direct LaTeX syntax for math is handled by default in source documents
8190
using `myst_amsmath_enable` key of `jupyter-book`.
82-
More info on [myst_amsmath_enable](https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html#syntax-amsmath).
91+
More info on [this](https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html#syntax-amsmath) page.
8392

8493
* `xelatex` is used as the **default LaTeX engine** because of its support for unicode characters.

‎setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"pytest-regressions",
3535
"texsoup",
3636
"jupyter-book",
37-
"sphinxcontrib-bibtex",
37+
"sphinxcontrib-bibtex~=2.1.0",
3838
],
3939
"rtd": [
4040
"sphinx>=3.0",

0 commit comments

Comments
 (0)