Forked from Brett Adams' awesome initial version so I could add a few customizations 😁
Clips current webpage and selection to tana-paste format
The utility grabs the following information for the current tab:
- Page Title
- URL
- Meta tags
- og:description
- og:title
- og:url
- og:type
- og:image
- og:site_name
<any selected text>
The utility then checks the URL (<href.origin>
) to see if the current tab is the root of the site or not. This allows multiple 'web pages' to be tied to a single root 'website' using a Part Of relationship in Tana.
It also determines the 'type' of page by checking the og:type
tag and parsing the URL for a filename or extension, then sets one of the following supertags for the node:
- #article
- #book
- #video
- #document (anything with an extension, other than .html)
- #web-page (default)
- #website (only for the origin site)
Then the information is formatted as a Tana Paste entry and copied to the clipboard.
The basic Tana Paste data copied to the clipboard is the following:
%%tana%%
- Origin site title #website
- Title:: <og:site_name or 'Website at href.origin.hostname'>
- URL:: <href.origin>
- Hostname:: <href.origin.hostname>
- Title of current tab #<supertag>
- Title:: <of current tab>
- URL:: <of current tab>
- Description:: <from site metadata>
- Part Of Website:: [[<Tana reference to origin node above>]]
- Highlights
- <any selected text>
- <line breaks are preserved for multiple lines>
For posterity's sake, if the original meta tag differs from the cleaned up version, both will be included on their own lines. (i.e. - Description:: <cleaned up description>
and - og:Description:: <original unchanged meta tag>
may both be included fields so you can compare them.)
If you just want to use this extension without bothering with the source code and all that jazz, you can download the latest release.zip
file from the Releases
area (right hand side of the github project page). Then, go to the Chrome extension manager (chrome://extensions
) and turn on Developer mode
. This will give you access to the Load unpacked
button and you can pick the downloaded zip file.
To bootstrap this git repo into Chrome locally, first clone the repo.
Then run npm install
and npm run build
.
Go to Chrome extension manager, turn on Developer mode and load unpacked
the dist
directory.
The format used on the clipboard is very simple:
%%tana%%
- Title of site #website
- Description:: <from site metadata>
- Url:: <of open tab>
- <any selected text>
Note that selections in Google Docs and Office365 docs do NOT work. (See issues)
This extension was created with Extension CLI!
If you find this software helpful star or sponsor this project.
Commands | Description |
---|---|
npm run start |
build extension, watch file changes |
npm run build |
generate release version |
npm run docs |
generate source code docs |
npm run clean |
remove temporary files |
npm run test |
run unit tests |
npm run sync |
update config files |
For CLI instructions see User Guide →
Extension Developer guides
- Getting started with extension development
- Manifest configuration: version 2 - version 3
- Permissions reference
- Chrome API reference
Extension Publishing Guides
- Build using
npm run build
for Chrome - Go to Chrome extension manager and
load unpacked
thedist
directory to update extension - Run
xcrun safari-web-extension-converter <path to extension>
in terminal to convert for Safari (or manually copy changes to previously converted XCode project) - Build XCode project