An extension that creates web links for matching inner HTML text based on a regex format of Q\d+
which is the format of a Wikidata Entity ID.
-
Download this code to your machine.
-
Open Microsoft Edge and go to
edge:https://extensions
. -
Enable Developer mode by toggling the switch in the bottom-left corner.
-
Click on "Load unpacked" button and select the "WikidataEntityLinkerExtension" folder.
-
The extension should now appear in your extensions list and be ready for use.
-
After installing the extension, navigate to any webpage with HTML text that matches the regex format
\sQ\d+
-
The extension will automatically create Wikidata Entity links https://wikidata.org/entity/ for the matching text, such as Q42.
-
Click on the generated links to open them in new tabs.
-
You can also Right Click on generated links and choose "Open link in split screen window" and adjust the middle handle for panel size. You can then Left Click as normal on entity links and they will open in the secondary split window automatically, allowing you to keep viewing your primary window as you click links within it that will open in the split window. Boom baby!
To test the extension locally, follow the "How to Install" instructions above. Once installed, visit a webpage with text matching the regex format Q\d+ and verify that the links are created correctly.
-
Make changes to the extension files as needed.
-
To see the changes, go to
edge:https://extensions
and click on the "Reload" button for the Wikidata Entity ID Linker Extension. -
Test the changes by visiting a webpage with matching text and ensuring the links are generated as expected.
To distribute the extension, you can package it as a .zip file and submit it to the Microsoft Edge Add-ons store. Refer to the official Edge extensions overview for more details.
Here are some possible next steps to enhance the extension:
- Allow users to customize the link format or destination.
- Implement options to enable/disable the link creation feature.
- Add support for more complex regex patterns and text transformations.