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
Fix #2692 -- make nikola plugin --list-installed
more readable
#2693
Conversation
* Align plugin list * Make the plugin name bold Signed-off-by: Chris Warrick <kwpolska@gmail.com>
👍 |
@@ -179,9 +179,18 @@ def list_installed(self): | |||
plugins.sort() | |||
print('Installed Plugins:') | |||
print('------------------') | |||
maxlength = max(len(i[0]) for i in plugins) | |||
if self.site.colorful: | |||
formatstring = '\x1b[1m{0:<{2}}\x1b[0m at {1}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows, we just disable the colors everywhere. But Windows 10 does support ANSI escape codes, so we can enable colors if the user is on 10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
nikola/plugins/command/plugin.py
Outdated
print(formatstring.format(name, path, maxlength)) | ||
dp = self.site.config['DISABLED_PLUGINS'] | ||
if dp: | ||
print('\n\nAlso, you have disabled these plugins: {}'.format(dp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use ', '.join(dp)
to improve readability for the disabled plugin list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
This is #2692 — cc @xuhdev