-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
70 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
...runtime/src/main/java/io/quarkiverse/qute/web/markdown/runtime/MarkdownSectionHelper.java
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
.../src/main/java/io/quarkiverse/qute/web/markdown/runtime/MarkdownSectionHelperFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.quarkiverse.qute.web.markdown.runtime; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CompletionStage; | ||
|
||
import io.quarkiverse.qute.web.markdown.runtime.commonmark.CommonMarkConverter; | ||
import io.quarkus.qute.CompletedStage; | ||
import io.quarkus.qute.EngineConfiguration; | ||
import io.quarkus.qute.ResultNode; | ||
import io.quarkus.qute.SectionHelper; | ||
import io.quarkus.qute.SectionHelperFactory; | ||
import io.quarkus.qute.SingleResultNode; | ||
|
||
@EngineConfiguration | ||
public class MarkdownSectionHelperFactory implements SectionHelperFactory<MarkdownSectionHelperFactory.MarkdownSectionHelper> { | ||
private static final List<String> MARKDOWN_SECTIONS = List.of("markdown", "md"); | ||
|
||
@Override | ||
public List<String> getDefaultAliases() { | ||
return MARKDOWN_SECTIONS; | ||
} | ||
|
||
@Override | ||
public MarkdownSectionHelper initialize(SectionInitContext context) { | ||
return new MarkdownSectionHelper(); | ||
} | ||
|
||
static class MarkdownSectionHelper implements SectionHelper { | ||
private final CommonMarkConverter converter = new CommonMarkConverter(); | ||
|
||
@Override | ||
public CompletionStage<ResultNode> resolve(SectionResolutionContext context) { | ||
return context.execute().thenCompose(rn -> { | ||
StringBuilder sb = new StringBuilder(); | ||
rn.process(sb::append); | ||
return CompletedStage.of(new SingleResultNode(converter.apply(sb.toString()))); | ||
}); | ||
} | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
...time/src/main/java/io/quarkiverse/qute/web/markdown/runtime/QuteMarkdownConfigurator.java
This file was deleted.
Oops, something went wrong.
5 changes: 1 addition & 4 deletions
5
...rc/main/java/io/quarkiverse/qute/web/markdown/runtime/commonmark/CommonMarkConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters