Skip to content

Commit

Permalink
Another pandoc attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
kmlefran committed Jul 23, 2024
1 parent b2a19b7 commit ac8da9b
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import pathlib
import sys
import time
from inspect import getsourcefile

from aiida.manage.configuration import Profile, load_profile
from pypandoc.pandoc_download import download_pandoc

import aiida_aimall

Expand Down Expand Up @@ -267,22 +267,6 @@
DOCS_DIRECTORY = os.path.dirname(os.path.abspath(getsourcefile(lambda: 0)))


def ensure_pandoc_installed(_):
import pypandoc

# Download pandoc if necessary. If pandoc is already installed and on
# the PATH, the installed version will be used. Otherwise, we will
# download a copy of pandoc into docs/bin/ and add that to our PATH.
pandoc_dir = os.path.join(DOCS_DIRECTORY, "bin")
# Add dir containing pandoc binary to the PATH environment variable
if pandoc_dir not in os.environ["PATH"].split(os.pathsep):
os.environ["PATH"] += os.pathsep + pandoc_dir
pypandoc.ensure_pandoc_installed(
quiet=True,
targetfolder=pandoc_dir,
delete_installer=True,
)


def setup(app):
app.connect("builder-inited", ensure_pandoc_installed)
# see the documentation how to customize the installation path
# but be aware that you then need to include it in the `PATH`
download_pandoc()

0 comments on commit ac8da9b

Please sign in to comment.