Skip to content

Commit 0e0e682

Browse files
committed
update build conf.py for sphinx docs
1 parent 6a95aeb commit 0e0e682

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

conf.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,19 @@
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
13-
import os
14-
import sys
15-
import json
16-
import django
17-
18-
from pathlib import Path
1913

14+
import os
2015
import recommonmark # noqa: F401
2116
from recommonmark.transform import AutoStructify
2217

2318
os.environ['USE_CHROME'] = 'False'
2419

25-
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
26-
PACKAGE_DIR = os.path.join(ROOT_DIR, 'archivebox')
27-
28-
os.chdir(ROOT_DIR)
20+
import archivebox
21+
from archivebox.config.legacy import setup_django
2922

30-
sys.path.insert(0, os.path.abspath('.'))
31-
sys.path.insert(0, os.path.abspath('..'))
32-
sys.path.insert(0, PACKAGE_DIR)
33-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
34-
django.setup()
23+
setup_django()
3524

36-
VERSION = json.loads((Path(ROOT_DIR) / 'package.json').read_text().strip())['version']
25+
VERSION = archivebox.VERSION
3726

3827
# -- Project information -----------------------------------------------------
3928

0 commit comments

Comments
 (0)