noteflakes / lydown

A language for music notation
http://ciconia.github.io/lydown
MIT License
24 stars 0 forks source link

Mode specific code #21

Closed noteflakes closed 8 years ago

noteflakes commented 9 years ago

The code will be rendered only when the rendering mode fits corresponds to the specified mode:

\score // everything after this directive will be rendered only in score mode
\part // everything after this directive will be rendered only in part mode
\all // everything after this directive will be rendered in any mode
noteflakes commented 9 years ago

Perhaps it's better to use something that could be enhanced in the future:

\mode:score ...
\mode:part ...
\mode:none ...

As for how to implement this, the easiest and perhaps most extensible method would be to add some logic in front of the WorkContext#emit method, and inhibit emitting when the mode is set and does not match the render mode.