From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/7050 Path: main.gmane.org!not-for-mail From: "Robert F. Beeger" <5beeger@informatik.uni-hamburg.de> Newsgroups: gmane.comp.tex.context Subject: Re[2]: Verbatim modules Date: Wed, 27 Feb 2002 08:52:53 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <423417406.20020227085253@informatik.uni-hamburg.de> References: <5.1.0.14.1.20020225163148.02c0c2c8@server-1> Reply-To: "Robert F. Beeger" <5beeger@informatik.uni-hamburg.de> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="----------9310780B83FA3" X-Trace: main.gmane.org 1035397544 16067 80.91.224.250 (23 Oct 2002 18:25:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:25:44 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: Hans Hagen In-Reply-To: <5.1.0.14.1.20020225163148.02c0c2c8@server-1> Xref: main.gmane.org gmane.comp.tex.context:7050 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:7050 This is a cryptographically signed message in MIME format. ------------9310780B83FA3 Content-Type: multipart/mixed; boundary="----------65C41CCC33432A" ------------65C41CCC33432A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Hello, Hans! Monday, February 25, 2002, 4:32:40 PM, Hans Hagen wrote >>Now "/*" and "*/" gets typeset in red, the "*" after "/*" and the text >>in the comment gets typeset in black and the two remaining "*" get >>grayed out. Here I would like to have "/*", "*/" and the other stars >>to be typeset in one color´, be it red or what ever, and the text to >>be grayed out. I know this is not that easy to accomplish and is more a >>feature request for the future. But since I am into this now, I >>thought it would not do any harm, if mentioned it. HH> if you give me precise specs and example files, i can have a look at it Well, let's try this: In Java there are three sorts of comments. The first one is the one-line-comment and is introduced with "//" as in // This is an assignment a = 78 The second one can be used to make a multi-line comment. It is started with a "/*" and finished with a "*/" as in /* This is a multi-line comment. Really! */ Those first two sorts of comments are also available in JavaScript, C and C++. The third one is a speciality of Java. It is used to produce JavaDoc-Comments. A tool, called JavaDoc, recognizes these comments and generates an API-documentation from those comments. JavaDoc-comments are used just before the definition of - a class to describe what the class is for and show some simple examples of how to use it. - a method to describe what the method is for, to describe what the meaning of the arguments is and to show simple examples of the usage of the method. - a field to (guess what) describe the field is for. A JavaDoc-comment is started by a "/**". Each line in a JavaDoc-comment begins with a "*". A JavaDoc-comment is finished by a "*/". An example /** * This method adds to integers. * * @param a first number * @param b second number */ public int sum(int a, int b); Although a JavaDoc-comment may contain some @-keywords and although some IDEs highlight them differently, it would be to much for a ConTeXt-document to also have them highlighted differently. That would be to much eye-candy. Just highlighting the whole contents of a JavaDoc-comment would be sufficient. JavaDoc-comments use HTML for the formatting. The JavaDoc-tool generates the API-documentation in HTML, so the formatting instructions in a JavaDoc-comment are used directly in the resulting documentation. But this also should not have any consequence for the highlighting in ConTeXt. There are two kinds of highlighting a Java-comment that would look good and make it clear that it's a comment - Highlight all of the comment including the markers "//", "/*", "/**", "*" and "*/" in the same color. - Highlight the markers and the contents differently. This would bring a difficulty into it. It would be necessary to differentiate between the "*" at the start of a JavaDoc-comment-line and a "*" that appears somewhere in the body of the comment as in /** * 2 * 2 = 4 */ I would be glad with the first variant, but ConTeXt seems to use the second one. As a sample I have included a Java-class. Does this help? -- Greets Robert ------------65C41CCC33432A Content-Type: application/octet-stream; name="LoginServlet.java" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="LoginServlet.java" cGFja2FnZSBkZS5qd2FtYWxwaGEuaGFuZGxpbmcud2ViLnJiZGlwbDsNCg0KaW1wb3J0IGphdmEu aW8uSU9FeGNlcHRpb247DQppbXBvcnQgamF2YS5pby5QcmludFdyaXRlcjsNCmltcG9ydCBqYXZh eC5zZXJ2bGV0Lmh0dHAuSHR0cFNlcnZsZXQ7DQppbXBvcnQgamF2YXguc2Vydmx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iIpOw0KICAg IHdyaXRlci5wcmludGxuKCIgIDwvaGVhZD4iKTsNCiAgICB3cml0ZXIucHJpbnRsbigiICA8Ym9k eT4iKTsNCiAgICB3cml0ZXIucHJpbnRsbigiICAgIEhhbGxvLCBCZW51dHplciAiICsgcmVxdWVz dC5nZXRQYXJhbWV0ZXIoInVzZXJuYW1lIikgKyAiISIpOw0KICAgIHdyaXRlci5wcmludGxuKCIg IDwvYm9keT4iKTsNCiAgICB3cml0ZXIucHJpbnRsbigiPC9odG1sPiIpOw0KICAgIHdyaXRlci5m bHVzaCgpOw0KICB9DQp9DQo= ------------65C41CCC33432A-- ------------9310780B83FA3 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIHxAYJKoZIhvcNAQcCoIIHtTCCB7ECAQMxCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCCBeww ggK7MIICJKADAgECAgMFV+EwDQYJKoZIhvcNAQECBQAwgZIxCzAJBgNVBAYTAlpBMRUwEwYDVQQI EwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEPMA0GA1UEChMGVGhhd3RlMR0wGwYD VQQLExRDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEoMCYGA1UEAxMfUGVyc29uYWwgRnJlZW1haWwgUlNB IDIwMDAuOC4zMDAeFw0wMTA3MzExNzMwMjVaFw0wMjA3MzExNzMwMjVaMHIxDzANBgNVBAQTBkJl ZWdlcjESMBAGA1UEKhMJUm9iZXJ0IEYuMRkwFwYDVQQDExBSb2JlcnQgRi4gQmVlZ2VyMTAwLgYJ KoZIhvcNAQkBFiE1YmVlZ2VyQGluZm9ybWF0aWsudW5pLWhhbWJ1cmcuZGUwgZ8wDQYJKoZIhvcN AQEBBQADgY0AMIGJAoGBAKZgPf7rEFWftjw0/Q7bKgIP89LQ6zlbyLJ8w4EnA03hwbAaBsNvBDtS iIM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