-
Notifications
You must be signed in to change notification settings - Fork 19
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
Feature/html formatting #22
base: main
Are you sure you want to change the base?
Conversation
Ah, also should have looked beforehand, didn't realise this PR existed: #19, apologies @MarcosMeli |
Thank you! I'm glad you find it useful. I'm also wondering if I should find a way for people to define their own stylesheet and override styles. I could just reference a stylesheet, and people can add the stylesheet if they desire, and if it's not there, it just falls back to the header-defined ones? |
@@ -209,7 +209,7 @@ public void WriteType(INamedTypeSymbol type, INamedTypeSymbol oldType) | |||
if (type.GetInterfaces(oldType).Any()) | |||
{ | |||
isEmpty = false; | |||
sw.Write("<br/>Implements "); | |||
sw.Write("<br/>Implements <span class='code'>"); |
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.
I'd rather we don't monospace it all.
@@ -261,7 +262,7 @@ private string GetIcon(ISymbol type, string content) | |||
} | |||
if (icon == "") | |||
return content; | |||
return $"<li class='{icon}'>{content}</li>"; | |||
return $"<li class='{icon} code'>{content}</li>"; |
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.
I think it's a good idea to create a style users can easily override, but not sure this should be the style name, or that it should default to a mono-space font.
.objectBox > .header.noMembers { border-radius: 10px; } | ||
.objectBox > .header > span { font-size:20px; } | ||
.objectBox > .header > span:not(.code) { font-size:20px; } | ||
.code { font-family: "Consolas", "Courier New", "Courier", monospace; font-size: 14px; } |
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.
I'd prefer a sans-serif style font here as default
|
||
.members li { background-repeat: no-repeat; padding-left:20px; background-position: left center; } | ||
.members li { background-repeat: no-repeat; padding-left:20px; background-position: left 2px; } |
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.
Nice catch on the vertical alignment! 👍
Amazing, will review these tomorrow and make some tweaks. In terms of custom CSS, could be a command line arg that accepts a path to a stylesheet that is merged? We use BEM notation a lot in our CSS stuff, could be a good way to layout your component styles that people can easily override? |
One thing to consider is that there are multiple formats - HTML is just one (and I hope to make it extensible in the future). So we'd need some sort of generator-specific way to send parameters if that's the way we want to go. |
Hi,
Really digging this project, I've been using it the last couple of days for some internal project documentation. One thing I've found is that the HTML output can be a little hard to read, so for your consideration, I've built some tweaks that introduce a couple of changes:
Before:
After:
If this works, happy to have contributed, or if you're planning to do this at some point yourself, no worries, just thought it would be useful 👍