-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add copy button for configuration property
- Loading branch information
1 parent
d1c3ae8
commit ecef520
Showing
5 changed files
with
43 additions
and
5 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
4 changes: 2 additions & 2 deletions
4
...gin/src/main/resources/templates/asciidoc/default/tags/configProperty.qute.adoc
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
1 change: 1 addition & 0 deletions
1
...src/main/resources/templates/asciidoc/default/tags/propertyCopyButton.qute.adoc
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 @@ | ||
config_property_copy_button:+++{it}+++[] |
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
22 changes: 22 additions & 0 deletions
22
docs/src/main/java/io/quarkus/docs/generation/PropertyCopyButtonInlineMacroProcessor.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,22 @@ | ||
package io.quarkus.docs.generation; | ||
|
||
import java.util.Map; | ||
|
||
import org.asciidoctor.ast.ContentNode; | ||
import org.asciidoctor.extension.InlineMacroProcessor; | ||
import org.asciidoctor.extension.Name; | ||
|
||
/** | ||
* Inline macro implementation for PDF (HTML) files where copy button is not supported. | ||
* The copy button macro is replaced with empty HTML 'code' element. The empty element is part of the DOM but not visible. | ||
* This processor must exist because we cannot use Asciidoc 'ifdef' directive inline inside a config table row. | ||
*/ | ||
@Name("config_property_copy_button") | ||
public class PropertyCopyButtonInlineMacroProcessor extends InlineMacroProcessor { | ||
|
||
@Override | ||
public Object process(ContentNode contentNode, String target, Map<String, Object> map) { | ||
// creates empty 'code' element: <code></code> | ||
return createPhraseNode(contentNode, "quoted", ""); | ||
} | ||
} |