testingisdocumenting/znai

Render Code Segments in Java Callout Comments

Closed this issue · 5 comments

Is there a way I can render a bit of text from a Java comment into monospace (say, with either backticks, the {@code} segment, or some other way)?

For example, let's say I have a class called ClassName defined as follows:

// The `@Generated` annotation is added by the {@code AnnotationProcessor} to
// denote that there are elements of this class that have been generated.
@Generated("pkg.name.AnnotationProcessor")
public class ClassName {
  // ...
}

. . . and, in the markdown, I used:

:include-java: code-snippets/java/output/ClassName.java {
  title: "Title",
  commentsType: "inline",
  wrap: true
}

In this example, I'd like the "@ Generated" and "AnnotationProcessor" segments to render as @Generated and AnnotationProcessor in the Callout Comment. However, it renders as `@Generated` and `AnnotationProcessor`

Screenshot:
image

Additionally, if there's a way to add a Code Reference to each of these segments?

Per the instructions in the footer of the Znai documentation, I have posted a question on StackOverflow, making this Issue redundant. So, I'm closing this Issue.

@TheSilverNimbus I noticed someone downvoted you. I don't know what the rules are in stack overflow anymore.
Maybe could be a good idea to remove markdown and java tags from it since Znai uses custom syntax and it may be perceived as spam.

I went ahead and left only znai and documentation tags.

@TheSilverNimbus if you don't mind, could you please share how you use Znai here: #824

@TheSilverNimbus I noticed someone downvoted you. I don't know what the rules are in stack overflow anymore. Maybe could be a good idea to remove markdown and java tags from it since Znai uses custom syntax and it may be perceived as spam.

Yeah, I don't know what the current rules of StackOverflow are, either. And it annoys me so much when they just downvoate without any indication as to why.

In any case, I didn't know about the spam bit; I'll be sure to limit the tags, next time. Thanks for both the snappy response and the heads-up!