I'm generating documentation from a combination of sphinx and my own
markup format, for which I'm using a custom parser that I wrote.

This mostly works well, but I'm having problems getting links
(addnodes.pending_xref) to sections in my documents to resolve.

Here is how I create a section:

    name = nodes.fully_normalize_name(text)

    section_node = nodes.section()
    section_node['level'] = level
    section_node['names'].append(name)
    section_node['ids'] = [nodes.make_id(name)]

    title_node = nodes.title(text)
    title_node += nodes.Text(text, text)
    section_node += title_node

    self.document.note_implicit_target(section_node, section_node)

    parent_node += section_node


And here is how I create a pending reference:

    xref_node = addnodes.pending_xref(text, reftype='any',
                                      refdomain='')
    xref_node['refexplicit'] = False
    xref_node['reftarget'] = nodes.fully_normalize_name(text)
    xref_node['refwarn'] = True
    xref_node['refdoc'] = self.document.settings.env.docname
    xref_node += nodes.literal(text, text)
    parent_node += xref_node


Any ideas what I'm missing / doing wrong? (The 'text' in both cases is
the same, and e.g. 'A22_5C'.) I've tried reading through the sphinx
source where it resolves references, but I have to admit I don't follow
what it's doing.

(Some additional background:
https://groups.google.com/forum/#!topic/sphinx-users/O99zegTZvH4)

-- 
Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to