mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add warning for Application.add_source_parser()
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -10,6 +10,7 @@ Features added
|
||||
- ``app.add_directive``
|
||||
- ``app.add_role``
|
||||
- ``app.add_generic_role``
|
||||
- ``app.add_source_parser``
|
||||
- ``image.data_uri``
|
||||
- ``image.nonlocal_uri``
|
||||
|
||||
|
||||
@@ -222,6 +222,7 @@ General configuration
|
||||
* app.add_directive
|
||||
* app.add_role
|
||||
* app.add_generic_role
|
||||
* app.add_source_parser
|
||||
* image.data_uri
|
||||
* image.nonlocal_uri
|
||||
* ref.term
|
||||
|
||||
@@ -788,6 +788,11 @@ class Sphinx(object):
|
||||
|
||||
def add_source_parser(self, suffix, parser):
|
||||
self.debug('[app] adding search source_parser: %r, %r', (suffix, parser))
|
||||
if suffix in self._additional_source_parsers:
|
||||
self.warn('while setting up extension %s: source_parser for %r is '
|
||||
'already registered, it will be overridden' %
|
||||
(self._setting_up_extension[-1], suffix),
|
||||
type='app', subtype='add_source_parser')
|
||||
self._additional_source_parsers[suffix] = parser
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user