Actually, the file nm showed is written in worksheet mode, not document mode, as ">" appears in almost all lines containing maple command.
Though there are some markers of document block, it is at the place of sentences, so I think the autor of the file
used "Format (at Menu bar)-> Create Document Block for that sentences.
Things nm are mentioning is only that it was written in Italic and black characters, which nm can change to
red, no-italic and bold characters, and by changing the font from 2D math to Maple Input with drag menu after
selecting all with "Edit->Select all."
Document mode is just a worksheet mode with one document block from the start of your opening a new file.
And, even if you opened a new file with document mode, you can remove the document block with Format -> remove document block, and click ">", then you get worksheet of worksheet mode.
On the other hand, transforming the already written document mode to worksheet mode shows some messy codes as acer points out, as for example, when I write solve(x^2-1=0,x) in document mode and expand that document block,
solve(x^2-1 = 0, x);
print((2)); # input placeholder
output redirected, and print((2)) are surplus.