[GRADLE-779] code in documentation should be highlighted Created: 11/Dec/09 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Improvement | ||
Reporter: | Tomek Kaczanowski | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 0 |
Attachments: | gradle_highlight_source.png |
Description |
Code snippets in userguide will be much more readable if they are highlighted. It will also help new users to easily recognize elements that belong to Gradle DSL. There is a tool for highlighting syntax in Docbook (http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html) so I guess it can be done using Docbook. |
Comments |
Comment by Adam Murdoch [ 11/Dec/09 ] |
We already apply xslthl to the code samples. Is there some improvement we can make to this? |
Comment by Paul Speed [ 11/Dec/09 ] |
I think this is related to my comment "...I started to wonder if a consistent color-coding of the examples might help. I don't know if the way the docs are generated support this but knowing at a glance which 'word' is a built-in call (like dependencies) versus a task name versus a configuration name might at least help." From here: http://old.nabble.com/Re%3A-where-to-start-for-a-beginner-p26751041ef31415.html It may be infeasible but we're talking about something beyond basic syntax highlighting since it would necessarily need to understand the example and the context within which it is used. And it makes more sense in examples that include more user-like content versus the really simple examples but still it might be nice to know at a glance what different main types are. I tried to include a sample using confluence mark-up here but I can't get it to let me do colors and "pre" style formatting at the same time. |
Comment by Tomek Kaczanowski [ 11/Dec/09 ] |
Adam, BTW. I'm a xslthl noob – |
Comment by Tomek Kaczanowski [ 12/Dec/09 ] |
I'll try what I can do here and you will see then if it is any good. – |
Comment by Tomek Kaczanowski [ 14/Dec/09 ] |
an example of what is possible on the left - new version Highlighted words are customizable. But this is not so simple and they should be chosen carefully - for example it is nice to have "name" highlighted in dependencies section, but it will also be highlighted in this snippet of code: This is way beyond my XSLT-fu to repair such cases. But if we choose the words carefully, there will be no problem. Paul, is it close to what you intended ? – |
Comment by Paul Speed [ 14/Dec/09 ] |
Similar. I would have maybe gone further and used different colors for things like "dependencies", "repositories", "usePlugin", etc. as built in calls... versus compile, testCompile as configurations, etc.. It's hard to figure out exactly where to draw the line but a little goes a long way. For example, in my editor's Java syntax highlighting, Java keywords show up as a different color. Standard JDK classes show up in yet another color... and so on. With potentially ambiguous words like "compile", I think reinforcing that this is a dependency configuration point through some additional highlighting is a good thing for new readers. And knowing that "dependencies" is base construct versus uploadArchives which is a task is also good. A bonus would be to give that gradle-provided tasks a different color than a user's own tasks would have. |
Comment by Tomek Kaczanowski [ 14/Dec/09 ] |
Paul, I get what you would like to have, but that would be much more complicated. At the moment we can improve userguide listings by having chosen Gradle keywords highlighted instead of having Java keywords highlighted. IMHO definitely an improvement. – |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |