summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>2022-04-22 03:28:12 +0100
committerAdam Turner <9087854+AA-Turner@users.noreply.github.com>2022-04-22 04:21:38 +0100
commitcbe0c99181ba9398b5905a34dde7dc96dd369fd8 (patch)
tree9d7443c4641d2430da956e08bcad1c47a8cc763d
parent644a754ba12030a40c873ac8f62656c5d3d9cc82 (diff)
downloadsphinx-git-cbe0c99181ba9398b5905a34dde7dc96dd369fd8.tar.gz
`rawsource` is deprecated in `docutils.nodes.Text`
-rw-r--r--doc/development/tutorials/examples/todo.py4
-rw-r--r--sphinx/builders/latex/__init__.py4
-rw-r--r--sphinx/builders/texinfo.py4
-rw-r--r--sphinx/directives/other.py2
-rw-r--r--sphinx/domains/index.py2
-rw-r--r--sphinx/domains/std.py4
-rw-r--r--sphinx/ext/todo.py4
-rw-r--r--sphinx/roles.py4
-rw-r--r--sphinx/transforms/__init__.py2
-rw-r--r--sphinx/util/cfamily.py8
10 files changed, 19 insertions, 19 deletions
diff --git a/doc/development/tutorials/examples/todo.py b/doc/development/tutorials/examples/todo.py
index 59e394ee8..61eaac388 100644
--- a/doc/development/tutorials/examples/todo.py
+++ b/doc/development/tutorials/examples/todo.py
@@ -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'])
diff --git a/sphinx/builders/latex/__init__.py b/sphinx/builders/latex/__init__.py
index f1611ca80..47aa59344 100644
--- a/sphinx/builders/latex/__init__.py
+++ b/sphinx/builders/latex/__init__.py
@@ -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
diff --git a/sphinx/builders/texinfo.py b/sphinx/builders/texinfo.py
index d506d2121..33b866e56 100644
--- a/sphinx/builders/texinfo.py
+++ b/sphinx/builders/texinfo.py
@@ -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
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py
index 83cbb6707..083fa088a 100644
--- a/sphinx/directives/other.py
+++ b/sphinx/directives/other.py
@@ -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)
diff --git a/sphinx/domains/index.py b/sphinx/domains/index.py
index 8c630c8f5..42ad3c760 100644
--- a/sphinx/domains/index.py
+++ b/sphinx/domains/index.py
@@ -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], []
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
index ce9aae3a8..d5c962dc8 100644
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -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
diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py
index c0d034087..a5eab6069 100644
--- a/sphinx/ext/todo.py
+++ b/sphinx/ext/todo.py
@@ -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
diff --git a/sphinx/roles.py b/sphinx/roles.py
index e2564269e..1c5216196 100644
--- a/sphinx/roles.py
+++ b/sphinx/roles.py
@@ -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
diff --git a/sphinx/transforms/__init__.py b/sphinx/transforms/__init__.py
index 083fe2b9d..b661870bf 100644
--- a/sphinx/transforms/__init__.py
+++ b/sphinx/transforms/__init__.py
@@ -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):
diff --git a/sphinx/util/cfamily.py b/sphinx/util/cfamily.py
index e751ae9bb..4bb1f2eca 100644
--- a/sphinx/util/cfamily.py
+++ b/sphinx/util/cfamily.py
@@ -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))
################################################################################