Skip to content

Commit

Permalink
chore: prepare initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
florian42 committed Jan 21, 2023
1 parent 90d67db commit 501ee19
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 26 deletions.
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# <img src="public/icons/icon_48.png" width="45" align="left"> Obsidian Clipper

> Obsidian Web Clipper Chrome Extension to save articles and pages from the web in Obsidian
> The "Obsidian Clipper" Chrome extension allows you to easily save articles from the web as notes in your Obsidian vault.
## Features
## Description

- Feature 1
- Feature 2
The extension utilizes Readability.js to extract the content of the article, as well as important metadata such as the domain, title, timestamp, excerpt, and word count. This allows you to easily organize and access your saved articles within your Obsidian vault. The extension is simple and easy to use, with a one-click saving feature that quickly adds the article to the your vault.
This is a great tool for researchers, students, and anyone who wants to save and organize articles for later reading and reference.

## Screenshots
![gif showing the whole workflow from a website to saved article](./images/Demo.gif)
![screenshot displaying various options for configuration](./images/Options.png)
![screenshot of the saved article in Obsidian](./images/Result.png)

## Install

Expand All @@ -15,7 +20,30 @@

Suggestions and pull requests are welcomed!.

### Available Scripts
- npm run watch
- Listens for files changes and rebuilds automatically.
- npm run build
- Bundles the app into static files for Chrome store.
- npm run format
- Formats all the files.
- npm run test
- Runs unit tests

### Workflow
1. cd obsidian-clipper
2. Run npm run watch
3. Open chrome://extensions
4. Check the Developer mode checkbox
5. Click on the Load unpacked extension button
6. Select the folder obsidian-clipper/build

---

This project was bootstrapped with [Chrome Extension CLI](https://github.com/dutiyesh/chrome-extension-cli)

### Attribution

This is adopted and adjusted by https://gist.github.com/kepano/90c05f162c37cf730abb8ff027987ca3 and packaged as a Chrome extensions for convenience.

<a target="_blank" href="https://icons8.com/icon/0eNM6EFToRF2/obsidian">Obsidian</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a>
19 changes: 0 additions & 19 deletions TUTORIAL.txt

This file was deleted.

Binary file added images/Demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ export const STORAGE_KEYS = {

export type Keys = typeof STORAGE_KEYS[keyof typeof STORAGE_KEYS]

function sanitizeInput(input: string) {
return input.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
}

function save_options() {
const vault = (document.getElementById('vault') as HTMLInputElement).value;
const folder = (document.getElementById('folder') as HTMLInputElement).value;
const tag = (document.getElementById('tag') as HTMLInputElement).value;

chrome.storage.sync.set(
{
[STORAGE_KEYS.VAULT_NAME]: vault,
[STORAGE_KEYS.FOLDER]: folder,
[STORAGE_KEYS.TAG]: tag,
[STORAGE_KEYS.VAULT_NAME]: sanitizeInput(vault),
[STORAGE_KEYS.FOLDER]: sanitizeInput(folder),
[STORAGE_KEYS.TAG]: sanitizeInput(tag),
},
() => {
// Update status to let user know options were saved.
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"rootDir": "src",
"target": "es6",
"module": "commonjs",
"esModuleInterop": true,
Expand Down

0 comments on commit 501ee19

Please sign in to comment.