summaryrefslogtreecommitdiff
path: root/sphinx/writers/html5.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/writers/html5.py')
-rw-r--r--sphinx/writers/html5.py34
1 files changed, 1 insertions, 33 deletions
diff --git a/sphinx/writers/html5.py b/sphinx/writers/html5.py
index 1a0b6f28e..1556f84e4 100644
--- a/sphinx/writers/html5.py
+++ b/sphinx/writers/html5.py
@@ -4,7 +4,6 @@ import os
import posixpath
import re
import urllib.parse
-import warnings
from typing import TYPE_CHECKING, Iterable, Optional, Set, Tuple, cast
from docutils import nodes
@@ -13,7 +12,6 @@ from docutils.writers.html5_polyglot import HTMLTranslator as BaseTranslator
from sphinx import addnodes
from sphinx.builders import Builder
-from sphinx.deprecation import RemovedInSphinx60Warning
from sphinx.locale import _, __, admonitionlabels
from sphinx.util import logging
from sphinx.util.docutils import SphinxTranslator
@@ -406,14 +404,11 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
return super().visit_literal_block(node)
lang = node.get('language', 'default')
- linenos = node.get('linenos', False)
+ linenos = node.get('linenos', False) and "inline"
highlight_args = node.get('highlight_args', {})
highlight_args['force'] = node.get('force', False)
opts = self.config.highlight_options.get(lang, {})
- if linenos and self.config.html_codeblock_linenos_style:
- linenos = self.config.html_codeblock_linenos_style
-
highlighted = self.highlighter.highlight_block(
node.rawsource, lang, opts=opts, linenos=linenos,
location=node, **highlight_args
@@ -820,30 +815,3 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
_, depart = self.builder.app.registry.html_block_math_renderers[name]
if depart:
depart(self, node)
-
- def generate_targets_for_table(self, node: Element) -> None:
- """Generate hyperlink targets for tables.
-
- Original visit_table() generates hyperlink targets inside table tags
- (<table>) if multiple IDs are assigned to listings.
- That is invalid DOM structure. (This is a bug of docutils <= 0.13.1)
-
- This exports hyperlink targets before tables to make valid DOM structure.
- """
- warnings.warn('generate_targets_for_table() is deprecated',
- RemovedInSphinx60Warning, stacklevel=2)
- for id in node['ids'][1:]:
- self.body.append('<span id="%s"></span>' % id)
- node['ids'].remove(id)
-
- @property
- def _fieldlist_row_index(self) -> int:
- warnings.warn('_fieldlist_row_index is deprecated',
- RemovedInSphinx60Warning, stacklevel=2)
- return self._fieldlist_row_indices[-1]
-
- @property
- def _table_row_index(self) -> int:
- warnings.warn('_table_row_index is deprecated',
- RemovedInSphinx60Warning, stacklevel=2)
- return self._table_row_indices[-1]