Class Def2Doc3

java.lang.Object
eu.bandm.tools.d2d2.base.Def2Doc3

public class Def2Doc3 extends Object
Create Xhtml documentation of a ResolvedModule, as produced by Resolver4
Usage pattern: (1) Create fresh instance (alwas anew, no re-usage)
(2) call main entry method makeHtmlDoc(ModuleRegistry,ResolvedModule,String,String,NamespaceName2String)
(3) Then the directory (specified in (1)) will be filled with main "index.html" and many "*.png", etc.
  • Field Details

  • Constructor Details

    • Def2Doc3

      public Def2Doc3(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, int debuglevel, File generatedDir, int lineWidth)
      Parameters:
      msg - MessageReceiver
      generatedDir - must exist as a directory, but should be empty.
      lineWidth - for the printing of the re-constructed definition fragments
  • Method Details

    • error

      protected void error(String s, Object... args)
    • warning

      protected void warning(String s, Object... args)
    • error

      protected void error(Location<XMLDocumentIdentifier> loc, String s, Object... args)
    • error

      protected void error(Exception ex, String s, Object... args)
    • logStart

      protected void logStart(String s, Object... args)
    • logEnd

      protected void logEnd(String s, Object... args)
    • failure

      protected void failure(String s, Object... args)
    • splitByFirst

      public static String[] splitByFirst(String text)
    • getSuffix

      public static String getSuffix(String fname)
    • mtext

      String mtext(String m)
      ATTENTION Needs to duplicate language argument for activating the fall-back version of "get()"!
    • mtext

      String mtext(String m, Object... args)
    • spanCC

      Element_span spanCC(String classname, String content)
      Creates a simple html-span with a certain css-class and only character data.
    • joinAllDocStrings

      public static String joinAllDocStrings(CheckedList<LocString> list)
    • loadDocTextXsltTransformation

      protected void loadDocTextXsltTransformation()
      Prepare the txsl application, see Batch.java:
    • renderDocu

      protected void renderDocu(SourceItem item)
      Convert the docu text for the given item, selected by the value of targetcode from d2d source into xhtml. Append the latter to the growing list bodysubs.
    • f_renderDocu

      @Opt protected @Opt Element_block_content[] f_renderDocu(@Opt @Opt CheckedList<LocString> in, String docu_ident)
    • f_renderDocu

      @Opt protected @Opt Element_block_content[] f_renderDocu(String docu_text, String docu_ident)
    • makePngAndMap

      public void makePngAndMap(DefInstance defi, XRegExp def0)
      Create one single graphic file containing the graphic representation of the syntax of one single declaration.
      Calls layouter and painter, and let the latter paint to a buffered image and writes this into a PNG file the name of which is generated from the path of the declaration.
      Add a html:map element with LINKS to the corresponding declarations.
    • makeEnumTable

      protected void makeEnumTable(Enumeration def)
      Generates a tabular visualisation of an enum, following the numerical values.
      FIXME MISSING: docu texts for single enum items !!
    • listUsage

      protected void listUsage(Definition defrw)
    • makeJumpTo

      protected Element_a makeJumpTo(Definition def)
    • makeJumpTo

      protected Element_a makeJumpTo(DefInstance defi)
    • html_repr_empty

      Element_p html_repr_empty()
    • makeJumpToToc

      protected void makeJumpToToc()
    • make_li_text_localhref

      void make_li_text_localhref(List<Element_li> v, String t, String href)
    • make_a

      static Element_a make_a(String id)
    • make_h2_with_aname

      Element_h2 make_h2_with_aname(String t, String Xname)
    • dyn_module2anchor

      protected String dyn_module2anchor(Module mod, boolean isName)
      Parameters:
      isName - if it is the DEFINING "a"-element, not a refering one.
    • defrw2minUniqueName

      protected String defrw2minUniqueName(Definition def)
    • defi2minUniqueName

      protected String defi2minUniqueName(DefInstance defi)
    • defi2uniqueId

      protected String defi2uniqueId(DefInstance defi)
      DOCME
    • defi2anchor

      protected String defi2anchor(DefInstance defi, boolean isName)
      Parameters:
      isName - if it is the DEFINING "a"-element, not a refering one.
    • defrw2tooltip

      protected String defrw2tooltip(Definition defrw)
    • defi2tooltip

      protected String defi2tooltip(DefInstance defi)
    • makePublicToplevelTagList

      protected void makePublicToplevelTagList()
    • makeTagList

      protected void makeTagList()
    • makeHomonymList

      protected void makeHomonymList()
    • makeTagListEntry

      protected void makeTagListEntry(String tag, DefInstance defi, List<Element_li> toclist)
    • makeModuleTable

      protected void makeModuleTable()
    • td_textAndClass

      protected Element_tr.Choice_1_Alt_2 td_textAndClass(String text, String cls)
    • td_textClassJump

      protected Element_tr.Choice_1_Alt_2 td_textClassJump(String text, String cls, String href, boolean defining)
    • showModuleImports

      protected void showModuleImports(int indent, String prefix, Module rawModule, List<Element_tr> akku, Set<Module> done, Set<Module> active)
    • packTd

      protected Element_tr.Choice_1_Alt_2 packTd(String s)
    • makeDocuTable

      protected void makeDocuTable()
    • makeImportGraph

      protected void makeImportGraph()
    • renderOneDefInstance

      protected void renderOneDefInstance(String modulename, DefInstance defi)
      Make the doc entry for one (INSTANTIATED) DECLARATION.
      1. Print a header,
      2. print the related docu text, iff present in the selected language,
      3. print an enum table or a syntax graph
      4. list cross-ref of usage
      5. list homonyms
    • renderModulesAndDefis

      protected void renderModulesAndDefis()
      Make the doc entry for one MODULE INSTANTIATION
      1. Print a header,
      2. print the module-related docu text, iff present in the selected language,
      3. call renderOneDefInstance(String, DefInstance) for all defs which are reachable from the top module's definitions.
      POSSIBLE EXTENSION : list all IMPORT ITEMS !?!?
    • markRawModule

      protected void markRawModule(Module mod)
    • makeHtmlDoc

      public void makeHtmlDoc(ModuleRegistry moduleRegistry, ResolvedModule mod, String targetcode, String generationString, NamespaceName2String stylesheetParams)
      Make xhtml-documentation of one top module and its childs or imports.
      "static" mode is one un-instantiated module with all contained sub-modules.
      "dynamic" mode is one instantiated module with all referred-to (imported) declarations.
      Contained in ONE "index.html" page, with header and table of contents and registers, and many "*.png"s The target directory where all these are stored into has been defined on creation.
      The muli-translations are pre-compiled into DocTexts.
      FIXME --- parametrization variant missing for dynamic case: only visit A LIST OF (one or more selected) declarations, not whole module !!
      Parameters:
      mod - the loaded module, either raw or instantiated
      targetcode - the documentation key for doc-texts from the module's source file to include.
      generationString - the text for the footer
      stylesheetParams - the usual xslt parameters for "d2d_gp to_xhtml_1_0"