This site requires JavaScript, please enable it in your browser!
Greenfoot back
jimboweb
jimboweb wrote ...

2014/8/30

Line breaks in documentation

jimboweb jimboweb

2014/8/30

#
I have a question about writing documentation for our own code. I know that Greenfoot automatically puts the comments above the class into the documentation, which is useful. However, it does it without linebreaks, all as one long paragraph. This is not so useful if you want to provide detailed documentation for beginning students, especially, for example, if you have a bunch of different constructors with different arguments that you might like to demonstrate. So for example if I want to write: StaticText creates a static text object, such as a game over screen, on the world. The basic call is StaticText is StaticText st = new StaticText(getWorld(), "My text here"); . If you want to choose the fontsize, call it like StaticText st = new StaticText(getWorld(), "My text here", 16); to get font size 16. If you want to choose the color, call StaticText st = new StaticText(getWorld(), "My text here", 16, Color.RED); . ..etc, the student will see: StaticText creates a static text object, such as a game over screen, on the world. The basic call of StaticText is StaticText st = new StaticText(getWorld(), "My text here"); . If you want to choose the fontsize, call it like StaticText st = new StaticText(getWorld(), "My text here", 16); to get font size 16. If you want to choose the color, call StaticText st = new StaticText(getWorld(), "My text here", 16, Color.RED); . which is not so useful. So how can I put line breaks in my documentation? Is there a way?
danpost danpost

2014/8/30

#
Just insert a line break, '<br>', at the required locations.
jimboweb jimboweb

2014/8/30

#
Ha! Thanks, DanPost, I just figured out that it's HTML. Don't know why that didn't occur to me.
You need to login to post a reply.