Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs command improvements #546

Merged
merged 29 commits into from Nov 15, 2019
Merged

Conversation

Numerlor
Copy link
Contributor

@Numerlor Numerlor commented Oct 20, 2019

Improves the docs command by:

  • Resolving symbol name conflicts
  • Auto deleting commands that didn't find anything
  • Improving output for docs of modules

closes: #538
closes: #210
closes: #381

@Numerlor
Copy link
Contributor Author

any reason signature_buffer is not a list comp?

bot/bot/cogs/doc.py

Lines 210 to 219 in f194df8

signature_buffer = []
if symbol_heading is None:
return None
# Traverse the tags of the signature header and ignore any
# unwanted symbols from it. Add all of it to a temporary buffer.
for tag in symbol_heading.strings:
if tag not in UNWANTED_SIGNATURE_SYMBOLS:
signature_buffer.append(tag.replace('\\', ''))

@Numerlor
Copy link
Contributor Author

Needs some further testing and going to take a look if I can implement #381 here

@Numerlor
Copy link
Contributor Author

Numerlor commented Nov 1, 2019

@jchristgit any reason 7d2b784 uses textwrap.shorten?
Want to get up to 3 signatures for cases where they exist but that collapses all the newlines

@Numerlor
Copy link
Contributor Author

Numerlor commented Nov 3, 2019

Some issues that I'm aware of but don't know if they should be looked into further:

  • Notes and warnings like in cmath don't get put into blocks in embeds
  • Some modules like glob don't get almost any info in their description because they start with a block of text that can't be cut off with the current logic
  • Symbols linked to pages ending with .html can't be fetched
  • A few thousand symbols similar to the format reference/page/normal_symbol_name exist as duplicates of normal symbols and can't be fetched through their name

Also not sure if the handling and logging of exceptions when fetching inventories is correct

@Numerlor Numerlor marked this pull request as ready for review November 3, 2019 19:35
Copy link
Contributor

@scragly scragly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A number of symbols have reduced usefulness after the changes. For example, list and multiprocess.Process both show the following:

This appears to be a generic page not tied to a specific symbol.

I feel like this still needs some work in order to improve consistency expected behaviour, as these cases actually had decent information output in the current version.

Another thing is I'd like to see a command added that will call refresh_inventory. If we add a new entry to the site, this ensures we can reload it without doing an internal eval.

bot/cogs/doc.py Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Show resolved Hide resolved
bot/cogs/doc.py Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
Copy link
Contributor

@scragly scragly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more bracket styling to fix (same as the previous ones but you added this one while removing the others). And adding back in some lost info after a comment was taken out.

bot/cogs/doc.py Outdated Show resolved Hide resolved
bot/cogs/doc.py Outdated Show resolved Hide resolved
Numerlor and others added 2 commits November 15, 2019 13:10
Co-authored-by: scargly <29337040+scragly@users.noreply.github.com>
Copy link
Contributor

@scragly scragly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks for your work!

Copy link
Member

@SebastiaanZ SebastiaanZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@scragly scragly merged commit 1992cb2 into python-discord:master Nov 15, 2019
@Numerlor Numerlor deleted the doc-command branch February 25, 2020 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs command refinements Documentation inventory failed to load !doc for stdlib items gives 2to3 results
4 participants