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

scdoc: redesign method rendering #2948

Merged
merged 6 commits into from
Jun 17, 2017

Conversation

nhthn
Copy link
Contributor

@nhthn nhthn commented Jun 14, 2017

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 :)

Nathan Ho added 2 commits June 14, 2017 12:45
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.
@nhthn nhthn added the comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help" label Jun 14, 2017
@nhthn nhthn added this to the 3.9 milestone Jun 14, 2017
This commit indents wrapped code in method rendering to help visually emphasize the method name.
@@ -2,6 +2,7 @@
HTML renderer
*/
SCDocHTMLRenderer {
classvar <binaryOperatorCharacters = "!@%&*-+=|<>?/";
Copy link
Member

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, { "" }
Copy link
Member

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 ?

Copy link
Contributor Author

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

Copy link
Member

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.

@mossheim
Copy link
Contributor

mossheim commented Jun 15, 2017

[ used to be images here, removed them since they're misleading ]

I like some of these changes, but others feel a little strange. No left margin makes it difficult to see the - or *. Extra vertical padding makes lists of unimplemented methods very spacious. And, that full-width red background for extensions makes less sense to me visually now...

These are from the Object helpfile btw

@nhthn
Copy link
Contributor Author

nhthn commented Jun 15, 2017

that doesn't look the way it should. did you run make install and everything?

edit i think you gotta hit "refresh". the method names should be black and monospace.

@mossheim
Copy link
Contributor

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

@nhthn
Copy link
Contributor Author

nhthn commented Jun 15, 2017

you need to run SCDoc.parseAndRender(SCDoc.documents["Classes/String"]), etc. to force refresh a particular document. or SCDoc.renderAll if you don't mind waiting

@mossheim
Copy link
Contributor

image

image

image

Damn that's nice. Still the same comment about full-width background highlighting though, for NOTEs and extensions notices. The other thing i notice is that now subheaders are roughly the same size as the monospace method names, so they don't really feel like heading text anymore

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.
@nhthn
Copy link
Contributor Author

nhthn commented Jun 15, 2017

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.

Nathan Ho added 2 commits June 15, 2017 15:43
This helps visually distinguish ordinary h3's from methods.
@telephon
Copy link
Member

This will be a very nice improvement – let us know when you are ready.

@nhthn
Copy link
Contributor Author

nhthn commented Jun 16, 2017

it's done, unless anyone has feedback ofc.

@telephon
Copy link
Member

I think we can still fine-tune if we get further feedback …

@telephon
Copy link
Member

One thing could be improved is the amount of space that this section takes:

screen shot 2017-06-16 at 21 04 02

Maybe there is a simple way of compressing the information and functionality in such blocks?

@nhthn
Copy link
Contributor Author

nhthn commented Jun 16, 2017

good idea, although that's probably best done in a separate PR

@telephon telephon merged commit a372bae into supercollider:master Jun 17, 2017
@nuss
Copy link
Contributor

nuss commented Jun 18, 2017

I am not really convinced about this change to the docs. First, it seems not to be 100% consistent: E. g. I have a class that only has class methods. In that case method names are still being rendered with a * in front, not ClassName.method. The * itself appears at the left edge of the document without any padding - see screenshot:
CVCenter help
Also, adding the class name in front of the method name like ClassName.methodName for class methods while having no notion of the necessity of a receiver for instance methods (.someInstanceMethod) doesn't really clarify the difference between class and instance methods. I can't remember how I learned about that difference when reading the docs but once I found out it had immediately been clear to me what the difference between * method and - method was when looking at some help file.
Leaving out lines and backgrounds may be justified sometimes. However, I have the feeling they made sense somehow. E. g. there may be different sections with headlines within help files. Previously, while headlines were rendered without backgrounds method names (resp. method signatures) were rendered with a light grey background. Now this distinction is gone. Also, the font size in method names is bigger than the one in section headlines (compare above screenshot with the one below). I think that is somehow blurring the structure within a document.
CVCenter help

@gusano
Copy link
Member

gusano commented Jun 18, 2017

@nuss can you post your file? I cannot reproduce it locally (linux)..

@nuss
Copy link
Contributor

nuss commented Jun 18, 2017

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...)

@mossheim
Copy link
Contributor

@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"

@nuss
Copy link
Contributor

nuss commented Jun 18, 2017

@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:

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.

@crucialfelix
Copy link
Member

crucialfelix commented Jun 18, 2017 via email

@telephon
Copy link
Member

#2227

(a little better)

@nhthn nhthn deleted the topic/scdoc-methods branch August 12, 2017 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants