Re: [PATCH] userdiff: add support for Fountain documents

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] userdiff: add support for Fountain documents

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:47

Junio C Hamano [off-list ref] writes:
Zoë Blade [off-list ref] writes:
quoted
More information about the Fountain format can be found on its
official website, at http://fountain.io .
So I visited there.
quoted
+PATTERNS("fountain", "^((INT|EST|EXT)?\\.[A-Z0-9' -]+)$",
+	 "[^ \t-]+"),
After skimming http://fountain.io/syntax I am getting the impression
that this might be a bit too limiting.

 * Although uppercase is recommended for Scene Headings to increase
   readability, it is not required.

 * A line beginning with any of the following, followed by either a
   dot or a space, is considered a Scene Heading (unless the line is
   preceded by an exclamation point !). Case insensitive.

      INT
      EXT
      EST
      INT./EXT
      INT/EXT
      I/E

 * You can "force" a Scene Heading by starting the line with a
   single period.

 * Scene Headings can optionally be appended with Scene
   Numbers. Scene numbers are any alphanumerics (plus dashes and
   periods), wrapped in #.

So, it appears wrong to insist on capital letters in the patterns.
The pattern in the patch does not even accept punctuations on the
line other than apostrophe.  I won't judge if it is OK to limit to
US-ASCII ;-)

IPATTERNS("fountain",
    "^([.][^.]|(INT|EXT|EST|INT./EXT|INT/EXT|I/E)[. ]",
    "[^ \t-]+"),

or something like this, perhaps?

Re: [PATCH] userdiff: add support for Fountain documents

From: Zoë Blade <hidden>
Date: 2016-06-15 23:05:48

On 17 Jul 2015, at 23:43, Junio C Hamano [off-list ref] wrote:
* Although uppercase is recommended for Scene Headings to increase
  readability, it is not required.

* A line beginning with any of the following, followed by either a
  dot or a space, is considered a Scene Heading (unless the line is
  preceded by an exclamation point !). Case insensitive.

     INT
     EXT
     EST
     INT./EXT
     INT/EXT
     I/E

* You can "force" a Scene Heading by starting the line with a
  single period.

* Scene Headings can optionally be appended with Scene
  Numbers. Scene numbers are any alphanumerics (plus dashes and
  periods), wrapped in #.

So, it appears wrong to insist on capital letters in the patterns.
The pattern in the patch does not even accept punctuations on the
line other than apostrophe.  I won't judge if it is OK to limit to
US-ASCII ;-)

IPATTERNS("fountain",
   "^([.][^.]|(INT|EXT|EST|INT./EXT|INT/EXT|I/E)[. ]",
   "[^ \t-]+"),

or something like this, perhaps?
Good points, thanks!

This regex should be a bit sturdier:

$ cat scenes.txt 
int. yes - day
INT. YES - DAY #1A#
EXT. YES - DAY
.YES TOO
!EXT. NO
INT/EXT YES - DAY
INT./EXT YES - DAY
I/E YES - DAY
no
NO
NO.
!.NO.
int yes - day
est yes - day
!EXT. NO - DAY

$ grep -E "^((\.|(([Ii][Nn][Tt]|[Ee][Ss][Tt]|[Ee][Xx][Tt])?\\.?|[Ii]([Nn][Tt])?\.?/[Ee]([Xx][Tt])?\.?) ).+)$" scenes.txt 
int. yes - day
INT. YES - DAY #1A#
EXT. YES - DAY
.YES TOO
INT/EXT YES - DAY
INT./EXT YES - DAY
I/E YES - DAY
int yes - day
est yes - day

Revised version of patch incoming...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help