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
ElementsPercent All Other Surveys
PercentTotals 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 Class No Size 0.0 m + 0.1 m + 0.2 m + 0.3 m + 0.4 m + 0.5 m + Total Anthropomorphic 1 0 5 0 0 0 0 6 Vandalism 1 0 0 0 0 0 0 1 Zoomorphic 3 0 12 22 5 1 0 43 Geometric 3 2 4 6 2 0 0 17 Abstract 5 0 0 2 1 0 1 9 Indeterminate 1 3 7 2 0 0 0 13 Grinding Feature 8 0 0 0 0 0 0 8 Total 22 5 28 32 8 1 1 97
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 Facings Degree
RangeNumber
PanelsPercent None 1 5 Horizontal 2 10 North 338-022 0 0 Northeast 023-067 0 0 East 068-112 0 0 Southeast 113-157 0 0 South 158-202 0 0 Southwest 203-247 16 76 West 248-292 2 10 Northwest 293-337 0 0 Total 21 101
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 Inclinations Number
PanelsPercent None 1 5 0-15 2 10 16-30 0 0 31-45 1 5 46-60 3 14 61-75 9 43 76-90 0 0 91-105 4 19 106-120 1 5 121-135 0 0 136-150 0 0 151-165 0 0 166-180 0 0 Total 21 101
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}}
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>>
No example is shown here because the list is too long, see FrontPage#Survey_Reports .
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)>>
The site is here: 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")>>