-
Notifications
You must be signed in to change notification settings - Fork 748
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
scdoc: redesign method rendering #2948
Conversation
This commit redesigns the way methods are displayed in SCDoc. Cluttersome gray backgrounds and horizontal lines were removed, instance methods now display as ".add(...)" instead of "- add (...)", class methods now display as "SinOsc.ar(...)" instead of "* ar(...)".
This commit improves clarity in SCDoc's method rendering by removing the leading . for method names that contain a valid binary operator character.
This commit indents wrapped code in method rendering to help visually emphasize the method name.
@@ -2,6 +2,7 @@ | |||
HTML renderer | |||
*/ | |||
SCDocHTMLRenderer { | |||
classvar <binaryOperatorCharacters = "!@%&*-+=|<>?/"; |
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.
it might be good to make this a method of Symbol::isBinaryOperator
. Then we have a central place to look this up.
// "." to reduce confusion. | ||
if(mname.asString.any(this.binaryOperatorCharacters.contains(_)), { "" }, { "." }) | ||
}, | ||
\genericMethod, { "" } |
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.
what is a generic method
?
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.
no idea. see line 566
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.
ok, seems like a method without known class. Well, not an issue.
[ used to be images here, removed them since they're misleading ]
|
that doesn't look the way it should. did you run edit i think you gotta hit "refresh". the method names should be black and monospace. |
ah i was wondering if i did something wrong. nope, just copy-pasted into my existing files because I thought that would be enough. will try again later tonight |
you need to run |
With the recent removal of gray backgrounds from methods in SCDoc, it makes sense to remove backgrounds from these as well. They are a bit easier to miss, but they're also not terribly important to users either.
i think notes should stay highlighted, since they need to stand out. in fact, they stand out even more now with the removal of other backgrounds. you're right about extensions/superclass methods, i've removed their backgrounds. i'll also fiddle around with the font sizes. i like the size of the method names, so i'll probably just make the other headers larger. |
This helps visually distinguish ordinary h3's from methods.
This will be a very nice improvement – let us know when you are ready. |
it's done, unless anyone has feedback ofc. |
I think we can still fine-tune if we get further feedback … |
good idea, although that's probably best done in a separate PR |
@nuss can you post your file? I cannot reproduce it locally (linux).. |
The issue about the class method names being rendered with a * instead of the class name in front seems to have disappeared magically... I could've sworn I did re-render the docs (probably I didn't...) |
@nuss I had the same experience too--I think the terminology spat out by the scdoc system is a little confusing re: "indexing" and "rendering" |
@brianlheim @gusano yeah, that has confused me too in the beginning. But I got used to it and my usual workflow for rendering the docs is:
... I thought I had done this but - maybe - I just didn't. Anyway, class methods are being displayed correctly now. |
Looks better already. I'm sure there is more fine tuning to do.
…On Sun, Jun 18, 2017, 17:12 Stefan Nussbaumer ***@***.***> wrote:
@brianlheim <https://github.com/brianlheim> @gusano
<https://github.com/gusano> yeah, that has confused me too in the
beginning. But I got used to it and my usual workflow for rendering the
docs is:
SCDoc.renderAll; // render all .schelp files to html
SCDoc.indexAllDocuments(true); // rebuild the docmap
... I thought I had done this but - maybe - I just didn't. Anyway, class
methods are being displayed correctly now.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2948 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANWcp8miihqrbHXAPcQQGtV4jq4D-Mqks5sFT5agaJpZM4N6YDl>
.
|
(a little better) |
towards #2943. removes cluttersome gray backgrounds and horizontal lines, displays instance methods with a leading "." (except for binary operators) and classes with a leading "ClassName.".
again i can't post screenshots, just try it. to me it's a huge improvement :)