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 = (
|
description = (
|
||||||
_('(The original entry is located in %s, line %d and can be found ') %
|
_('(The original entry is located in %s, line %d and can be found ') %
|
||||||
(filename, todo_info['lineno']))
|
(filename, todo_info['lineno']))
|
||||||
para += nodes.Text(description, description)
|
para += nodes.Text(description)
|
||||||
|
|
||||||
# Create a reference
|
# Create a reference
|
||||||
newnode = nodes.reference('', '')
|
newnode = nodes.reference('', '')
|
||||||
@@ -104,7 +104,7 @@ def process_todo_nodes(app, doctree, fromdocname):
|
|||||||
newnode['refuri'] += '#' + todo_info['target']['refid']
|
newnode['refuri'] += '#' + todo_info['target']['refid']
|
||||||
newnode.append(innernode)
|
newnode.append(innernode)
|
||||||
para += newnode
|
para += newnode
|
||||||
para += nodes.Text('.)', '.)')
|
para += nodes.Text('.)')
|
||||||
|
|
||||||
# Insert into the todolist
|
# Insert into the todolist
|
||||||
content.append(todo_info['todo'])
|
content.append(todo_info['todo'])
|
||||||
|
|||||||
@@ -352,9 +352,9 @@ class LaTeXBuilder(Builder):
|
|||||||
newnodes: List[Node] = [nodes.emphasis(sectname, sectname)]
|
newnodes: List[Node] = [nodes.emphasis(sectname, sectname)]
|
||||||
for subdir, title in self.titles:
|
for subdir, title in self.titles:
|
||||||
if docname.startswith(subdir):
|
if docname.startswith(subdir):
|
||||||
newnodes.append(nodes.Text(_(' (in '), _(' (in ')))
|
newnodes.append(nodes.Text(_(' (in ')))
|
||||||
newnodes.append(nodes.emphasis(title, title))
|
newnodes.append(nodes.emphasis(title, title))
|
||||||
newnodes.append(nodes.Text(')', ')'))
|
newnodes.append(nodes.Text(')'))
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -155,9 +155,9 @@ class TexinfoBuilder(Builder):
|
|||||||
newnodes: List[Node] = [nodes.emphasis(sectname, sectname)]
|
newnodes: List[Node] = [nodes.emphasis(sectname, sectname)]
|
||||||
for subdir, title in self.titles:
|
for subdir, title in self.titles:
|
||||||
if docname.startswith(subdir):
|
if docname.startswith(subdir):
|
||||||
newnodes.append(nodes.Text(_(' (in '), _(' (in ')))
|
newnodes.append(nodes.Text(_(' (in ')))
|
||||||
newnodes.append(nodes.emphasis(title, title))
|
newnodes.append(nodes.emphasis(title, title))
|
||||||
newnodes.append(nodes.Text(')', ')'))
|
newnodes.append(nodes.Text(')'))
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class Author(SphinxDirective):
|
|||||||
text = _('Code author: ')
|
text = _('Code author: ')
|
||||||
else:
|
else:
|
||||||
text = _('Author: ')
|
text = _('Author: ')
|
||||||
emph += nodes.Text(text, text)
|
emph += nodes.Text(text)
|
||||||
inodes, messages = self.state.inline_text(self.arguments[0], self.lineno)
|
inodes, messages = self.state.inline_text(self.arguments[0], self.lineno)
|
||||||
emph.extend(inodes)
|
emph.extend(inodes)
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class IndexRole(ReferenceRole):
|
|||||||
|
|
||||||
index = addnodes.index(entries=entries)
|
index = addnodes.index(entries=entries)
|
||||||
target = nodes.target('', '', ids=[target_id])
|
target = nodes.target('', '', ids=[target_id])
|
||||||
text = nodes.Text(title, title)
|
text = nodes.Text(title)
|
||||||
self.set_source_info(index)
|
self.set_source_info(index)
|
||||||
return [index, target, text], []
|
return [index, target, text], []
|
||||||
|
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ def token_xrefs(text: str, productionGroup: str = '') -> List[Node]:
|
|||||||
for m in token_re.finditer(text):
|
for m in token_re.finditer(text):
|
||||||
if m.start() > pos:
|
if m.start() > pos:
|
||||||
txt = text[pos:m.start()]
|
txt = text[pos:m.start()]
|
||||||
retnodes.append(nodes.Text(txt, txt))
|
retnodes.append(nodes.Text(txt))
|
||||||
token = m.group(1)
|
token = m.group(1)
|
||||||
if ':' in token:
|
if ':' in token:
|
||||||
if token[0] == '~':
|
if token[0] == '~':
|
||||||
@@ -437,7 +437,7 @@ def token_xrefs(text: str, productionGroup: str = '') -> List[Node]:
|
|||||||
retnodes.append(refnode)
|
retnodes.append(refnode)
|
||||||
pos = m.end()
|
pos = m.end()
|
||||||
if pos < len(text):
|
if pos < len(text):
|
||||||
retnodes.append(nodes.Text(text[pos:], text[pos:]))
|
retnodes.append(nodes.Text(text[pos:]))
|
||||||
return retnodes
|
return retnodes
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class TodoListProcessor:
|
|||||||
suffix = description[description.find('>>') + 2:]
|
suffix = description[description.find('>>') + 2:]
|
||||||
|
|
||||||
para = nodes.paragraph(classes=['todo-source'])
|
para = nodes.paragraph(classes=['todo-source'])
|
||||||
para += nodes.Text(prefix, prefix)
|
para += nodes.Text(prefix)
|
||||||
|
|
||||||
# Create a reference
|
# Create a reference
|
||||||
linktext = nodes.emphasis(_('original entry'), _('original entry'))
|
linktext = nodes.emphasis(_('original entry'), _('original entry'))
|
||||||
@@ -172,7 +172,7 @@ class TodoListProcessor:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
para += reference
|
para += reference
|
||||||
para += nodes.Text(suffix, suffix)
|
para += nodes.Text(suffix)
|
||||||
|
|
||||||
return para
|
return para
|
||||||
|
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ class EmphasizedLiteral(SphinxRole):
|
|||||||
if len(stack) == 3 and stack[1] == "{" and len(stack[2]) > 0:
|
if len(stack) == 3 and stack[1] == "{" and len(stack[2]) > 0:
|
||||||
# emphasized word found
|
# emphasized word found
|
||||||
if stack[0]:
|
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]))
|
result.append(nodes.emphasis(stack[2], stack[2]))
|
||||||
stack = ['']
|
stack = ['']
|
||||||
else:
|
else:
|
||||||
@@ -310,7 +310,7 @@ class EmphasizedLiteral(SphinxRole):
|
|||||||
if ''.join(stack):
|
if ''.join(stack):
|
||||||
# remaining is treated as Text
|
# remaining is treated as Text
|
||||||
text = ''.join(stack)
|
text = ''.join(stack)
|
||||||
result.append(nodes.Text(text, text))
|
result.append(nodes.Text(text))
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class DefaultSubstitutions(SphinxTransform):
|
|||||||
# special handling: can also specify a strftime format
|
# special handling: can also specify a strftime format
|
||||||
text = format_date(self.config.today_fmt or _('%b %d, %Y'),
|
text = format_date(self.config.today_fmt or _('%b %d, %Y'),
|
||||||
language=self.config.language)
|
language=self.config.language)
|
||||||
ref.replace_self(nodes.Text(text, text))
|
ref.replace_self(nodes.Text(text))
|
||||||
|
|
||||||
|
|
||||||
class MoveModuleTargets(SphinxTransform):
|
class MoveModuleTargets(SphinxTransform):
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class ASTCPPAttribute(ASTAttribute):
|
|||||||
|
|
||||||
def describe_signature(self, signode: TextElement) -> None:
|
def describe_signature(self, signode: TextElement) -> None:
|
||||||
signode.append(addnodes.desc_sig_punctuation('[[', '[['))
|
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(']]', ']]'))
|
signode.append(addnodes.desc_sig_punctuation(']]', ']]'))
|
||||||
|
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ class ASTGnuAttributeList(ASTAttribute):
|
|||||||
|
|
||||||
def describe_signature(self, signode: TextElement) -> None:
|
def describe_signature(self, signode: TextElement) -> None:
|
||||||
txt = str(self)
|
txt = str(self)
|
||||||
signode.append(nodes.Text(txt, txt))
|
signode.append(nodes.Text(txt))
|
||||||
|
|
||||||
|
|
||||||
class ASTIdAttribute(ASTAttribute):
|
class ASTIdAttribute(ASTAttribute):
|
||||||
@@ -174,7 +174,7 @@ class ASTIdAttribute(ASTAttribute):
|
|||||||
return self.id
|
return self.id
|
||||||
|
|
||||||
def describe_signature(self, signode: TextElement) -> None:
|
def describe_signature(self, signode: TextElement) -> None:
|
||||||
signode.append(nodes.Text(self.id, self.id))
|
signode.append(nodes.Text(self.id))
|
||||||
|
|
||||||
|
|
||||||
class ASTParenAttribute(ASTAttribute):
|
class ASTParenAttribute(ASTAttribute):
|
||||||
@@ -189,7 +189,7 @@ class ASTParenAttribute(ASTAttribute):
|
|||||||
|
|
||||||
def describe_signature(self, signode: TextElement) -> None:
|
def describe_signature(self, signode: TextElement) -> None:
|
||||||
txt = str(self)
|
txt = str(self)
|
||||||
signode.append(nodes.Text(txt, txt))
|
signode.append(nodes.Text(txt))
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user