All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.docs.generation.TooltipInlineMacroProcessor Maven / Gradle / Ivy

There is a newer version: 3.17.0
Show newest version
package io.quarkus.docs.generation;

import java.util.HashMap;
import java.util.Map;

import org.asciidoctor.ast.ContentNode;
import org.asciidoctor.extension.InlineMacroProcessor;
import org.asciidoctor.extension.Name;

/**
 *
 * Tooltip inline macro implementation for PDF (HTML) files where tooltip is not supported.
 * Enum constant name is wrapped in `` and constant description is ignored.
 */
@Name("tooltip")
public class TooltipInlineMacroProcessor extends InlineMacroProcessor {

    @Override
    public Object process(ContentNode contentNode, String target, Map map) {
        var attributes = new HashMap();
        attributes.put("subs", ":normal");
        return createPhraseNode(contentNode, "quoted", String.format("`%s`", target), attributes);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy