Wiki Page Content

DRA Macro Syntax

This page describes the macros added to the base MoinMoin wiki that are not documented on the other help pages. The most frequently used macros are described first.

In the examples below, the text shown in gray boxes contains the macro text to be inserted into a wiki page, and the dotted box following contains the output from the macro.

DraPix

This macro displays images or elements from the DigitalRockArt database. Its normal use will be within Survey Report pages.

Multiple parameters may be entered as a comma separated list. The possible parameters are:

  • Any Image ID preceded by the letter i
  • Any element ID preceded by the letter e
  • The size of the desired image, where size is between 64 and 800 inclusive. If not specified, the default size is 224.
  • As an option, image and element IDs may be followed by the letters:
    • r, g, or b to show the respective red, green, or blue color layer in grayscale.
    • y to show image in natural grayscale

The size of the image displayed may be limited by the size of the cropped element. Pages printed in portrait mode may truncate images wider than about 660 pixels.

The grayscale option should only be used when an element or panel is known to have better contrast in the selected color band.

   <<DraPix(i782,e673)>>
   <<DraPix(i782,size=128)>>
   <<DraPix(i782r,e673g)>>

An obsolete format may be found within a few older survey reports. The first example above could be duplicated by using <<DraPix(782,782-1)>> where 782 is the image ID and 1 is the element number. This form is deprecated and should be removed whenever survey reports are updated.

DraSiteName

This macro is intended for use within Survey Reports and returns a site name based upon the current user's ID and privileges. If privileged, the site name will contain the survey reference ID, site name, site number, and area. If not privileged, the site name will contain the survey reference ID and the area.

The possible parameters are:

  • None, this form should only be used at the top of a survey report.
  • Survey Reference ID - this may be used to reference another site for comparison within a site report.

   <<DraSiteName>> # creates a heading based upon the survey report page name, not shown below.
   ... some text <<DraSiteName(11)>> more text...

  • .. some text 0011 (34N112W) more text...

DraElementClassCounts

This macro is intended for use within Survey Reports and returns a table and a bar graph comparing the class counts and percentages of the site against the element class percentages of all other sites recorded in the database. In normal use, the site reference ID will be extracted from the page name so no parameter is required. The macro will accept an integer parameter ONLY if the page name does not contain a valid reference ID -- the example below shows site 0011 (34N112W).

   <<DraElementClassCounts>>

  • Element Classes
    Class Number
    Elements
    Percent All Other Surveys
    Percent
    Totals 97 99 99
    Anthropomorphic 6 6 6
    Mask Or Head 0 0 0
    Anthro Prints 0 0 1
    Anthro Tools 0 0 1
    Historic 0 0 2
    Vandalism 1 1 9
    Zoomorphic 43 44 16
    Zoomorphic Tracks 0 0 1
    Phytomorphic 0 0 0
    Pipettes 0 0 0
    Geometric 17 18 27
    Abstract 9 9 8
    Indeterminate 13 13 25
    Grinding Feature 8 8 3

DraElementSize

This macro is intended for use within Survey Reports and returns a table and a bar graph comparing the element class sizes of the site. In normal use, the site reference ID will be extracted from the page name. The macro will accept an integer parameter ONLY if the page name does not contain a valid reference ID -- the example below shows site 0011 (34N112W).

If there are more than 5 element classes occur within a survey, multiple bar graphs are created.

   <<DraElementSize>>

  • Element Sizes
    ClassNo Size0.0 m +0.1 m +0.2 m +0.3 m +0.4 m +0.5 m +Total
    Anthropomorphic10500006
    Vandalism10000001
    Zoomorphic30122251043
    Geometric324620017
    Abstract50021019
    Indeterminate137200013
    Grinding Feature80000008
    Total225283281197

DraPanelFacing

This macro is intended for use within Survey Reports and returns a table and a graph comparing the panel facing counts and percentages for all panels within the survey. In normal use, the survey reference ID will be extracted from the page name.

The macro will accept an integer parameter ONLY if the page name does not contain a valid reference ID -- the example below shows site 0011 (34N112W).

   <<DraPanelFacing>>

  • Panel Facings
    Panel FacingsDegree
    Range
    Number
    Panels
    Percent
    None 15
    Horizontal 210
    North338-02200
    Northeast023-06700
    East068-11200
    Southeast113-15700
    South158-20200
    Southwest203-2471676
    West248-292210
    Northwest293-33700
    Total 21101

