Skip to content

Add support for show-source #42

@javier-godoy

Description

@javier-godoy

Lines with a // hide-source comment are not rendered in the code snippet (#37).

What we need now is a way to display "nice" code as replacement for ugly hacks, which would otherwise make the demo hard to understand.
This feature will be helpful in cases where we use reflection in order to circumvent binary compatibility issues.

For instance, if the demo source is

Method m = Foo.class.getMethod("bar");
m.invoke(foo);

I want to be able to write it as

// show-source foo.bar();
Method m = Foo.class.getMethod("bar"); // hide-source
m.invoke(foo); // hide-source

So that it will be displayed as:

foo.bar();

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions