Cheaterman03 / doclava

Automatically exported from code.google.com/p/doclava
Apache License 2.0
0 stars 0 forks source link

better support for code samples #28

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
1. i want to write something like:

---CODE---
 for (int i = 0; i < bytes.length; ++i) {
 }
---CODE---

without having to worry about spacing or blank lines or PREs and @codes or < or 
> and so forth.

2. i want to be able to *compile* samples.

2a. i want to have the surrounding code inferred:

---CODE---
System.err.println(Locale.getAvailableLocales());
---CODE---
becomes
import java.util.Locale;
public final class Sample0001 {
 public static void main(String[] _) {
  System.err.println(Locale.getAvailableLocales());
 }
}

2b. i want to be able to supply [some of] the surrounding code:

---CODE---
!void hexdump(byte[] bytes) {
! ...
!}
hexdump("hello".getBytes("UTF-8"));
---CODE---

3. i want to be able to *run* samples. specifically, i want an expression style 
that includes the output in the HTML:

---LIVE-EXPRESSION---
Locale.getAvailableLocales()
---LIVE-EXPRESSION---
inserts "[ar, ca, de, ...]" in the HTML.

see also rubydoc/ri.

Original issue reported on code.google.com by e...@google.com on 2 Dec 2010 at 10:14