def runDoxygen(rtdsrcdir, rtdblddir, doxyfileIn, doxyfileOut): """Run Doxygen as part of generating user documentation. This is only meant to be used on readthedocs.org to generate reference documentation for linking into the user's guide and tutorial. It should eventually be replaced by something that fetches tag files, XML files, and references remotely-generated documentation from an actual SMTK build. """ import re import subprocess dxiname = open(os.path.join(rtdsrcdir, doxyfileIn), 'r') cfg = dxiname.read() orgdir = os.path.abspath(os.getcwd()) srcdir = os.path.abspath(os.path.join(os.getcwd(), '..')) bindir = srcdir refdir = os.path.abspath(os.path.join(rtdblddir, 'doc', 'reference')) cfg2 = re.sub('@smtk_SOURCE_DIR@', srcdir, re.sub('@smtk_BINARY_DIR@', os.path.abspath(rtdblddir), cfg)) try: os.makedirs(refdir) except OSError as e: if e.errno == 17: pass except: print 'Failed to create doxygen reference directory %s' % refdir return dxoname = os.path.abspath(os.path.join(refdir, doxyfileOut)) dxo = open(dxoname, 'w') print >> dxo, cfg2 dxo.close() os.chdir(refdir) # Hack for lacking git-lfs support ReadTheDocs if on_rtd: print('Fetching files with git_lfs') from git_lfs import fetch fetch(rtdsrcdir) print 'Running Doxygen on %s' % dxoname rcode = subprocess.call(('doxygen', dxoname)) print ' Doxygen returned %s' % rcode os.chdir(orgdir)
try: objects.extend(_fetch_urls(lfs_url, oid_list)) except HTTPError as err: if err.code != 413: raise print("LFS: request entity too large, splitting in half") objects.extend( _patched_fetch_urls(lfs_url, oid_list[:len(oid_list) // 2])) objects.extend( _patched_fetch_urls(lfs_url, oid_list[len(oid_list) // 2:])) return objects git_lfs.fetch_urls = _patched_fetch_urls git_lfs.fetch(PROJECT_ROOT_DIR) # The suffix of source filenames. source_parsers = { '.md': 'recommonmark.parser.CommonMarkParser', } source_suffix = ['.rst', '.md'] # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here.
try: objects.extend(_fetch_urls(lfs_url, oid_list)) except HTTPError as err: if err.code != 413: raise print("LFS: request entity too large, splitting in half") objects.extend( _patched_fetch_urls(lfs_url, oid_list[:len(oid_list) // 2])) objects.extend( _patched_fetch_urls(lfs_url, oid_list[len(oid_list) // 2:])) return objects git_lfs.fetch_urls = _patched_fetch_urls git_lfs.fetch(DOC_SOURCES_DIR) # The suffix of source filenames. source_parsers = { '.md': 'recommonmark.parser.CommonMarkParser', } source_suffix = ['.rst', '.md'] # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here.
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, sys, glob, shutil, subprocess, hashlib, json doc_dir = os.path.dirname(os.path.abspath(__file__)) project_dir = os.path.dirname(doc_dir) sys.path.insert(0, doc_dir) on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if on_rtd: # If runs on ReadTheDocs environment print('Fetching files with git_lfs for %s' % project_dir) # Hack for lacking git-lfs support ReadTheDocs import git_lfs git_lfs.fetch(project_dir) # Generate xml from doxygen subprocess.call(['doxygen', 'Doxyfile']) import sphinx_rtd_theme extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'sphinx_issues', 'nbsphinx', 'sphinx.ext.napoleon', # support doc string with section titles 'sphinx.ext.autosummary', 'sphinx.ext.extlinks', ]
templates_path = ['_templates'] # PYTHONPATH = docs/source DOC_SOURCES_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_ROOT_DIR = os.path.dirname(os.path.dirname(DOC_SOURCES_DIR)) sys.path.insert(0, DOC_SOURCES_DIR) print('PROJECT_ROOT_DIR', PROJECT_ROOT_DIR) # If runs on ReadTheDocs environment on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # Hack for lacking git-lfs support ReadTheDocs if on_rtd: print('Fetching files with git_lfs') from git_lfs import fetch fetch(PROJECT_ROOT_DIR) # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'Model Driven Development for Kuksa Applications' copyright = '2018, Pedro Cuadra'
# All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys sys.path.insert(0, os.path.abspath('..')) on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if on_rtd: # Manually pull in git-lfs files on RTD from git_lfs import fetch fetch(os.path.dirname(os.path.dirname(__file__))) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'nbsphinx' ]
def lfs_checkout(): import git_lfs doc_dir = os.path.dirname(os.path.abspath(__file__)) project_dir = os.path.dirname(doc_dir) git_lfs.fetch(project_dir)
from recommonmark.parser import CommonMarkParser from recommonmark.transform import AutoStructify DOC_SOURCES_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_ROOT_DIR = os.path.dirname(os.path.dirname(DOC_SOURCES_DIR)) sys.path.insert(0, DOC_SOURCES_DIR) print('PROJECT_ROOT_DIR', PROJECT_ROOT_DIR) # If runs on ReadTheDocs environment on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # Hack for lacking git-lfs support ReadTheDocs if on_rtd: print('Fetching files with git_lfs') from git_lfs import fetch fetch(DOC_SOURCES_DIR) # The suffix of source filenames. source_parsers = { '.md': 'recommonmark.parser.CommonMarkParser', } source_suffix = ['.rst', '.md'] # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here.
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, sys, glob, shutil, subprocess, hashlib, json doc_dir = os.path.dirname(os.path.abspath(__file__)) project_dir = os.path.dirname(doc_dir) sys.path.insert(0, doc_dir) # If runs on ReadTheDocs environment on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # Hack for lacking git-lfs support ReadTheDocs if on_rtd: print('Fetching files with git_lfs for %s' % project_dir) from git_lfs import fetch fetch(project_dir) subprocess.call('doxygen Doxyfile', shell=True) # Generate xml from doxygen import sphinx_rtd_theme extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'sphinx_gallery.gen_gallery', 'breathe', 'sphinx_issues', ] # Github repo issues_github_path = 'unrealcv/unrealcv'
import sys import os # PYTHONPATH = docs/source DOC_SOURCES_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_ROOT_DIR = os.path.dirname(DOC_SOURCES_DIR) sys.path.insert(0, DOC_SOURCES_DIR) # If runs on ReadTheDocs environment on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # Hack for lacking git-lfs support ReadTheDocs if on_rtd: # print('Fetching files with git_lfs') from git_lfs import fetch fetch(PROJECT_ROOT_DIR) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../')) sys.path.insert(0, os.path.abspath('../pyspectral')) class Mock(object): """Mock class for doc/unit testing (on Travis)""" __all__ = [] def __init__(self, *args, **kwargs):