rawsource is deprecated in docutils.nodes.Text

This commit is contained in:
Adam Turner
2022-04-22 03:28:12 +01:00
parent 644a754ba1
commit cbe0c99181
10 changed files with 19 additions and 19 deletions

View File

@@ -93,7 +93,7 @@ def process_todo_nodes(app, doctree, fromdocname):
description = (
_('(The original entry is located in %s, line %d and can be found ') %
(filename, todo_info['lineno']))
para += nodes.Text(description, description)
para += nodes.Text(description)
# Create a reference
newnode = nodes.reference('', '')
@@ -104,7 +104,7 @@ def process_todo_nodes(app, doctree, fromdocname):
newnode['refuri'] += '#' + todo_info['target']['refid']
newnode.append(innernode)
para += newnode
para += nodes.Text('.)', '.)')
para += nodes.Text('.)')
# Insert into the todolist
content.append(todo_info['todo'])

View File

@@ -352,9 +352,9 @@ class LaTeXBuilder(Builder):
newnodes: List[Node] = [nodes.emphasis(sectname, sectname)]
for subdir, title in self.titles:
if docname.startswith(subdir):
newnodes.append(nodes.Text(_(' (in '), _(' (in ')))
newnodes.append(nodes.Text(_(' (in ')))
newnodes.append(nodes.emphasis(title, title))
newnodes.append(nodes.Text(')', ')'))
newnodes.append(nodes.Text(')'))
break
else:
pass

View File

@@ -155,9 +155,9 @@ class TexinfoBuilder(Builder):
newnodes: List[Node] = [nodes.emphasis(sectname, sectname)]
for subdir, title in self.titles:
if docname.startswith(subdir):
newnodes.append(nodes.Text(_(' (in '), _(' (in ')))
newnodes.append(nodes.Text(_(' (in ')))
newnodes.append(nodes.emphasis(title, title))
newnodes.append(nodes.Text(')', ')'))
newnodes.append(nodes.Text(')'))
break
else:
pass

View File

@@ -172,7 +172,7 @@ class Author(SphinxDirective):
text = _('Code author: ')
else:
text = _('Author: ')
emph += nodes.Text(text, text)
emph += nodes.Text(text)
inodes, messages = self.state.inline_text(self.arguments[0], self.lineno)
emph.extend(inodes)

View File

@@ -102,7 +102,7 @@ class IndexRole(ReferenceRole):
index = addnodes.index(entries=entries)
target = nodes.target('', '', ids=[target_id])
text = nodes.Text(title, title)
text = nodes.Text(title)
self.set_source_info(index)
return [index, target, text], []

View File

@@ -416,7 +416,7 @@ def token_xrefs(text: str, productionGroup: str = '') -> List[Node]:
for m in token_re.finditer(text):
if m.start() > pos:
txt = text[pos:m.start()]
retnodes.append(nodes.Text(txt, txt))
retnodes.append(nodes.Text(txt))
token = m.group(1)
if ':' in token:
if token[0] == '~':
@@ -437,7 +437,7 @@ def token_xrefs(text: str, productionGroup: str = '') -> List[Node]:
retnodes.append(refnode)
pos = m.end()
if pos < len(text):
retnodes.append(nodes.Text(text[pos:], text[pos:]))
retnodes.append(nodes.Text(text[pos:]))
return retnodes

View File

@@ -159,7 +159,7 @@ class TodoListProcessor:
suffix = description[description.find('>>') + 2:]
para = nodes.paragraph(classes=['todo-source'])
para += nodes.Text(prefix, prefix)
para += nodes.Text(prefix)
# Create a reference
linktext = nodes.emphasis(_('original entry'), _('original entry'))
@@ -172,7 +172,7 @@ class TodoListProcessor:
pass
para += reference
para += nodes.Text(suffix, suffix)
para += nodes.Text(suffix)
return para

View File

@@ -293,7 +293,7 @@ class EmphasizedLiteral(SphinxRole):
if len(stack) == 3 and stack[1] == "{" and len(stack[2]) > 0:
# emphasized word found
if stack[0]:
result.append(nodes.Text(stack[0], stack[0]))
result.append(nodes.Text(stack[0]))
result.append(nodes.emphasis(stack[2], stack[2]))
stack = ['']
else:
@@ -310,7 +310,7 @@ class EmphasizedLiteral(SphinxRole):
if ''.join(stack):
# remaining is treated as Text
text = ''.join(stack)
result.append(nodes.Text(text, text))
result.append(nodes.Text(text))
return result

View File

@@ -109,7 +109,7 @@ class DefaultSubstitutions(SphinxTransform):
# special handling: can also specify a strftime format
text = format_date(self.config.today_fmt or _('%b %d, %Y'),
language=self.config.language)
ref.replace_self(nodes.Text(text, text))
ref.replace_self(nodes.Text(text))
class MoveModuleTargets(SphinxTransform):

View File

@@ -128,7 +128,7 @@ class ASTCPPAttribute(ASTAttribute):
def describe_signature(self, signode: TextElement) -> None:
signode.append(addnodes.desc_sig_punctuation('[[', '[['))
signode.append(nodes.Text(self.arg, self.arg))
signode.append(nodes.Text(self.arg))
signode.append(addnodes.desc_sig_punctuation(']]', ']]'))
@@ -161,7 +161,7 @@ class ASTGnuAttributeList(ASTAttribute):
def describe_signature(self, signode: TextElement) -> None:
txt = str(self)
signode.append(nodes.Text(txt, txt))
signode.append(nodes.Text(txt))
class ASTIdAttribute(ASTAttribute):
@@ -174,7 +174,7 @@ class ASTIdAttribute(ASTAttribute):
return self.id
def describe_signature(self, signode: TextElement) -> None:
signode.append(nodes.Text(self.id, self.id))
signode.append(nodes.Text(self.id))
class ASTParenAttribute(ASTAttribute):
@@ -189,7 +189,7 @@ class ASTParenAttribute(ASTAttribute):
def describe_signature(self, signode: TextElement) -> None:
txt = str(self)
signode.append(nodes.Text(txt, txt))
signode.append(nodes.Text(txt))
################################################################################