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

how do I use custom style #43

Open
1 task
BhaturaGuy opened this issue Aug 11, 2023 · 0 comments
Open
1 task

how do I use custom style #43

BhaturaGuy opened this issue Aug 11, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@BhaturaGuy
Copy link

Problem description

I want to use this style, I saved it in pygments\styles as tokyonight.py
but I get always get error.

from pygments.style import Style
from pygments.token import (
    Comment,
    Error,
    Generic,
    Keyword,
    Literal,
    Name,
    Number,
    Operator,
    Punctuation,
    String,
    Text,
)


class TokyoNightStyle(Style):
    background_color = "#1a1b26"
    highlight_color = "#2a2c3d"
    default_style = ""

    styles = {
        Comment: "#5C6370",
        Comment.Preproc: "#5C6370",
        Comment.Special: "#5C6370",
        Keyword: "#C792EA",
        Keyword.Constant: "#C792EA",
        Keyword.Declaration: "#C792EA",
        Keyword.Namespace: "#C792EA",
        Keyword.Pseudo: "#C792EA",
        Keyword.Reserved: "#C792EA",
        Keyword.Type: "#7FDBCA",
        Operator: "#89DDFF",
        Operator.Word: "#89DDFF",
        Punctuation: "#89DDFF",
        Name: "#D8DEE9",
        Name.Attribute: "#D8DEE9",
        Name.Builtin: "#82AAFF",
        Name.Builtin.Pseudo: "#82AAFF",
        Name.Class: "#FFCB6B",
        Name.Constant: "#FF5370",
        Name.Decorator: "#FFCB6B",
        Name.Entity: "#F7768E",
        Name.Exception: "#FF5370",
        Name.Function: "#82AAFF",
        Name.Property: "#C792EA",
        Name.Label: "#82AAFF",
        Name.Namespace: "#FFCB6B",
        Name.Other: "#82AAFF",
        Name.Tag: "#7FDBCA",
        Name.Variable: "#FFCB6B",
        Name.Variable.Class: "#FFCB6B",
        Name.Variable.Global: "#FFCB6B",
        Name.Variable.Instance: "#FFCB6B",
        Number: "#F78C6C",
        Number.Float: "#F78C6C",
        Number.Hex: "#F78C6C",
        Number.Integer: "#F78C6C",
        Number.Integer.Long: "#F78C6C",
        Number.Oct: "#F78C6C",
        Literal: "#F78C6C",
        Literal.Date: "#F78C6C",
        String: "#C3E88D",
        String.Backtick: "#C3E88D",
        String.Char: "#C3E88D",
        String.Doc: "#5C6370",
        String.Double: "#C3E88D",
        String.Escape: "#FF5370",
        String.Heredoc: "#C3E88D",
        String.Interpol: "#C3E88D",
        String.Other: "#C3E88D",
        String.Regex: "#FF5370",
        String.Single: "#C3E88D",
        String.Symbol: "#C3E88D",
        String.Other: "#C792EA",
        Text: "#D8DEE9",
        Generic: "#D8DEE9",
        Generic.Deleted: "#FF5370",
        Generic.Emph: "italic",
        Generic.Error: "#FF5370",
        Generic.Heading: "#C792EA",
        Generic.Inserted: "#82AAFF",
        Generic.Output: "#D8DEE9",
        Generic.Prompt: "#C792EA",
        Generic.Strong: "bold",
        Generic.Subheading: "#82AAFF",
        Generic.Traceback: "#FFCB6B",
        Error: "#FF5370",
    }

Checklist

Please replace the space inside the brackets with an x if the following items apply:

  • [ x] I've restarted Anki to see if it helps
  • [ x] I've verified that I use the latest version of the add-on by redownloading it from AnkiWeb
  • [ x] I've verified that I use the latest version of Anki by checking at https://apps.ankiweb.net#download
  • [ x] I've tried to disable other add-ons to see if there are any interactions present
  • My issue disappears when I hold shift while starting Anki.
  • [x ] I've checked if anyone else reported this problem before by looking through the issue reports. I also checked to see if there is a section about known issues in the add-on description, documentation, or README.

Information about your Anki set-up

Please fill out the section corresponding with your Anki version:

If you are using Anki 2.1

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):


If you are using Anki 2.0

Please open Anki, go to Help → About, find the two lines starting with Version: and Qt, and copy-paste them between the backticks below:


Please fill in details about your operating system (Windows/macOS/Linux, which version):

  • OS: Windows 11
  • version: Version 22H2 (KB5029263)

Please open Anki, go to Tools → Add-ons, take a screenshot of your installed add-ons, and paste it below:
image

Error message (if any)

image

@BhaturaGuy BhaturaGuy added the bug Something isn't working label Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant