Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StarOfficeStyle #2168

Merged
merged 14 commits into from Jul 15, 2022
Merged

Add StarOfficeStyle #2168

merged 14 commits into from Jul 15, 2022

Conversation

flywire
Copy link
Contributor

@flywire flywire commented Jun 29, 2022

StarOffice style is a theme used in the user interface and carries through to OpenOffice and LibreOffice, and the documentation.

Reference:

pygments/styles/staroffice.py Outdated Show resolved Hide resolved
pygments/styles/staroffice.py Outdated Show resolved Hide resolved
pygments/styles/staroffice.py Outdated Show resolved Hide resolved
flywire and others added 3 commits June 29, 2022 17:33
Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
@flywire
Copy link
Contributor Author

flywire commented Jun 29, 2022

I can't successfully resolve these errors, I'll have to take advice:

  • staroffice.py has CRLF but I can't remove them
  • contrast test fail, perhaps Pygments uses different combinations

@jeanas
Copy link
Contributor

jeanas commented Jun 29, 2022

I can't successfully resolve these errors, I'll have to take advice:

* staroffice.py has CRLF but I can't remove them

I didn't see them locally. If you Git is properly configured with core.autocrlf, they are in your source tree but automatically converted to LF when pushing.

* contrast test fail, perhaps Pygments uses different combinations

This was added some time ago to ensure new styles had good contrast (for visually impaired people). You need to change the colors slightly to make them more contrasted with the white background.

@jeanas
Copy link
Contributor

jeanas commented Jun 29, 2022

I see a commit increasing the contrast, but the test says it's still not enough.

@flywire
Copy link
Contributor Author

flywire commented Jul 10, 2022

  • contrast test fail, perhaps Pygments uses different combinations

Let's see if we can change LibreOffice colors: https://bugs.documentfoundation.org/show_bug.cgi?id=149934

@birkenfeld
Copy link
Member

haha, nice!

@flywire
Copy link
Contributor Author

flywire commented Jul 10, 2022

This is not right to go yet.

default_style is the style inherited by all token types.

Expected default (blue) style to apply for all styles not named and their descendants, non-named and descendants showing as black.

    default_style =             '#000080'    # Blue
    styles = {
        Comment:                '#696969',   # DimGray
        Error:                  '#800000',   # Maroon
        Literal:                '#EE0000',   # Red
        Name:                   '#008000',   # Green
    }

Expected:

image

Getting (note first value black not default blue):

image


>pygmentize -l lobas -O full,style=staroffice -o test.html test.bas

(lobas is vbnet alias)

test.bas

Sub OpenGreeting
    ' Sample code
    print "Hello World"

@jeanas jeanas merged commit c6cd51f into pygments:master Jul 15, 2022
@Anteru Anteru added this to the 2.13.0 milestone Aug 14, 2022
@Anteru Anteru added the A-theming area: changes to themes label Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-theming area: changes to themes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants