diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-08-14 08:28:58 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-08-14 08:28:58 +0300 |
commit | 8412347f5dc129b42e4dd05d7f8921a77fe90918 (patch) | |
tree | ba89b3ba9974a52797f8da1580401fa6c9db8cd3 /sphinx/util | |
parent | ba0e5d0ec235212bca653c9a0f2dc390ec6a6122 (diff) | |
parent | b2d524d2b23e142fd91c39d862fa04eb4acc3b22 (diff) |
Merge branch '3.x'
Diffstat (limited to 'sphinx/util')
-rw-r--r-- | sphinx/util/cfamily.py | 2 | ||||
-rw-r--r-- | sphinx/util/i18n.py | 6 | ||||
-rw-r--r-- | sphinx/util/template.py | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/sphinx/util/cfamily.py b/sphinx/util/cfamily.py index d4c21bfdb..66ee96374 100644 --- a/sphinx/util/cfamily.py +++ b/sphinx/util/cfamily.py @@ -374,7 +374,7 @@ class BaseParser: % startPos) return self.definition[startPos:self.pos] - def _parse_attribute(self) -> ASTAttribute: + def _parse_attribute(self) -> Optional[ASTAttribute]: self.skip_ws() # try C++11 style startPos = self.pos diff --git a/sphinx/util/i18n.py b/sphinx/util/i18n.py index e8bd14db9..e5d4f112e 100644 --- a/sphinx/util/i18n.py +++ b/sphinx/util/i18n.py @@ -12,7 +12,7 @@ import os import re from datetime import datetime, timezone from os import path -from typing import Callable, Generator, List, NamedTuple, Tuple +from typing import Callable, Generator, List, NamedTuple, Tuple, Union from typing import TYPE_CHECKING import babel.dates @@ -117,8 +117,10 @@ class CatalogRepository: yield CatalogInfo(basedir, domain, self.encoding) -def docname_to_domain(docname: str, compation: bool) -> str: +def docname_to_domain(docname: str, compation: Union[bool, str]) -> str: """Convert docname to domain for catalogs.""" + if isinstance(compation, str): + return compation if compation: return docname.split(SEP, 1)[0] else: diff --git a/sphinx/util/template.py b/sphinx/util/template.py index 18047d687..bb078a2a2 100644 --- a/sphinx/util/template.py +++ b/sphinx/util/template.py @@ -84,6 +84,8 @@ class LaTeXRenderer(SphinxRenderer): self.env.variable_end_string = '%>' self.env.block_start_string = '<%' self.env.block_end_string = '%>' + self.env.comment_start_string = '<#' + self.env.comment_end_string = '<#' class ReSTRenderer(SphinxRenderer): |