Local Enhancements to PmWiki
Built-in Stuff
First, see the PmWiki documentation to see the
built-in PmWiki markup.
AM/PM
In text such as 9:30am or 10PM, display using small caps.
Class runs 11:30am until 12:45PM.
| Class runs 11:30ᴀᴍ until 12:45ᴘᴍ.
|
answer
Conceal an answer until hover over it with the mouse.
The answer is available to a student reviewing the class content, but
you can reveal it dramatically during lecture.
Two plus two is %answer%four%%, you know.
The secret word is:
>>answer<<
aardvark
or perhaps aardwolf
>><<
| Two plus two is four, you know.
The secret word is:
aardvark
or perhaps aardwolf
|
array
Display a simple array, as in C or Java.
(:array
name="days of the week"
names=day
background=pink
:)
Sun Mon Tue Wed Thu Fri Sat
Joy Sad OK Hump Doit ... JOY!
(:arrayend:)
|
days of the week
day[0] | day[1] | day[2] | day[3] | day[4] | day[5] | day[6] |
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
Joy | Sad | OK | Hump | Doit | ... | JOY! |
|
bargraph
Display a bar graph.
(:bargraph number=off percent=on:)
2 9.0–11.9
5 12.0–14.9
5 15.0–17.9
5 18.0–20.9
4 21.0–23.9
1 24.0–24.9
(:bargraphend:)
|
9.0–11.9 |
|
|
9% |
12.0–14.9 |
|
|
23% |
15.0–17.9 |
|
|
23% |
18.0–20.9 |
|
|
23% |
21.0–23.9 |
|
|
18% |
24.0–24.9 |
|
|
5% |
|
bash
Display bash output. It can simulate an interactive session
(if each line starts with something that looks like a prompt)
(:bash:)
$ date
$ let a=2+2
$ echo "a=$a"
| $ date
Wed Nov 13 05:25:17 MST 2024
$ let a=2+2
$ echo "a=$a"
a=4
|
Or, if no prompt is present, side-by-side script & output:
(:bash:)
#! /bin/bash
date
pwd
| #! /bin/bash
date
pwd
Wed Nov 13 05:25:17 MST 2024
/tmp/PmWiki.895006621
|
Checkin
Web-based checkin. Reads assignment names & times
from ~/Checkin/assignments.
(:checkin:)
Class Variables
A number of useful variables are predefined.
Variable | Possible Value |
ClassName | CS155 |
ClassHome | ~cs155 |
ClassHomeDir | /s/bach/a/class/cs155 |
ClassBin | ~cs155/bin |
ClassUser | cs155 |
ClassURL | http://www.cs.colostate.edu/~cs155 |
ClassNumber | 155 |
ClassSemester | Fall 2017 |
ClassCurrent | true iff the class is happening this semester |
They’re not really designed for this environment, but let’s try them:
* {$ClassName}
* {$ClassHome}
* {$ClassHomeDir}
* {$ClassBin}
* {$ClassUser}
* {$ClassURL}
* {$ClassNumber}
* {$ClassSemester}
* {$ClassCurrent}
|
|
code
Boxes of code. They’re not executed—they’re just there for display.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
(:code:)
int n=3;
cout << n;
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
int n=3;
cout << n;
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
|
The ccode
, lcode
, and rcode
variants align the boxes
to the center, left, or right, allowing text to flow around them.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
(:ccode:)
int n=3;
cout << n;
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
(:lcode:)
int n=3;
cout << n;
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
int n=3;
cout << n;
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
(:rcode:)
int n=3;
cout << n;
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
int n=3;
cout << n;
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
|
countdown
Give a countdown to an event, e.g., start of class.
(:countdown 2076-07-04 Tricentennial:)
| Tricentennial in 18861 days on 2076‒07‒04.
|
This will produce one of:
- Tricentennial begins today!!
- Tricentennial begins tomorrow!
- Tricentennial begins in n days on 2076-07-04
- or nothing, if the time has passed.
c++
Produces side-by-side boxes of C++ source code and output.
If the compilation produced errors or warnings, they’re shown.
(:c++:)
int n = 3;
cout << n << endl;
cout << 1/0 << '\n';
| int n = 3;
cout << n << endl;
cout << 1/0 << '\n';
c.cc:3: warning: division by zero
3
SIGFPE: Floating point exception
|
Adds #include
declarations, using namespace std
, and main()
,
as needed. Compiles code once and caches it, for speed.
Valid options:
-std=
…
-O
…
-W
…
-f
…
-pthread
-I
…
-include
filename
c
Produces side-by-side boxes of C source code and output.
If the compilation produced errors or warnings, they’re shown.
(:c++:)
int n = 3;
printf("%d\n", n);
| int n = 3;
printf("%d\n", n);
3
|
Adds #include
files and main()
, as needed.
Compiles every time, because compiling C is fast.
css
Insert CSS declarations:
(:css:)
h1 { font-size: 120%; }
(:cssend:)
date
Produce dates for a class schedule. It has two forms:
(:YYYY-MM-DD:)
(:day-of-week:)
or, a range of either
The first one refers to an absolute date.
The second one (:Mon:)
, (:Tue:)
, etc., indicates the NEXT such
weekday after the previous (:YYYY-MM-DD:)
or
(:
day-of-week:)
Use (:YYYY-MM-DD:)
as the first date in your schedule,
and (:Tue:)
, (:Thu:)
, …, for subsequent dates.
The date is shown using the shortest notation. For example,
the year is only shown if it’s not the current year.
* (:2020-08-25:) Week #1
* (:Thu:) quiz today
* (:Tue:) Week #2
* (:Thu:) HW1 due
| - Tue Aug 25, 2020 Week #1
- Thu Aug 27, 2020 quiz today
- Tue Sep 1, 2020 Week #2
- Thu Sep 3, 2020 HW1 due
|
gmap
Embed a Google Map.
(:gmap z=17 width=300 height=300 q="Eddy Hall, Fort Collins":)
|
|
java
Produces side-by-side boxes of Java source code and output.
If the compilation produced errors or warnings, they’re shown.
(:java:)
int n = 3;
System.out.println(n);
| int n = 3;
System.out.println(n);
3
|
Adds a class and main()
, as needed. Compiles every time—no caching.
manpage
Display links to man pages or Wikipedia:
* «vi» (the command)
* «sync» (the command)
* «sync(2)» (the system call)
* «abort(3)» (the library call)
* «French Poodle» (capitalized—Wikipedia)
|
|
perl
Produces side-by-side boxes of Perl source code and output.
If the compilation produced errors or warnings, they’re shown.
(:perl:)
print scalar localtime;
| print scalar localtime;
Wed Nov 13 05:25:17 2024
|
php
Embed PHP in PmWiki. This is not like (:c:)
or (:perl:)
.
This runs PHP and sends its output to be part of the webpage.
(:php:)
echo "<b>bold</b> or <i>italic</i><br/>";
echo strftime('%T %A %B %d, %Y');
(:phpend:)
| bold or italic 05:25:17 Wednesday November 13, 2024
|
preliminary
A large banner that marks this page as preliminary.
(:preliminary:)
| This is preliminary
|
python2
Produces side-by-side boxes of Python2 source code and output.
If the compilation produced errors or warnings, they’re shown.
(:python2:)
n=0100;
print(n);
| n=0100;
print(n);
64
|
python3
Produces side-by-side boxes of Python3 source code and output.
If the compilation produced errors or warnings, they’re shown.
(:python3:)
n=0o100;
print(n);
| n=0o100;
print(n);
64
|
randomline
Select a random line.
If no arguments are given, select a line with equal probability:
(:randomline:)
Web:icon.svg
https://example.com/
some '''bold''' text
(:randomlineend:)
|
|
Percentages can be specified:
(:randomline 1% 10% 89%:)
Choose ''this'' line 1% of the time.
Choose ''this'' line 10% of the time.
Choose ''this'' line 89% of the time.
(:randomlineend:)
| Choose this line 10% of the time.
|
Not all probabilities need be explicitly specified. Lines without
matching probabilities will be selected with equal chance.
(:randomline 50% 41.3%:)
This appears 50% of the time.
This appears 41.3% of the time.
This appears 2.9% of the time.
This appears 2.9% of the time.
This appears 2.9% of the time.
(:randomlineend:)
| This appears 41.3% of the time.
|
s5
Mark a page as being an S5 slide set.
throb
Make text throb. Like a flash, but not discrete.
This is based on the Red Alert screen from Star Trek II: The Wrath of Khan.
Listen to me %throb%NOW%%, please!
| Listen to me NOW, please!
|
-or-
>>throb<<
hi there
folks
>><<
|
|
unavailable
Mark a page as unavailable, until a given date.
It will not show the rest of the page if it’s not time.
Handy for hiding an assignment.
(:unavailable:)
| This page is not yet available.
|
-or-
(:unavailable 2076-07-04:)
| This page is unavailable until 2076‒07‒04
|
-or-
(:unavailable July 4 2076 11am:)
| This page is unavailable until 2076‒07‒04 11:00:00
|