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

Schema for structured content with possible values #116

Closed
marpe opened this issue Oct 28, 2024 · 1 comment
Closed

Schema for structured content with possible values #116

marpe opened this issue Oct 28, 2024 · 1 comment

Comments

@marpe
Copy link

marpe commented Oct 28, 2024

Is there something like a JSON schema available for the structured content in glossary? Specifically I'm interested in the possible values for e.g title in e.g an object like this:

[
                    {
                      "tag": "th",
                      "style": {
                        "fontWeight": "normal"
                      },
                      "content": "おなじ"
                    },
                    {
                      "tag": "td",
                      "style": {
                        "textAlign": "center"
                      },
                      "content": {
                        "tag": "div",
                        "title": "valid form/reading combination",
                        "style": {
                          "cursor": "help",
                          "padding": "0 0.25em",
                          "color": "var(--background-color, var(--canvas, #f8f9fa))",
                          "background": "radial-gradient(var(--text-color, var(--fg, #333)) 50%, white 100%)",
                          "clipPath": "circle()",
                          "fontWeight": "bold"
                        },
                        "content": ""
                      }
                    }
                  ]

I'm using this to build CSS selectors like div[title="valid form/reading combination"]. Preferably I would like a version with all of the inline styles removed and instead replaced with classnames that I can override.

@stephenmk
Copy link
Owner

stephenmk commented Oct 28, 2024

I want to replace the inline styles with classes, but support for CSS stylesheets in yomitan is still in its infancy and broken in more than one way.

I don't recommend creating styles attached to title tooltip text, since I might decide to change this text sometime. There are some data attribute properties in the yomitan version that should be fairly stable and you can use to select elements for styles.

@stephenmk stephenmk closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants