Styles The spirit of DSM almost forbids replicating formatting information
throughout a generated document. Rather than de?¬?ne each header to be 14 point
bold italic Arial with 12 point spacing above and below, the generated document
simply contains the fact that this is a level one heading. The actual styling
information is moved to a separate ?¬?le: CSS for HTML, or a template for Word.
These ?¬?les would be handwritten once along with the modeling language, not
generated each time.
Splitting the information from its representation in this way also allows one
document generator to produce output for multiple purposes. For instance, there may
be one CSS ?¬?le that speci?¬?es fonts and layouts suitable for on-screen viewing, and a
second CSS ?¬?le with formatting better suited to hard copy: no hyperlink highlights, no
sidebars, and so on.
Not specifying formatting in the generated output also makes it easier to build the
generator. A similar effect could of course be obtained with a set of subgenerators to
specify the formatting for each style. That tends to lead to rather baroque looking
generators that spend more time calling subgenerators than outputting anything
useful. The resulting documentation ?¬?les are also ?¬?xed to a speci?¬?c set of formatting:
with a separate stylesheet or template, even old documentation outputs can be viewed
with the latest styles.
Pages:
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522