Class NameBeautifier

java.lang.Object
org.ctan.site.services.NameBeautifier

public class NameBeautifier extends Object
The class NameBeautifier contains a translation method to adapt the name of a package. The following rules are applied:
  • If the name is null then compute a new value.
  • If the name is blank then compute a new value.
  • If the name is equal to the id/key then compute a new value.
  • If the name starts with an exclamation mark (!) then the remainder is taken as name.
  • If the key contains the string $key then the match is replaced with $logo and the first character of the name is translated to upper case
    $key $logo
    ascii ASCII
    bakoma BaKoMa
    beamertheme BeamerTheme
    context ConTeXt
    dante DANTE
    latex LaTeX
    luatex LuaTeX
    lualatex LuaLaTeX
    pgf PGF
    pdf PDF
    pstricks PSTricks
    rcs RCS
    tikz TikZ
    xelatex XeLaTeX
    xetex XeTeX
  • If the key starts with the string $key then the match is replaced with $logo and the first character of the name is translated to upper case
    $key $logo
    pst PST
    urw URW
  • If the key starts with the string "babel-" then the match is replaced with "Babel-" and the next character of the name is translated to upper case.
  • If the key starts with the string "ptex" then the match is replaced with "pTeX" and returned.
  • Else only the first character of the name is translated to upper case.
  • Constructor Details

    • NameBeautifier

      public NameBeautifier()
  • Method Details

    • beautify

      public static String beautify(String id, String name)
      The method beautify provides means to compute the beautified name.
      Parameters:
      id - the package key
      name - the package name
      Returns:
      the beautified name