DraPanelInclination

This macro is intended for use within Survey Reports and returns a table and/or a graph comparing the class counts and percentages of the site against the element class percentages of all other sites recorded in the database. In normal use, the site reference ID will be extracted from the page name.

The macro will accept an integer parameter ONLY if the page name does not contain a valid reference ID -- the example below shows site 0011 (34N112W).

   <<DraPanelInclination>>

  • Panel Inclinations
    Panel InclinationsNumber
    Panels
    Percent
    None15
    0-15210
    16-3000
    31-4515
    46-60314
    61-75943
    76-9000
    91-105419
    106-12015
    121-13500
    136-15000
    151-16500
    166-18000
    Total21101

DraEject

This macro adds a printer eject function to a wiki page. It has no effect on a page displayed on a monitor. It may be used within the tutorial pages or site reports to assist in placement of images and related text on the same printed page.

There are no parameters accepted.

NOTE: This function will not work with the Microsoft Internet Explorer 6 browser.

   <<DraEject>> # you must print or use print preview to see the effect.

DraPageInfo

This macro writes the last revision date and author's name. The information provided is similar to that written at the bottom of every wiki page. The macro may be placed anywhere in the page.

   <<DraPageInfo>>

Revision: 2011-12-29 19:32:39 by RogerHaase

DraCenterImage

This macro is used to display screenshots within the tutorial. It may be used to replace the attachment: syntax for displaying an image attached to a wiki page. The macro draws a border around the image and centers the image horizontally on the page. This is useful when displaying or printing screenshot images with a white background on a wiki page with a white background.

Up to five image file names may be passed. File names may include wiki page names:

  • filename.png - for displaying an image attached to the current page.
  • ScreenShots/filename.png - for displaying an image attached the ScreenShots wiki page. /!\ Use forward slashes.

   <<DraCenterImage(logosml.jpg,DraSyntax/logosml.jpg)>>
   {{attachment:logosml.jpg}}

logosml.jpg

DraSurveyReport

This macro returns a list of survey reports. It is intended for use on the bottom of FrontPage and SurveyReport. A list is provided only if the user reading the page has logged in. The contents of the list will vary depending upon the user's ID and privileges.

There are no parameters accepted.

   <<DraSurveyReport>> 

DraExamples

This macro displays a hyperlink that will open a new window and display elements from the DigitalRockArt database with each of the attributes of a rock art class. It is used within the wiki pages that describe the rock art classes and attributes.

The parameters are:

  • Class_Name.Attribute_Set_Name

Where Class_Name is a valid rock art class and Attribute_Set_Name is an attribute set of the preceding class. Use of underscore characters to replace blanks within the names is optional.

   <<DraExamples(Mask_Or_Head.Facial Features)>>

DraClassExamples

This macro displays a hyperlink that will open a new window and display example elements of all rock art classes. It is used within the wiki pages that describe the rock art classes

There are no parameters accepted.

   <<DraClassExamples>>

DraShowMap

This macro displays a hyperlink that will open a new window and display a Google map centered on the latitude-longitude passed as a parameter.

   The site is here: <<DraShowMap(36N111W)>>

Sortable Tables

Any table can be made sortable by adding a <tableclass="sortable"> to the table definition.

||<tableclass="sortable">Head 1||Head 2||Head 3||
||11||44||66||
||77||55||3||
||55||5||555||

Head 1

Head 2

Head 3

11

44

66

77

55

3

55

5

555

NewWindow

This macro creates a hyperlink that will open a new window.

The parameters are:

  • URL - the page to be displayed; may be a wiki page name or a fully qualified http: url.
  • alias - optional, text describing the URL.

   * <<NewWindow("http://www.google.com")>>
   * <<NewWindow("http://www.google.com","my favorite search engine")>>
   * <<NewWindow("FrontPage")>>

HelpOnDraMacroSyntax (last edited 2011-12-29 19:32:39 by RogerHaase)

Copyright © 2002-2020 by DigitalRockArt.org and all contributing authors. Contact: digitalrockart@yahoo.com.