Reworked the installation of the Dynare sphinx domain and pygment lexer.

time-shift
Stéphane Adjemian (Charybdis) 2019-02-19 09:32:45 +01:00
parent f4ce25c982
commit 9e3141482b
Signed by untrusted user who does not match committer: stepan
GPG Key ID: A6D44CB9C64CE77B
5 changed files with 9 additions and 7 deletions

2
.gitignore vendored
View File

@ -2,5 +2,5 @@
python/*
src/build/*
src/source/__pycache__/*
py/domain/__pycache__/*
utils/__pycache__/*
src/source/_static/mathjax/*

View File

@ -40,8 +40,8 @@ python: python/bin/python3
python/bin/python3:
python3 -m venv python
. python/bin/activate ; pip3 install --upgrade pip ; pip3 install sphinx recommonmark sphinx_rtd_theme
cp py/pygment/dynare.py python/lib/python3.*/site-packages/pygments/lexers/
cd python/lib/python3.*/site-packages/pygments/lexers ; python3 _mapping.py
# cp py/pygment/dynare.py python/lib/python3.*/site-packages/pygments/lexers/
# cd python/lib/python3.*/site-packages/pygments/lexers ; python3 _mapping.py
mathjax: src/source/_static/mathjax/MathJax.js
@touch src/source/_static/mathjax/MathJax.js

View File

@ -20,7 +20,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('../../py/domain/'))
sys.path.insert(0, os.path.abspath('../../utils'))
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.mathjax']
@ -92,5 +92,7 @@ man_pages = [
]
def setup(app):
from dynare import DynDomain
app.add_domain(DynDomain)
from dynare_dom import DynareDomain
from dynare_lex import DynareLexer
app.add_lexer("dynare", DynareLexer())
app.add_domain(DynareDomain)

View File

@ -287,7 +287,7 @@ class DynareXRefRole(XRefRole):
############### Dynare domain #######################
class DynDomain(Domain):
class DynareDomain(Domain):
name = 'dynare'
label = 'Dynare'
object_types = {