Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

Override domains and translator only in HTML output #62

Open
humitos opened this issue Apr 16, 2020 · 2 comments
Open

Override domains and translator only in HTML output #62

humitos opened this issue Apr 16, 2020 · 2 comments
Labels
Bug A bug

Comments

@humitos
Copy link
Member

humitos commented Apr 16, 2020

We need to override the Domains and Translators only when building app.builder.format == 'html', otherwise it makes no sense and it could produce issues.

Reference: CEED/libCEED#506 (comment)

@humitos humitos added the Bug A bug label Apr 16, 2020
@humitos
Copy link
Member Author

humitos commented Apr 16, 2020

I built the project locally by myself and this is the whole output:

Traceback (most recent call last):
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/application.py", line 348, in build
    self.builder.build_update()
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 294, in build_update
    self.build(['__all__'], to_build)
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 361, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/builders/latex/__init__.py", line 283, in write
    doctree = self.assemble_doctree(
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/builders/latex/__init__.py", line 344, in assemble_doctree
    self.env.resolve_references(largetree, indexfile, self)
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/environment/__init__.py", line 572, in resolve_references
    self.apply_post_transforms(doctree, fromdocname)
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/environment/__init__.py", line 584, in apply_post_transforms
    transformer.apply_transforms()
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/transforms/__init__.py", line 86, in apply_transforms
    super().apply_transforms()
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
    transform.apply(**kwargs)
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/transforms/post_transforms/__init__.py", line 44, in apply
    self.run(**kwargs)
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/transforms/post_transforms/__init__.py", line 87, in run
    newnode = domain.resolve_xref(self.env, refdoc, self.app.builder,
  File "/home/humitos/rtfd/code/sphinx-hoverxref/hoverxref/domains.py", line 120, in resolve_xref
    return super().resolve_xref(env, fromdocname, builder, typ, target, node, contnode)
  File "/home/humitos/.pyenv/versions/3.8.2/envs/libCEED/lib/python3.8/site-packages/sphinx/domains/std.py", line 795, in resolve_xref
    return resolver(env, fromdocname, builder, typ, target, node, contnode)
  File "/home/humitos/rtfd/code/sphinx-hoverxref/hoverxref/domains.py", line 137, in _resolve_ref_xref
    docpath = self._get_docpath(builder, docname)
  File "/home/humitos/rtfd/code/sphinx-hoverxref/hoverxref/domains.py", line 50, in _get_docpath
    docpath = builder.get_outfilename(docname)
AttributeError: 'LaTeXBuilder' object has no attribute 'get_outfilename'

@humitos
Copy link
Member Author

humitos commented Apr 16, 2020

A temporal hacky solution at #63

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug
Projects
None yet
Development

No branches or pull requests

1 participant