Skip to content

SkelView

Jan Max Meyer edited this page Feb 7, 2019 · 3 revisions

The macro file skelview.html provides collection of macros used for ViUR skeleton rendering in Jinja2/HTML.

Available macros

  • SkelViewRelBoneFormat() is (mostly internally) used to replace values in a format string
  • SkelViewBone() is used to render the value of one bone
  • SkelView() is used to render a skeleton
  • CatSkelView() is used to render a skeleton and grouping bones into their categories

Example calls

Output a skeleton

{% from "macros/skelview.html" import SkelView %}
{{ SkelView(skel) }}

Output a skeleton with categories

{% from "macros/skelview.html" import CatSkelView %}
{{ CatSkelView(skel) }}

Parameters

Available options (see macros for implementation details):

  • cssBaseClass allows to override the CSS-base class for styling
  • drillDepth when specified > 0, then relationalBones are deep-rendered also
  • drillFull when specified, loads the entire referenced skeleton and outputs it
  • drillIgnore paths to ignore when diving into relationalBone
  • emptyValue allows to define how unset values are displayed (default: "-")
  • ignore allows to specifiy a list of paths to be ignored
  • module defines the module to which skel matches; If this is not provided, moduleName() is called.
  • paths allows to specify a list of paths to view. A path can also be something like "reference.dest.name" When this is left empty, all visible fields are printed, except ingored ones
  • options defines a dictionary with advanced options; This is the newer way to supply customizatons to the macros. See section below for further information.

Options

Options to SkelView styling and behavior are supplied using the option dictionary.

showHidden

Defines if hidden bones would be generally shown.

options={"showHidden": True}

keyLink

If set, bones containing a key are rendered as a link to the URL provided as keyLink. The provided value may contain variables in the format $(var) referring to fields from the skeleton. A special variable $(module) is provided and replaced by the module's name.

options={"keyLink": "/$(module)/view/$(key)?style=raw"}