mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
rawsource is deprecated in docutils.nodes.Text
This commit is contained in:
@@ -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'])
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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], []
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
################################################################################
|
||||
|
||||
Reference in New Issue
Block a user