99"""
1010
1111from __future__ import annotations
12- from typing import List , Set , TYPE_CHECKING , Type , Dict
12+ from typing import List , Set , TYPE_CHECKING , Dict
1313import re
1414
1515from docutils import nodes
2121from sphinx .util import logging
2222
2323from .config import Config
24- from . import Snippet , WithTitle , Document , Section , WithCodeBlock
24+ from . import Snippet , WithTitle , Document , Section
2525from .picker import pick
2626from .cache import Cache , Item
2727from .keyword import Extractor
@@ -41,8 +41,6 @@ def extract_tags(s:Snippet) -> str:
4141 tags += 'd'
4242 elif isinstance (s , Section ):
4343 tags += 's'
44- if isinstance (s , WithCodeBlock ):
45- tags += 'c'
4644 return tags
4745
4846
@@ -63,8 +61,8 @@ def extract_keywords(s:Snippet) -> List[str]:
6361
6462
6563def is_matched (pats :Dict [str ,List [str ]], s :[Snippet ], docname :str ) -> bool :
66- # Wildcard
67- if '*' in pats :
64+ """Whether the snippet's tags and docname matched by given patterns pats"""
65+ if '*' in pats : # Wildcard
6866 for pat in pats ['*' ]:
6967 if re .match (pat , docname ):
7068 return True
0 commit comments