|
|
@ -12,6 +12,7 @@ from redbot.core.data_manager import cog_data_path
|
|
|
|
|
|
|
|
|
|
|
|
log = logging.getLogger("red.fox-v3.cogguide")
|
|
|
|
log = logging.getLogger("red.fox-v3.cogguide")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EXCLUDED_LIST = ['reinstallreqs']
|
|
|
|
|
|
|
|
|
|
|
|
def get_parent_tree(command: commands.Command):
|
|
|
|
def get_parent_tree(command: commands.Command):
|
|
|
|
out = f"{command.name}"
|
|
|
|
out = f"{command.name}"
|
|
|
@ -32,13 +33,13 @@ def markdown_link_replace(match, starts_with_text=None):
|
|
|
|
url = url[:i]
|
|
|
|
url = url[:i]
|
|
|
|
return f":ref:`{text} <{url}>`"
|
|
|
|
return f":ref:`{text} <{url}>`"
|
|
|
|
|
|
|
|
|
|
|
|
return f"{text}: {url}"
|
|
|
|
return f"`{text} <{url}>`_"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def prepare_description(comm_or_cog: Union[commands.Command, Cog]):
|
|
|
|
def prepare_description(comm_or_cog: Union[commands.Command, Cog]):
|
|
|
|
description = comm_or_cog.description or comm_or_cog.help
|
|
|
|
description = comm_or_cog.description or comm_or_cog.help
|
|
|
|
description = description.replace("`", "``")
|
|
|
|
description = description.replace("`", "``")
|
|
|
|
pattern = re.compile(r"\[(.+)]\s?\((https?:\/\/[\w\d.\/?=#]+)\)")
|
|
|
|
pattern = re.compile(r"\[(.+)]\s?\((https?:\/\/[\w\d.\/?=#-@]+)\)")
|
|
|
|
description = pattern.sub(markdown_link_replace, description)
|
|
|
|
description = pattern.sub(markdown_link_replace, description)
|
|
|
|
return description
|
|
|
|
return description
|
|
|
|
|
|
|
|
|
|
|
@ -207,6 +208,10 @@ Commands
|
|
|
|
com_list = [com for com in cog.walk_commands()]
|
|
|
|
com_list = [com for com in cog.walk_commands()]
|
|
|
|
com_list.sort(key=lambda x: x.qualified_name)
|
|
|
|
com_list.sort(key=lambda x: x.qualified_name)
|
|
|
|
for com in com_list:
|
|
|
|
for com in com_list:
|
|
|
|
|
|
|
|
com: commands.Command
|
|
|
|
|
|
|
|
if com.name in EXCLUDED_LIST:
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
if not com.hidden and com.enabled:
|
|
|
|
cog_commands_list.append(get_command_rst(com))
|
|
|
|
cog_commands_list.append(get_command_rst(com))
|
|
|
|
# for com in cog.walk_commands():
|
|
|
|
# for com in cog.walk_commands():
|
|
|
|
# cog_commands_list.append(get_command_rst(com))
|
|
|
|
# cog_commands_list.append(get_command_rst(com))
|
|
|
|