Skip to content

Commit

Permalink
Changing the creation of the tags linking to be document cross-refere…
Browse files Browse the repository at this point in the history
…nces, which seems to care less about the doc structure under which it's built.
  • Loading branch information
kmarsteller committed Nov 13, 2017
1 parent 69fd97d commit b6a01e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
8 changes: 3 additions & 5 deletions openmdao/docs/_exts/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ def run(self):
links = []

for tagg in taggs:
# Create rst hyperlinks of format `Python <http://www.python.org/>`_.
import os
cwd = os.getcwd()
html_dir = os.path.join(cwd, "_build", "html")
link = "`" + tagg + " <" + html_dir + os.sep + "tags" + os.sep + tagg + ".html>`_ "
# Create Sphinx doc refs of format :ref:`Tagname<Tagname>`
link = ":ref:`" + tagg + "<" + tagg + ">`"
#link = "`" + tagg + " <http://openmdao.org/twodocs/versions/latest/tags/" + tagg + ".html>`_"
links.append(link)
# Put links back in a single comma-separated string together
linkjoin = ", ".join(links)
Expand Down
8 changes: 5 additions & 3 deletions openmdao/docs/_utils/preprocess_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ def make_tagfiles(docdirs, tagdir):

# If the tagfile doesn't exist, let's put in a header
if not os.path.exists(filepath):
tagfilelabel = ".. _" + tag + ": \n"
tagfileheader = """
=========================
%s
=========================
.. toctree::
""" % tag


# Write the header for this tag's file.
with open(filepath, 'a') as tagfile:
tagfile.write(tagfilelabel)
tagfile.write(tagfileheader)
# Write a link into an existing tagfile.
with open(filepath, 'a') as tagfile:
Expand All @@ -71,9 +74,8 @@ def make_tagindex(tagdir):
# Once all the files exist, create a simple index.rst file
indexfile = tagdir + "/index.rst"

for filepath, dirnames, filenames in os.walk(tagdir):
with open(indexfile, 'a') as index:
index.write("""
with open(indexfile, 'a') as index:
index.write("""
:orphan:
================
Expand Down
2 changes: 1 addition & 1 deletion openmdao/docs/examples/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _Examples:
.. _OpenMDAO_Examples:

********
Examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ Here are several examples of how you can specify derivative values for different
openmdao.jacobians.tests.test_jacobian_features.SimpleCompConst


.. tags:: Partial Derivatives

.. tags:: PartialDerivatives

0 comments on commit b6a01e2

Please sign in to comment.