superlou / fountain-atom

Grammar and tools for the Fountain screenwriting syntax
MIT License
48 stars 15 forks source link

Adding more "diversity" of color to the syntax highlights. #51

Open rubenxyz opened 6 years ago

rubenxyz commented 6 years ago

Hi Everybody. I have felt that having different colors in the fountain syntax highlights has made it so much easier and faster to identify different elements of the screenplay and move around swiftly. I added a bunch of colors to my stylesheet that I wanted to put forward as proposal for future updates of the Fountain package.

Fully understand that everybody wouldn't choose the same colors as me but by shipping the package with diverse set of colors as a default, the option and benefit of such visual distinction can be apparent and utilized by more users.

What do you guys think?

Here are my injections. See screenshot below. `*/ atom-text-editor.editor .syntax--entity.syntax--name.syntax--character.syntax--fountain { color: #6187C3; font-weight: normal !important; } atom-text-editor.editor .syntax--keyword.syntax--other.syntax--heading.syntax--scene.syntax--fountain { color: #94ba8d; } atom-text-editor.editor .syntax--entity.syntax--name.syntax--heading.syntax--scene.syntax--fountain { color: #94ba8d; } atom-text-editor.editor .syntax--string.syntax--other.syntax--dialogue.syntax--parenthetical.syntax--fountain { color: #75b0b1; } atom-text-editor.editor .syntax--string.syntax--other.syntax--dialogue.syntax--fountain{ color: #ad92ad; } atom-text-editor.editor .syntax--entity.syntax--other.syntax--transition.syntax--fountain{ color: #c68a75; } atom-text-editor.editor .syntax--comment.syntax--note.syntax--fountain { color: #d0a851; } atom-text-editor.editor .syntax--comment.syntax--block.syntax--fountain { color: #bf616a; }

atom-text-editor.editor .syntax--string.syntax--other.syntax--title-page.syntax--fountain { color: #adad92; }

atom-text-editor.editor .syntax--meta.syntax--paragraph.syntax--text { color: #b8c0d4; } ` screen shot 2018-01-20 at 9 48 29 pm

jrbostic commented 6 years ago

Would be cool to hook up to the fountain settings menu. It does support a color type, so would be perfectly reasonable to allow users to configure. Not sure how you would hook config values into the highlighter though.

rubenxyz commented 6 years ago

@jrbostic That would be even better! Am I the only one that love having the elements with distinct syntax highlights?

It has made writing and navigating through the text so much easier.

Last but not least, it looks much cooler.

If we would want to see this be implemented into the Fountain package for Atom, how would we make it happen?

Just for full disclosure, at the moment of writing I have almost no coding skills. Took me two days to figure out what code to inject into the stylesheet to get this color scheme. Any ideas?

superlou commented 6 years ago

I don't think there's any issue with making the grammar's style tags more explicit for styling fountain elements. This would then let users set their own styles/colors.

I'm a little concerned about picking our own colors that aren't based off the active theme, since that might cause visibility issues on different themes. Also, I think some users may prefer not to have too much visual variety while writing. Is there a guide somewhere saying what different styles a theme should make available? That might give us an idea on how many different styles we should bake into the Fountain package by default.

rubenxyz commented 6 years ago

Totally agree with @superlou that if you would incorporating colors to the default package, it should be done cognisant of unintended consequences and that different UI themes might not flatter the chosen palette.

It is also safe to assume that most writers doesn't want their screenplay to look like a unicorn threw up on their screen.

That being said, there is a president for how to color syntax highlights by the big language such as CSS, HTML, etc. Of course there are some radical themes out there but most seems to have about the same colors. Dark, grayish background and muted colors.

Even if you don't change the colors that are now default, those are colors nevertheless and they too might not jive with whatever the users have. So why not make them something cool out of the box? If there are an outlier out there that have a bright pink UI theme, then surely that user will accept having to tweak the default colors of his Fountain Package to make them match?

I got the idea for these muted colors from the Space Gray Theme from when I was running Sublime Text. Many other themes seem to use similar, muted colors that help you differentiate between types of sections without burning into your retina. Almost all other languages has similar differantions of syntax highlights, why shouldn't Fountain have it?

I grant that I'm a noob and might not understand the consequences of building in a more diverse colorscheme or making it an option in the settings so please excuse if I'm out of my depth here.

jrbostic commented 6 years ago

Yea, I'm not familiar with the themes, but could we support two or three named schemes that are compatible with dark and light editor themes?

superlou commented 6 years ago

I'm not familiar with the theme architecture, but my guess is that most languages don't pick colors at all. They would simply delegate to something like "theme-emphasis-1" or "theme-comment," and the theme picks the colors. I don't believe a grammar should be (for the most part) choosing colors itself. For example, the C grammar doesn't contain any CSS.

jrbostic commented 6 years ago

Yea, I suppose going with built-in theme classes is a more flexible approach. And it does threaten to take the focus somewhat off actual fountain tools.

superlou commented 6 years ago

This is how we currently stand on how Fountain syntax is classified into Atom grammar contentNames:

Fountain Syntax Atom contentName Style from package?
action meta.paragraph.text
action (links) markup.underline.link.text
comments comment.block.fountain
notes comment.note.fountain
synopses comment.synopses.fountain
dialogue string.other.dialogue.fountain
character entity.name.character.fountain yes
parenthetical string.other.dialogue.parenthetical.fountain
lyrics lyric.fountain yes
markup (various GFM classes)
pagebreaks entity.other.pagebreak.fountain
title page keyword keyword.other.title-page.fountain
title page value string.other.title-page.fountain
transition entity.other.transition.fountain
scene heading keyword, e.g. “INT” keyword.other.heading.scene.fountain yes
scene heading name entity.name.heading.scene.fountain yes
scene heading number constant.numeric.scene.fountain yes
sections markup.heading.heading-1/2/3/4/5/6.gfm

Because I'm a huge hypocrite, there are a few items that are style by this package. Note that these do use the Atom Styleguide (available from ctrl+shift+G or the command palette) when text colors are used. However, the Styleguide doesn't define syntax classes anywhere, so I'm still looking for those.

For the most part, everything that is fountain specific ends with .fountain. The class before that is the name of the Fountain syntax, e.g. .parenthetical or .dialogue. The classes preceeding that are where things get fuzzier. They were mostly chosen to get styling effects from code-like languages.

Right now, it seems like we should: