Skip to content

Commit

Permalink
deploy.explode => ExhaleProject; migrate(containmentFolder)
Browse files Browse the repository at this point in the history
- move deploy.explode to ExhaleProject.{parse,explode}
- migrate configs.containmentFolder => configs.Config.containmentFolder
- testing decorator @no_run is currently broken
  • Loading branch information
svenevs committed Jun 5, 2018
1 parent 2061211 commit 20b92f7
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 264 deletions.
17 changes: 17 additions & 0 deletions docs/conf.py
Expand Up @@ -229,6 +229,23 @@
# Output file base name for HTML help builder.
htmlhelp_basename = 'ExhaleDoc'

rst_epilog = ""

# convenience replacements for writing e.g. |containmentFolder| and linking to the
# member of exhale.configs.Config.containmentFolder
import itertools
from exhale.configs import Config
config_replacements_list = [
'containmentFolder'
# TODO: after migration, just use this
# pack[0] for pack in itertools.chain(Config.REQUIRED_KV, Config.OPTIONAL_KV)
]
configs_replacements = "\n".join(
'.. |{config}| replace:: :data:`~exhale.configs.Config.{config}`'.format(config=config)
for config in config_replacements_list
)
rst_epilog = "{0}\n{1}".format(rst_epilog, configs_replacements)


def setup(app):
import os
Expand Down
3 changes: 1 addition & 2 deletions docs/faq.rst
Expand Up @@ -132,8 +132,7 @@ __ https://github.com/svenevs/exhale/issues/2
The consequence of fixing the link is that *locally* the "View Page Source" that
would let you see the generated reStructuredText (e.g. to get the link name) is
now gone. You will have to open the file *manually* in a text editor. Recall that
the generated files get placed in the folder specified by
:data:`~exhale.configs.containmentFolder`.
the generated files get placed in the folder specified by |containmentFolder|.

.. _faq_metaprogramming_and_template_specialization:

Expand Down
19 changes: 0 additions & 19 deletions docs/reference/configs.rst
Expand Up @@ -71,27 +71,8 @@ Breathe as your *default* project. The two arguments that must be present in yo
Required Arguments for Exhale
****************************************************************************************

Users must provide the following values to ``exhale_args`` in their ``conf.py``.

.. tip::

Recall the variable name conventions from above. If you want to specify the value
for ``containmentFolder`` so that :data:`~exhale.configs.containmentFolder` is
populated, the name of the *key* is the string ``"containmentFolder"``. Each entry
below details what the ``type`` of the *value* of the key should be. So in this case
you might have

.. code-block:: py
exhale_args = {
"containmentFolder": "./api",
# other required entries here
}
.. end_minimum_requirements_breathe_and_exhale
.. autodata:: exhale.configs.containmentFolder

.. autodata:: exhale.configs.rootFileName

.. autodata:: exhale.configs.rootFileTitle
Expand Down
56 changes: 47 additions & 9 deletions exhale/__init__.py
Expand Up @@ -70,10 +70,55 @@ def run_doxygen(self):
))

def parse(self):
pass
from . import utils
from .graph import ExhaleRoot
import sys
try:
self.root = ExhaleRoot(self)
except:
utils.fancyError("Unable to create an `ExhaleRoot` object:")

try:
sys.stdout.write("{0}\n".format(utils.info("Exhale: parsing Doxygen XML.")))
start = utils.get_time()

self.root.parse()

end = utils.get_time()
sys.stdout.write("{0}\n".format(
utils.progress("Exhale: finished parsing Doxygen XML in {0}.".format(
utils.time_string(start, end)
))
))
except:
utils.fancyError("Exception caught while parsing:")

def explode(self):
pass
import sys
try:
sys.stdout.write("{0}\n".format(
utils.info("Exhale: generating reStructuredText documents.")
))
start = utils.get_time()

self.root.generateFullAPI()

end = utils.get_time()
sys.stdout.write("{0}\n".format(
utils.progress("Exhale: generated reStructuredText documents in {0}.".format(
utils.time_string(start, end)
))
))
except:
utils.fancyError("Exception caught while generating:")

# << verboseBuild
# toConsole only prints if verbose mode is enabled
self.root.toConsole()

# allow access to the result after-the-fact
from . import configs
configs._the_app.exhale_root = self.root

def environment_ready(app):
# Defer importing configs until sphinx is running.
Expand Down Expand Up @@ -131,13 +176,6 @@ def environment_ready(app):
project.explode()


# Generate the full API!
try:
deploy.explode()
except:
utils.fancyError("Exhale: could not generate reStructuredText documents :/")


def setup(app):
app.setup_extension("breathe")
app.add_config_value("exhale_args", {}, "env")
Expand Down

0 comments on commit 20b92f7

Please sign in to comment.