Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

@example tag ignores <caption> and line-breaks #76

Open
Binsk opened this issue Oct 7, 2019 · 4 comments
Open

@example tag ignores <caption> and line-breaks #76

Binsk opened this issue Oct 7, 2019 · 4 comments

Comments

@Binsk
Copy link

Binsk commented Oct 7, 2019

Not sure if it's a bug or just not implemented yet.

As stated, @example seems to ignore and there is no way to do line breaks (even w/ HTML). This makes @example only good for simple single-line examples.

@jhm-ciberman
Copy link
Owner

Hello, thanks for reporting this issue.
Yes, as you stated, <caption> is not currently implemented (I didn't thought that anyone would use it, haha). I will try to implement it in a future.

But, currently is posible to do multiline examples like this:

/**
 * @function bb_create
 * 
 * @description
 * Creates a basic button (BB) in the specified position
 * with the text "text" and with the sprite specified as background.
 *
 * @example
 * 
 * // Create Event:
 * my_button = bb_create(x, y, "Press Me", 20, font0, spr_button, true);
 * 
 * //Step event:
 * bb_step(my_button);
 * if (bb_on_pressed(my_button)) {
 *		show_message_async("The button has beeen pressed");
 * }
 * 
 * // Draw Event: 
 * bb_draw(my_button);
 * 
 * 
 */

This should be rendered correcly. Also, you can have more than one @example tag per script, so you can have multiple examples. Please tell me if that is what are you referring to.

@Binsk
Copy link
Author

Binsk commented Oct 8, 2019

That would be fantastic. I've been working around it by including the styled "pre" within the code but it's super tacky looking inside the editor.

As for the multi-line, I played with it a bit more and found out what I was doing wrong; something stupid on my end. If you don't have the code flush with the @example tag then the following line won't insert a break thus making things show up on one line.

This issue is what I was referring to but it ended up being my formatting rather than an issue with the engine. I have a habit of indenting past tags but that messes up @example.

@jhm-ciberman
Copy link
Owner

jhm-ciberman commented Oct 8, 2019 via email

@Binsk
Copy link
Author

Binsk commented Oct 8, 2019

Man, now I feel like I've been wasting your time. -.-"
I can still get it to happen in rare cases such as this:

/**	@desc	This is some example function.

	@example
		some_function();
		show_message("Some message");
		// This line should be fine, though
 **/

But I'm having a hard time getting it to crop up now. I took notes on this a bit back and didn't report it until recently so maybe it was some of my old CSS messing things up.

I notice that if I replace "some_function()" with something like "var = instance_create(0, 0, instance)" then it goes away.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants