playfair

Playfair Script Formatter
git clone https://git.stjo.hn/playfair
Log | Files | Refs | README

commit 503237d111b73b7b1e479be7389ea0f2e45967bf
parent 1395a2cc0cd5fd9e6683c729fd2e86975720574e
Author: St John Karp <contact@stjo.hn>
Date:   Tue, 30 Oct 2012 11:43:27 -0700

Made persona/time/setting tags optional for stage plays

A script can be formatted either with or without the above tags.
If it has a persona, a script must also have a time and setting.

Diffstat:
Mplayfair.pl | 15+++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/playfair.pl b/playfair.pl @@ -27,9 +27,9 @@ script(Type, [element(html, [], [Head, Body])]) --> head(Type, Head, Variables), double_break, body(Type, Body, Variables). -body(stage, element(body, [], [TitlePage, MetaPage, Play]), [Title, Author, Personae, Time, Setting]) --> title_page(TitlePage, Title, Author), meta_page(MetaPage, Personae, Time, Setting), play(stage, Play). +body(Type, element(body, [], [TitlePage, MetaPage, Play]), [Title, Author, Personae, Time, Setting]) --> title_page(TitlePage, Title, Author), meta_page(MetaPage, Personae, Time, Setting), play(Type, Play). -body(screen, element(body, [], [TitlePage, Play]), [Title, Author]) --> title_page(TitlePage, Title, Author), play(screen, Play). +body(Type, element(body, [], [TitlePage, Play]), [Title, Author]) --> title_page(TitlePage, Title, Author), play(Type, Play). play(Type, element(div, [id = play], Play)) --> scene_repeater(Type, Scenes), double_break, end(End), single_break, {append(Scenes, [End], Play)}. @@ -109,9 +109,9 @@ emphatic(element(em, [], [Text])) --> ['*'], text(['\n', '*'], Text), ['*']. character_directions(element(span, [class = characterDirections], ['(', Text, ')'])) --> ['('], text(['\n', <, >, '(', ')'], Text), [')']. -head(stage, element(head, [], [Charset, TitleTag, AuthorTag|Styles]), [Title, Author, Personae, Time, Setting]) --> meta_charset(Charset), styles(stage, Styles), tag_title(TitleTag, Title), single_break, tag_author(AuthorTag, Author), single_break, tag_personae(Personae), single_break, tag_time(Time), single_break, tag_setting(Setting). +head(Type, element(head, [], [Charset, TitleTag, AuthorTag|Styles]), [Title, Author, Personae, Time, Setting]) --> meta_charset(Charset), styles(Type, Styles), tag_title(TitleTag, Title), single_break, tag_author(AuthorTag, Author), single_break, tag_personae(Personae), single_break, tag_time(Time), single_break, tag_setting(Setting). -head(screen, element(head, [], [Charset, TitleTag, AuthorTag|Styles]), [Title, Author]) --> meta_charset(Charset), styles(screen, Styles), tag_title(TitleTag, Title), single_break, tag_author(AuthorTag, Author). +head(Type, element(head, [], [Charset, TitleTag, AuthorTag|Styles]), [Title, Author]) --> meta_charset(Charset), styles(Type, Styles), tag_title(TitleTag, Title), single_break, tag_author(AuthorTag, Author). tag_title(element(title, [], [Text]), Text) --> ['@', t, i, t, l, e, ':', ' '], text(['\n'], Text). @@ -146,9 +146,7 @@ styles_specific(stage, element(link, [rel = 'stylesheet', type = 'text/css', hre styles_specific(screen, element(link, [rel = 'stylesheet', type = 'text/css', href = 'scriptfrenzy_screen.css'], [])) --> []. -%meta_charset(element(meta, [charset = 'utf-8'], [])) --> []. - -meta_charset(element(meta, ['http-equiv' = 'Content-Type', content = 'text/html; charset=utf-8'], [])) --> []. +meta_charset(element(meta, [charset = 'utf-8'], [])) --> []. single_break --> ['\n']. @@ -201,4 +199,4 @@ process_file(File, []):- process_file(File, [Letter|List]):- get_char(File, Letter), - process_file(File, List). + process_file(File, List). +\ No newline at end of file