Esempio n. 1
0
    def is_meta_keywords(self, node: addnodes.meta) -> bool:
        if isinstance(node, addnodes.meta) and node.get('name') == 'keywords':
            meta_lang = node.get('lang')
            if meta_lang is None:  # lang not specified
                return True
            elif meta_lang == self.lang.lang:  # matched to html_search_language
                return True

        return False
Esempio n. 2
0
    def is_meta_keywords(self, node: addnodes.meta, nodetype: Any = None) -> bool:
        if nodetype is not None:
            warnings.warn('"nodetype" argument for WordCollector.is_meta_keywords() '
                          'is deprecated.', RemovedInSphinx40Warning, stacklevel=2)

        if isinstance(node, addnodes.meta) and node.get('name') == 'keywords':
            meta_lang = node.get('lang')
            if meta_lang is None:  # lang not specified
                return True
            elif meta_lang == self.lang.lang:  # matched to html_search_language
                return True

        return False