Skip to content

Commit

Permalink
Remove 'content' command from docs contents extension
Browse files Browse the repository at this point in the history
  • Loading branch information
cticenhour committed Dec 18, 2024
1 parent 92ef6c6 commit d762dbe
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions python/MooseDocs/extensions/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def binContent(self, page, location=None, method=None):
return headings

class ContentCommand(command.CommandComponent):
COMMAND = ('content', 'contents') #TODO: Change this to content after format is working
COMMAND = ('content')
SUBCOMMAND = (None, 'list')

@staticmethod
Expand All @@ -122,14 +122,11 @@ def defaultSettings():
return settings

def createToken(self, parent, info, page, settings):
if info['command'] == 'contents':
msg = 'The command "!contents" is deprecated, please use "!content list".'
LOG.warning(common.report_error(msg, page.source, info.line, info[0], prefix='WARNING'))
ContentToken(parent, location=settings['location'], level=settings['level'])
return parent

class AtoZCommand(command.CommandComponent):
COMMAND = ('content', 'contents')
COMMAND = ('content')
SUBCOMMAND = 'a-to-z'

@staticmethod
Expand All @@ -141,15 +138,12 @@ def defaultSettings():
return settings

def createToken(self, parent, info, page, settings):
if info['command'] == 'contents':
msg = 'The command "!contents a-to-z" is deprecated, please use "!content a-to-z".'
LOG.warning(common.report_error(msg, page.source, info.line, info[0], prefix='WARNING'))
AtoZToken(parent, location=settings['location'], level=settings['level'],
buttons=settings['buttons'])
return parent

class TableOfContentsCommand(command.CommandComponent):
COMMAND = ('content', 'contents')
COMMAND = ('content')
SUBCOMMAND = 'toc'

@staticmethod
Expand All @@ -161,10 +155,6 @@ def defaultSettings():
return settings

def createToken(self, parent, info, page, settings):
if info['command'] == 'contents':
msg = 'The command "!contents toc" is deprecated, please use "!content toc".'
LOG.warning(common.report_error(msg, page.source, info.line, info[0], prefix='WARNING'))

levels = settings['levels']
if isinstance(levels, (str, str)):
levels = [int(l) for l in levels.split()]
Expand Down Expand Up @@ -483,5 +473,5 @@ def createHTMLHelper(self, parent, token, page, direction):
string=string)

def createLatex(self, parent, token, page):
msg = "Warning: The Content Extension\'s 'pagination' command is not supported for LaTex documents."
msg = "Warning: The Content Extension\'s 'pagination' command is not supported for LaTeX documents."
latex.String(parent, content=msg)

0 comments on commit d762dbe

Please sign in to comment.