dformatプラグインを作って遊んでみた

これを改造して、

{{{#!dformat
style bitwid .3
PDP-8 Instr
        0-2 Op Code
        3 Indirect Bit
        4 Page-Zero Bit
        5-11 Page Address
}}}

こう書くと……

こんな画像に変換するMoinMoinのプラグインを作ってみた。

dformatはpicに変換するawkスクリプト(Bentleyの資料にあるやつ)で、そこからgpicでPostScriptに。またそこからGhostScriptでpngに変換しています。

もちろんpicプラグラインも。

{{{#!pic
.ps -2
		circle "DISK"
		arrow "character" "defns"
CPU:	box "CPU" "(16-bit mini)"
		{ arrow <- from top of CPU up "input " rjust }
		arrow
CRT:	"   CRT" ljust
		line from CRT - 0,0.075 up 0.15 \
				then right 0.5 \
				then right 0.5 up 0.25 \
				then down 0.5+0.15 \
				then left 0.5 up 0.25 \
				then left 0.5
Paper:	CRT + 1.05,0.75
		arrow <- from Paper down 1.5
		" ...  paper" ljust at end of last arrow + 0, 0.25
		circle rad 0.05 at Paper + (-0.055, -0.25)
		circle rad 0.05 at Paper + (0.055, -0.25)
		"   rollers" ljust at Paper + (0.1, -0.25)
.ps +2
}}}

こう書くと……

こんな感じに。