-
Notifications
You must be signed in to change notification settings - Fork 923
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
Add DocService's docString to html view #174
Add DocService's docString to html view #174
Conversation
We currently use highlight.js to render json responses in debug page, and it seems that javascript rendering using it may produce more pleasing docstrings (@param etc would be highlighted). What do you think about converting the raw docstrings into javadoc-ilke strings with the asterisks and using highlight.js to render? Github renders docstring like this, I believe highlightjs would be the same. /**
* Basic unit of data within a ColumnFamily
*
* @param name, the name by which
* @param value. The data associated
*/ |
@@ -88,6 +88,7 @@ <h2 class="sub-header">Parameters</h2> | |||
<th>Name</th> | |||
<th>Required</th> | |||
<th>Type</th> | |||
<th>DocString</th> |
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.
Description
?
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
9a8e72e
to
b145246
Compare
@anuraaga , Actually, asterisks were already removed when Thrift generated json output. Thrift's json output doesn't contain asterisks. Of course, I agree highlighted doc string is better, but I'm not sure adding asterisks is good or not. I checked |
@trustin , Sorry to late. Updated it. And, it supports for functions and classes now. |
@@ -189,6 +206,20 @@ $(function () { | |||
}); | |||
} | |||
|
|||
function escapeHtml(string) { |
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.
Maybe it's time to add the "javascript standard library"? ;)
https://lodash.com/docs#escape
No worries either way
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 looks good, but I don't want to add another library for just one function. Maybe, we can add later if we need more.
Got it - anyways I think we can add this in a simple way for now and iterate on the look+feel. My feeling is that it might be worth round-tripping through add asterisks -> highlight -> remove asterisks (or maybe not) since the highlighting could help a lot, but it'd definitely need experimentation. Mostly LGTM |
b145246
to
f06c6e2
Compare
@trustin , I extracted |
f06c6e2
to
fa5177d
Compare
@@ -118,6 +118,10 @@ label { | |||
font-size: 60%; | |||
} | |||
|
|||
.main div.description { | |||
font-size: 100%; |
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.
How about adding: text-align: justify
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.
Actually, I'm not good at css. ;( BTW, I'll update it.
@jongyeol Would you mind pasting the updated screenshot one last time? Thanks for your patience! |
Motivation: Current DocService's html view doesn't contain JavaDoc string. This is second part of adding docstring to DocService. Modifications: Render DocString to html view if it exists. Result: DocService's html output contains DocString.
fa5177d
to
c640d7b
Compare
@trustin , I updated it with updating regexp (http://regexr.com/3di3d) and css things. :) |
@jongyeol Merged! |
Thank you! |
Motivation:
Current DocService's html view doesn't contain JavaDoc string.
This is second part of adding docstring to DocService.
Modifications:
Render DocString to html view if it exists.
Result:
DocService's html output contains DocString.