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

[QUESTION] Text link with search term to open in Aedict #858

Closed
jakyo-dev opened this issue Feb 1, 2019 · 6 comments
Closed

[QUESTION] Text link with search term to open in Aedict #858

jakyo-dev opened this issue Feb 1, 2019 · 6 comments
Assignees

Comments

@jakyo-dev
Copy link

jakyo-dev commented Feb 1, 2019

Hey there,

I would like to ask if there's a syntax available to create text link which will open directly in Aedict with a search term (on Android smartphones, of course).

Background:
I started to use Anki again, as I noticed how great of a combo Aedict and Anki are. When changing from Anki to Aedict, it's normally to check up additionally information about the specific card vocable. The quicker the app change the better. Currently it's already possible by marking the word, hit on 'share' and choose Aedict. The problem is, it takes quite a lot of steps and especially on slower(?) smartphones, the unasked for feature called 'direct share' adds a really annoying delay (-> https://www.xda-developers.com/remove-direct-share-share-menu-root/ ).

So, a text link like 'app:aedict=[search term]' (totally random markup) that I can built into Anki cards would be really appreciated for a quick look up.

Changing back from Aedict to Anki is a no brainer, simply hitting square twice.

Thanks!

@mvysny mvysny self-assigned this Feb 4, 2019
@mvysny
Copy link
Owner

mvysny commented Feb 4, 2019

Hey, that's a really neat idea! Let me experiment on what kind of links are possible with Android.

@mvysny
Copy link
Owner

mvysny commented Feb 4, 2019

According to https://developer.android.com/guide/topics/manifest/data-element Aedict can only respond to links such as aedict://search%20term, for example aedict://はは. I need to investigate the following:

  • I guess the search string will be passed in as the 'host' parameter perhaps
  • How are the whitespaces handled? I guess %20 but this needs to be examined.

The search query might be passable also as the query part of the URL spec: e.g. aedict://a?q=はは - this form will be necessary if the host part can't handle %20 or spaces.

@mvysny
Copy link
Owner

mvysny commented Feb 4, 2019

A couple of example testing links (these should work also from the browser when Aedict will pick up this functionality):

  • aedict://はは
  • aedict://はは%20は
  • aedict://a?q=はは%20
  • http://aedict?q=はは - for certain sites that would reject to render any links not starting with http:// or https://

@mvysny
Copy link
Owner

mvysny commented Feb 4, 2019

Implemented in Aedict 3.50.11

@mvysny mvysny closed this as completed Feb 4, 2019
@jakyo-dev
Copy link
Author

I've received the update finally a few days and it works really great!

When using it with whole sentences, though, I noticed that my data set uses html tags to emphasize the vocable and sadly, this breaks the search in Aedict.

If you could make an update which filters the html tags out that would be really appreciated, thanks.

screenshot_20190304-192016

screenshot_20190304-191922

@mvysny
Copy link
Owner

mvysny commented Mar 4, 2019

Hi, thanks for the idea! Could you please open a new bug report regarding this idea, and describe in more detail where exactly should aedict attempt to remove the html formatting? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants