This is a Chrome extension that opens relative AdobeDocs and Magento doc links in a new browser tab.
It looks at a selected string and if it is recognized as a devdocs/mercdocs/AdobeDocs path, you can use the "Open in Adobe/Magento" context menu to open the link.
- Clone this code to your local machine.
- Open
chrome://extensions/
in Chrome. - Turn on Developer Mode in the top right corner.
- Click the 'Load Unpacked' button that appeared.
- Browse to the folder with the code and load it.
The 'Adobe/Magento Link Opener' should show in your extension list.
We look for text selections that can be construed to be Devdocs/Merchdocs links.
For instance: a selection that start with src/guides
(with or without the initial slash) and ends in either .md
or .html
.
We also look for {{ site | page | mage2bloburl }}
strings that end in .php
, .phtml
, .html
, .xml
and .js
.
Test your extension with these sample strings.
- Select an example string below.
- Right click and choose "Open in Devdocs" from the context menu.
-
/cloud/docker/docker-config.html
-
A file reference in a Github files PR tab:
src/guides/v2.4/javascript-dev-guide/widgets/jquery-widgets-about.md
-
Paths start with
src
. Depending on the folder aftersrc
we sent to merchdocs or devdocs.src/configuration/advanced.md
-
{{ site.baseurl}}/path/to/file.md
paths found in source code:{{ site.baseurl }}/guides/v2.2/config-guide/cli/config-cli-subcommands-config-mgmt-set.html
-
{{ page.baseurl }}
paths in source code. Defaults to v2.4:{{page.baseurl}}/javascript-dev-guide/widgets/widget_prompt.html
-
{{ site.mage2bloburl }}
will always default to v2.4:{{ site.mage2bloburl }}/{{page.guide_version}}/lib/internal/Magento/Framework/Setup/UninstallInterface.php
Version 0.4 adds link opening support for the PWA repo on AdobeDocs.
To assist in importing code, a "@magento import" context menu will appear when in the "New Comment" text area in a Github PR page. There are options for devdocs and merchdocs. Selecting this menu, you can add either:
@magento import code to magento-devdocs/devdocs
@magento import code to magento-devdocs/merchdocs
@magento import pr to magento-devdocs/devdocs
@magento import pr to magento-devdocs/merchdocs
to the text area.