Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown directives within only:: or ifconfig:: blocks still generate error messages #4224

Closed
markcmiller86 opened this issue Nov 7, 2017 · 2 comments

Comments

@markcmiller86
Copy link

markcmiller86 commented Nov 7, 2017

Subject: unknown directives within only:: or ifconfig:: blocks still generate error messages

Problem

Both of the following constructs aim to prevent the .. spelling:: directive block from being interpreted except in certain conditions.

.. only:: spelling

   .. spelling::

      foobar


or

.. ifconfig:: spellcheck in ('yes')

   .. spelling::

      foobar

With sphinx-build invoked with or without -t spelling the .. only:: version winds up generating the error message below. Likewise with conf.py adjusted to include the ifconfig extension and then...

spellcheck = 'no'
def setup(app):
    app.add_config_value('spellcheck', '', 'html')

Also winds up generating the error message...

/Users/miller86/visit/trunk_SphynxDocs/WorkingWithFiles/Supported_File_Types.rst:3: ERROR: Unknown directive type "spelling".

.. spelling::

   foobar

Expected results

I expected sphinx not to attempt to intepret any content in a block that was deemed not relevant by the enclosing .. only:: or .. ifconfig:: directive.

Environment info

  • OS: OSX 10.11.6
  • Python version: 2.7 and 3.6
  • Sphinx version: 1.5.5 and 1.6.3
    sphinx-spelling extension
@tk0miya
Copy link
Member

tk0miya commented Nov 15, 2017

Unfortunately, only and ifconfig works on writing phase. So the contents of these directives are parsed on reading phase. This is specification of these directives.

@markcmiller86
Copy link
Author

markcmiller86 commented Nov 15, 2017

Thanks for response.

Indeed...that is unfortunate!

That said, I did resolve my particular issue a different way and you can read about it here if interested.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants