Hi,

I think installing custom transform might resolve your situation.
Please add following code into your conf.py

```
from docutils import nodes
from docutils.transforms import Transform
from sphinx.util import logging

logger = logging.getLogger(__name__)


class MySiteDetector(Transform):
    default_priority = 500

    def apply(self):
        for node in self.document.traverse(nodes.reference):
            if node['refuri'].startswith('http://my-docs-site.com/'):
                logger.warning('found: %r', node, location=node)


def setup(app):
    app.add_transform(MySiteDetector)
```

Please read the documentation of docutils for more details.


Thanks,
Takeshi KOMIYA

2018-02-12 16:46 GMT+09:00 Tzach Livyatan <[email protected]>:
> Hi
> I want to generate a warning base on the format of links in my docs. In
> particular, anytime someone uses an absolute path starting with
> http://my-docs-site.com/ instead of a releative path.
> What is the idiomatic way to do that with Sphinx?
>
> Thanks
> Tzach
>
> --
> 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 https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to