This project is a Chrome extension that allows you to clip web content and save it directly into Obsidian as a Markdown note.
- Clip the main content of any page.
- Convert HTML content to Markdown using the Turndown library.
- Extract and include metadata such as the title, author, publication date, and source URL.
- Generate a safe and compatible filename for Obsidian by removing special characters.
- Clone this repository or download the necessary files.
- Open Chrome and go to
chrome://extensions/
. - Enable
Developer mode
in the top right corner. - Click
Load unpacked
and select the folder containing the extension files.
- Open the web page you want to clip.
- Click on the extension icon in the Chrome toolbar.
- The content will be converted to Markdown and saved in Obsidian.
In the background.js
file, you can specify your vault name (optionnal if you have only one vault) and the folder where the clipped content should be stored (by default, it is stored at root of your vault) :
chrome.action.onClicked.addListener((tab) => {
chrome.scripting.executeScript(
{
target: { tabId: tab.id },
files: ["libs/readability.js", "libs/turndown.js"],
},
() => {
chrome.scripting.executeScript({
target: { tabId: tab.id },
func: clipToObsidian,
args: [{ vault: "your_vault_name", folder: "your_folder_name" }],
});
}
);
});
When the extension icon is clicked, the script executes the following steps:
- Injects the required libraries (
readability.js
andturndown.js
) into the current tab. - Runs a function to extract the main article content.
- Converts the extracted HTML content to Markdown.
- Constructs a Markdown note with the content and metadata (title, author, publication date, and source URL).
- Saves the note in Obsidian.
- Readability.js - Used to extract the main content of a web page.
- Turndown - Used to convert HTML content to Markdown.
Contributions are welcome! If you want to improve this project, please open an issue or submit a pull request.