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

Request for adding more features to {selection-text} #1172

Open
bewizible opened this issue Jul 2, 2024 · 2 comments
Open

Request for adding more features to {selection-text} #1172

bewizible opened this issue Jul 2, 2024 · 2 comments
Labels
area/anki The issue or PR is related to Anki integration kind/enhancement The issue or PR is a new feature or request

Comments

@bewizible
Copy link

As of now, {selection-text} does only one thing, return the text selected by user. I would like to humbly request for two more features to be included into this handlebar, namely

  1. {selection-text} to ignore selected text IF it is the same as vocab, this is so it can be used with the Yomitan Search Page.
  2. {selection-text} to have a dictionary override too, for example, if you want to choose a certain definition in its entirely you could just select the dictionaries title (in the tag) and have it be the text gone into the field using selection-text instead of manually selecting the entire definition.

Adding this feature to selection-text would make it more nicer to use. Thanks very much!

@bewizible bewizible added the kind/enhancement The issue or PR is a new feature or request label Jul 2, 2024
@bewizible bewizible changed the title More features for {selection-text} Request for adding more features to {selection-text} Jul 2, 2024
@Kuuuube
Copy link
Member

Kuuuube commented Jul 2, 2024

For point 1 what issues with the search page are you having? I dont see any reason this request is specific to the search page. Unless theres something more to this, it's out of scope of yomitan and you should configure that on your anki card template instead.

For point 2 we do have the single dictionary handlebars. You could also set that up with every dict in a different field and only show the one from selection text in your anki card template.

@Kuuuube Kuuuube added the area/anki The issue or PR is related to Anki integration label Jul 2, 2024
@bewizible
Copy link
Author

Thank you for your prompt response and for the incredible work on Yomitan. I'd like to address your points and provide further clarification on my feature requests.

For point 1 what issues with the search page are you having? I don't see any reason this request is specific to the search page. Unless there's something more to this, it's out of scope of Yomitan and you should configure that on your Anki card template instead.

As far as I understand, this issue seems to occur specifically on the Yomitan Search Page. I believe this might be because the entire page is treated as a popup. However, my technical knowledge of Yomitan's code is limited, so I might be mistaken. This issue affects the field using selection-text on the search page.

Here's an example of how it looks on the page, which appears fine:
image

But this is what gets exported to the card:
image

Interestingly, this issue doesn't occur if I select other text within the definition, which then becomes the selection text instead of the word highlighted by Yomitan. However, I prefer not to manually select text for every definition. As someone who uses manga_ocr to read manga and the Yomitan Search Page extensively, I encounter this issue frequently. It would be wonderful if this could be addressed.

For point 2 we do have the single dictionary handlebars. You could also set that up with every dict in a different field and only show the one from selection text in your Anki card template.

Yes, the single dictionary handlebars are fantastic and have made me switch from JPMN. I currently use them in my card as follows:

  • My Main Definition Field: {selection-text}
  • My Secondary Definition Field: {single-glossary-jmdict}
  • My Full Definition: {glossary}

However, I sometimes find myself in situations where I would like the entire content of a specific dictionary added to a field. Selecting the entire content manually can break the formatting, which, while not always, happens often enough to be an inconvenience. This is why I'm requesting an enhancement to the handlebar functionality.

Creating a separate handlebar that works in conjunction with selection-text would be ideal. For example, {new-handlebar}{selection-text} where:

  • {new-handlebar} returns the dictionary's contents if its name is selected.
  • {selection-text} returns nothing if the selected text is either:
    1. The same word or a variation (e.g., 辞めて for 辞める).
    2. The name of a dictionary.

This addition would greatly enhance the usability and flexibility of the handlebars.

Thank you very much for considering these suggestions. Your efforts are greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/anki The issue or PR is related to Anki integration kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

No branches or pull requests

2 participants