Interface PageExportContext


@Experimental @NonExtendable public interface PageExportContext
Gives PageExportProcessor access to the page being exported. Processors work on a copy of the page, so they can modify it freely without affecting the in-game guide.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    <T extends Extension>
    List<T>
    getExtensions(ExtensionPoint<T> extensionPoint)
    Returns the extensions of the guide being exported.
    getLayoutNodes(guideme.libs.mdast.model.MdAstNode node)
    Returns the layout nodes compiled from the given node for the in-game guide.
    @Nullable guideme.libs.mdast.model.MdAstNode
    getParent(guideme.libs.mdast.model.MdAstNode node)
    Returns the parent of the node, or null for the root of the page.
    net.minecraft.resources.Identifier
     
    void
    remove(guideme.libs.mdast.model.MdAstNode node)
    Removes the node and its content from the page.
    void
    replace(guideme.libs.mdast.model.MdAstNode node, List<? extends guideme.libs.mdast.model.MdAstNode> replacement)
    Replaces the node with the given nodes.
    net.minecraft.resources.Identifier
    Resolves an id relative to the page, using the namespace of the page if the id has none.
    void
    unwrap(guideme.libs.mdast.model.MdAstNode node)
    Replaces the node with its own children, i.e.
  • Method Details

    • exporter

      ResourceExporter exporter()
    • pageId

      net.minecraft.resources.Identifier pageId()
    • resolveId

      net.minecraft.resources.Identifier resolveId(String id)
      Resolves an id relative to the page, using the namespace of the page if the id has none.
    • getExtensions

      <T extends Extension> List<T> getExtensions(ExtensionPoint<T> extensionPoint)
      Returns the extensions of the guide being exported.
      Returns:
      the extensions of the guide being exported
    • getParent

      @Nullable guideme.libs.mdast.model.MdAstNode getParent(guideme.libs.mdast.model.MdAstNode node)
      Returns the parent of the node, or null for the root of the page.
      Returns:
      the parent of the node, or null for the root of the page
    • getLayoutNodes

      List<LytNode> getLayoutNodes(guideme.libs.mdast.model.MdAstNode node)
      Returns the layout nodes compiled from the given node for the in-game guide. This allows access to information that is only known after compiling the page, such as the scene of a <GameScene>.
      Returns:
      the layout nodes compiled from the given node for the in-game guide
    • replace

      void replace(guideme.libs.mdast.model.MdAstNode node, List<? extends guideme.libs.mdast.model.MdAstNode> replacement)
      Replaces the node with the given nodes.
      Throws:
      IllegalArgumentException - If the parent of the node cannot contain the replacement nodes.
    • unwrap

      void unwrap(guideme.libs.mdast.model.MdAstNode node)
      Replaces the node with its own children, i.e. for elements that only affect whether their content is shown.
    • remove

      void remove(guideme.libs.mdast.model.MdAstNode node)
      Removes the node and its content from the page.