Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 7d7e4f2

Browse files
committed
use toc.rst if it exists.
1 parent 42410df commit 7d7e4f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runestone/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ def build(options):
7474

7575
try:
7676
sys.path.insert(0,os.path.join('..','..','modules'))
77+
if os.path.exists(os.path.join(options.build.sourcedir,'toc.rst')):
78+
idxfile = os.path.join(options.build.sourcedir,'toc.rst')
79+
else:
80+
idxfile = os.path.join(options.build.sourcedir,'index.rst')
7781
from chapternames import populateChapterInfo
78-
populateChapterInfo(options.build.project_name, "%s/index.rst" % options.build.sourcedir)
82+
populateChapterInfo(options.build.project_name, idxfile)
7983
print('Creating Chapter Information')
8084
except ImportError as e:
8185
print('Chapter information database population skipped, This is OK for a standalone build.',e)

0 commit comments

Comments
 (0)