Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4 Integrates arxiv2notionplus #6

Merged
merged 70 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
155886b
add publish date support
wangjksjtu Apr 15, 2022
f9b4d9c
add commnet support & multi_select for authors to support filters
wangjksjtu Apr 16, 2022
2f896f8
fix small bug
wangjksjtu Apr 16, 2022
fae2cb8
Update README.md
wangjksjtu Apr 16, 2022
dbeddbf
upload nerf example imgs
wangjksjtu Apr 16, 2022
a73d323
update readme for arxiv2notion+
wangjksjtu Apr 16, 2022
4dd6860
update readme
wangjksjtu Apr 16, 2022
9110a22
update
wangjksjtu Apr 16, 2022
2f51fb5
Merge branch 'main' of github.com:wangjksjtu/arxiv2notionplus into main
wangjksjtu Apr 16, 2022
750259f
update
wangjksjtu Apr 16, 2022
16c13e7
Update README.md
wangjksjtu Apr 16, 2022
5c86e5d
Update README.md
wangjksjtu Apr 16, 2022
8780483
add readme for firefox browser
wangjksjtu Apr 16, 2022
3a81b1e
add readme for safari browser
wangjksjtu Apr 16, 2022
76378a4
update readme for safari browser
wangjksjtu Apr 16, 2022
62f44ec
add guidelines for safari
wangjksjtu Apr 16, 2022
228bc38
clean readme
wangjksjtu Apr 16, 2022
a3d4b6a
update
wangjksjtu Apr 16, 2022
b8399ea
upload img
wangjksjtu Apr 16, 2022
a8795b1
update demos
wangjksjtu Apr 16, 2022
a28b0af
clean
wangjksjtu Apr 16, 2022
f74b92a
clean
wangjksjtu Apr 16, 2022
f05adea
Create LICENSE
wangjksjtu Apr 16, 2022
b7bf037
update chrome demo
wangjksjtu Apr 16, 2022
a4ddbfb
Merge branch 'main' of github.com:wangjksjtu/arxiv2notionplus into main
wangjksjtu Apr 16, 2022
e353410
update demos
wangjksjtu Apr 16, 2022
bb16c4e
update
wangjksjtu Apr 16, 2022
e91b7ea
docs: merge README, add contributors
denkiwakame Apr 23, 2022
b5f1c1b
fix: package.json
denkiwakame Apr 23, 2022
f4bbf52
notionplus -> notion
denkiwakame May 22, 2022
c067b05
adjust layout
denkiwakame May 22, 2022
3f0c227
auto-formatter + simplify code
denkiwakame May 22, 2022
b205298
Merge branch 'main' into integrates-arxiv2notionplus
denkiwakame Jan 5, 2024
a5bf82e
wip
denkiwakame Jan 5, 2024
02f0308
wip
denkiwakame Jan 5, 2024
0c616fc
contributing
denkiwakame Jan 5, 2024
0ae4790
adjsut size
denkiwakame Jan 5, 2024
7afa4cc
wip
denkiwakame Jan 5, 2024
541456a
wip
denkiwakame Jan 5, 2024
74f213e
fix configuration by following https://github.com/webpack/webpack-dev…
denkiwakame Jan 5, 2024
12b38e6
add linter check
denkiwakame Jan 5, 2024
0b58ee3
add linter/formatter packages
denkiwakame Jan 5, 2024
26a8e6d
prettier
denkiwakame Jan 5, 2024
e742c03
process err
denkiwakame Jan 6, 2024
da4f97f
update screenshot
denkiwakame Jan 6, 2024
fc947d9
linter
denkiwakame Jan 6, 2024
82de44c
fix
denkiwakame Jan 6, 2024
84da735
add instructions
denkiwakame Jan 6, 2024
6406d19
autoformat
denkiwakame Jan 6, 2024
db6a144
update readme
denkiwakame Jan 6, 2024
a06dc4c
:bug: fix form style
denkiwakame Jan 6, 2024
a855ed6
change formatter role
denkiwakame Jan 6, 2024
2b4b939
test url -> debug flag
denkiwakame Jan 6, 2024
d7787e5
dbg
denkiwakame Jan 6, 2024
a733532
fix odd implementation to camelCase / map function
denkiwakame Jan 6, 2024
796977b
debug mode -> debug URL
denkiwakame Jan 6, 2024
3d0fedc
update contributing.md
denkiwakame Jan 6, 2024
c24419d
rvt
denkiwakame Jan 6, 2024
7bdece1
adjust
denkiwakame Jan 6, 2024
8ff7969
mod attributes
denkiwakame Jan 6, 2024
47dfaef
update gif
denkiwakame Jan 6, 2024
276418a
major version
denkiwakame Jan 6, 2024
2195416
update ui
denkiwakame Jan 6, 2024
7533444
copyright notice
denkiwakame Jan 6, 2024
c4e249b
shrink popup window (maximum size: 600px)
denkiwakame Jan 6, 2024
29fa112
refactor redundant code
denkiwakame Jan 6, 2024
3328843
changelog
denkiwakame Jan 6, 2024
3bbd0b0
update gif
denkiwakame Jan 6, 2024
9c35f54
update readme
denkiwakame Jan 6, 2024
7c9c434
update readme
denkiwakame Jan 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
env:
browser: true
webextensions: true
extends: eslint:recommended
globals:
chrome: true
parserOptions:
ecmaVersion: latest
sourceType: module
rules: {}
26 changes: 26 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: eslint

on:
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14.17.0"
- uses: actions/cache@v3
id: npm_cache_id
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: install
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
- name: eslint
run: npm run lint
- name: prettier
run: npm run format:check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
node_modules/
dist/
5 changes: 5 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
trailingComma: 'es5'
tabWidth: 2
semi: true
singleQuote: true

24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CHANGELOG
All notable changes to this repository will be documented in this file.

## [1.0.0] - 2024-01-08
### Added
- integrates [arxiv2notionplus](https://github.com/wangjksjtu/arxiv2notionplus/issues)(#4)
- add publication date for easier tracking @wangjksjtu
- add comment parser for quick access to the potential project homepage or code link (if available) @wangjksjtu
- Refactor the above codes & fix bugs by @denkiwakame
- CONTRIBUTING.md @denkiwakame
- CHANGELOG.md @denkiwakame
- Linter / Formatter @denkiwakame

### Changed
- Replace the author field from `text` to `multi-select` to fully leverage the search/filter in notion @wangjksjtu
- Release a public notion database/table [here](https://denkiwakame.notion.site/597cdd58bded4375b1cbe073b2ed6f5d?v=63fcbfda57824b239b66e52dde841cdf) @denkiwakame
- Update UI to improve the navigation to the button @denkiwakame

### Fixed
- #7 Migration to Manifest V3 @denkiwakame

## [0.0.1] - 2021-06-07
### Added
- initial release from @denkiwakame
97 changes: 97 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<!-- omit in toc -->
# Contributing to arxiv2notion

First off, thanks for taking the time to contribute! :rainbow:

All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉

> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
> - Star the project
> - <s>Tweet</s>X about it
> - Refer this project in your project's readme

<!-- omit in toc -->
## Table of Contents

- [I Have a Question](#i-have-a-question)
- [I Want To Contribute](#i-want-to-contribute)
- [How to Develop arxiv2notion](#how-to-develop-arxiv2notion)
- [Suggesting Enhancements](#suggesting-enhancements)

## I Have a Question

Before you ask a question, it is best to search for existing [Issues](https://github.com/denkiwakame/arxiv2notion/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.

If you then still feel the need to ask a question and need clarification, we recommend the following:

- Open an [Issue](https://github.com/denkiwakame/arxiv2notion/issues/new).
- Provide as much context as you can about what you're running into.
- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.

We will then take care of the issue as soon as possible.

## I Want To Contribute
### How to Develop arxiv2notion

#### How to build your extension locally

```bash
$ git clone https://github.com/denkiwakame/arxiv2notion.md
$ npm install
$ npm run build
$ npm run watch # debug locally
$ npm run pack # pack to .zip extension
```

#### How to debug your extension
- `$ npm run build` build the extension locally
- navigate to `chrome://extension`
- turn on `developer mode`
- select `load unpacked` and open `arxiv2notion/dist`
- you can see the extension ID like `aedplelmaaaldilfkeobdapccljxxxxx` in the loaded extension description
- open `chrome-extension://aedplelmaaaldilfkeobdapccljxxxxx/popup.html`
- open chrome developer tools in your browser (`Ctrl + Shift + i` w/Linux)
- you can see debugging outputs (\eg `console.log()`) in the devtools.
- once you `load unpacked` , the extension is automatically synced whenever you run `npm run build` and reload `chrome-extension://${your-extension-id}/popup.html`
- you will be able to know more about how everything is working.

![image](https://user-images.githubusercontent.com/1871262/141605730-98917f70-f3cc-4d60-9068-29416474a086.png)

#### Change Notion database scheme
- If you attempt to add a new column like `published date` , you need to add it in your notion.so manually https://github.com/denkiwakame/arxiv2notion#getting-started or via Notion API https://developers.notion.com/reference/update-a-database

#### Get arXiv published date
- To retrieve arXiv paper information, this extension utilizes arXiv public API.
- You can see properties available in the current API https://arxiv.org/help/api/basics
- For example, if you need `published` , you can add some code to obtain the target property.
- https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/popup.js#L112-L124
- `const published = entry.querySelector("published").textContent;`
- The retrieved contents will be posted by this line https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/popup.js#L49
- Thus you need to add properties to https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/popup.js#L127

#### Post to notion.so
- Add property to https://github.com/denkiwakame/arxiv2notion/blob/main/src/js/notion.js#L62-L118
- You may need to follow the Notion API date format. https://developers.notion.com/reference/page#date-property-values

### Suggesting Enhancements

This section guides you through submitting an enhancement suggestion for arxiv2notion, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.

<!-- omit in toc -->
#### Before Submitting an Enhancement

- Make sure that you are using the latest version.
- Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration.
- Perform a [search](https://github.com/denkiwakame/arxiv2notion/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.

<!-- omit in toc -->
#### How Do I Submit a Good Enhancement Suggestion?

Enhancement suggestions are tracked as [GitHub issues](https://github.com/denkiwakame/arxiv2notion/issues).

- Use a **clear and descriptive title** for the issue to identify the suggestion.
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
- **Explain why this enhancement would be useful** to most arxiv2notion users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 denkiwakame
Copyright (c) 2022 denkiwakame

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
86 changes: 54 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
# arxiv2notion
[![build](https://github.com/denkiwakame/arxiv2notion/actions/workflows/build.yaml/badge.svg)](https://github.com/denkiwakame/arxiv2notion/actions/workflows/build.yaml)
[![build](https://github.com/denkiwakame/arxiv2notion/actions/workflows/build.yaml/badge.svg)](https://github.com/denkiwakame/arxiv2notion/actions/workflows/build.yaml) [![lint](https://github.com/denkiwakame/arxiv2notion/actions/workflows/lint.yaml/badge.svg)](https://github.com/denkiwakame/arxiv2notion/actions/workflows/lint.yaml)

Easy-to-use arXiv clipper for [Notion](https://www.notion.so) based on [Notion API](https://developers.notion.com/)

![demo](doc/arxiv2notion.gif)

## ✨ Getting Started
- login to [notion.so](https://www.notion.so) by admin user
- create databases where you save arXiv articles
- **follow this instruction** https://www.notion.so/guides/creating-a-database , do **NOT** create a new database by `/database` !
- **add properties listed below.** `Title` `URL` `Publisher` `Authors` `Abstract`
- note that you should create *extactly the same properties with listed names.*

|property|type|
|-----|-----|
|Title|Title|
|URL|URL|
|Publisher|Select|
|Authors|Text|
|Abstract|Text|

- follow the instruction of [Notion API](https://developers.notion.com/docs/getting-started)
- navigate to [My Integrations](https://www.notion.so/my-integrations)
- `+ New integration`
- associated workspace: select your workspace where you save arXiv articles
- add connection to target databases via `...` > `Add connections` > `arxiv2notion`

![ref1](doc/notion.png)
![notion](doc/nerf_example2.png)

## ⬇️ Installation
- download extension package from https://github.com/denkiwakame/arxiv2notion/releases
Expand All @@ -35,6 +13,16 @@ Easy-to-use arXiv clipper for [Notion](https://www.notion.so) based on [Notion A
- or unzip the extension and `load unpacked` in developer mode

## ⚙️ Setup

### :one: Add arxiv2notion integration
- follow the instruction of [Notion API](https://developers.notion.com/docs/getting-started)
- navigate to [My Integrations](https://www.notion.so/my-integrations)
- `+ New integration`
- **associated workspace:** select your workspace where you save arXiv articles

<img src="doc/my_integration.png" height="200">

### :two: Configure the extension
- right-click on the extension icon > `Options`
- copy **integration id (not the secret token!)** (see figures below) from `https://hwww.notion.so/my-integrations/internal/${integration-id}`
- paste the `integration id` and click on `+` button.
Expand All @@ -46,20 +34,48 @@ arxiv2notion requests API token on-demand via integration ID when you are logged
Note that you must be logged in to notion.so when you use this extension.
```

<img src="doc/integrataion.png" width="450">
<img src="doc/option.png" width="450">
<img src="doc/integration_id.png" height="300"><img src="doc/option.png" height="300">

### :three: Create databases in Notion
#### from template (recommended)
- clone the public template [here](https://denkiwakame.notion.site/597cdd58bded4375b1cbe073b2ed6f5d?v=63fcbfda57824b239b66e52dde841cdf) to your own notion workspace
- add connection to target databases via `...` > `+ Add connections` > `arxiv2notion`

![invite_integration](doc/connection.png)

- you can switch multiple DBs by adding the connection to these pages, respectively.

![multiple_db](doc/multiple_db.png)


#### or manually
- alternatively, you can follow the following steps to create database from scratch in notion
- login to [notion.so](https://www.notion.so) by admin user
- create databases where you save arXiv articles
- **follow this instruction** https://www.notion.so/guides/creating-a-database , do **NOT** create a new database by `/database` !
- **add properties listed below.**
- note that you should create **extactly the same properties with listed names.**

|property|type|
|-----|-----|
|Title|Title|
|URL|URL|
|Authors|Multi-Select|
|Abstract|Text|
|Published|Date|
|Comments|URL|
|Publisher|Select|

### 💡 Working with Notion AI Property
### :bulb: Working with Notion AI Property (optional)
- [Notion AI Property](https://www.notion.so/ja-jp/help/guides/5-ai-prompts-to-surface-fresh-insights-from-your-databases) allows you to add **custom autofill property** to each DB record.
- Add column to your Notion DB and select `AI custom autofill`
![image](https://github.com/denkiwakame/arxiv2notion/assets/1871262/b1a6149a-cf55-41f8-9e83-4578a64530e6)
- Set any prompt you like (e.g. summarization, extracting key ideas ...)
<img src="https://github.com/denkiwakame/arxiv2notion/assets/1871262/8b30bd04-ffc3-4525-b684-90f8b62dda92" width="300">
- Set any prompt you like (e.g. summarization, extracting key ideas ...)
<img src="https://github.com/denkiwakame/arxiv2notion/assets/1871262/b1a6149a-cf55-41f8-9e83-4578a64530e6" height="200"><img src="https://github.com/denkiwakame/arxiv2notion/assets/1871262/8b30bd04-ffc3-4525-b684-90f8b62dda92" height="200">
- Save an article via `arxiv2notion` ,and then the preset `AI property` will be automatically generated.
![image](https://github.com/denkiwakame/arxiv2notion/assets/1871262/ad698cf0-dce0-4b29-8511-47f4c796a694)


## 👨‍💻 Build locally (for Developers)
## :technologist: Build locally (for Developers)
- See also [CONTRIBUTING.md](CONTRIBUTING.md)

```bash
$ git clone https://github.com/denkiwakame/arxiv2notion.git
Expand All @@ -68,3 +84,9 @@ $ npm run build
$ npm run watch # debug locally
$ npm run pack # packaging to zip
```

## Contributors
- Maintainers: @denkiwakame, @wangjksjtu
<a href="https://github.com/denkiwakame/arxiv2notion/graphs/contributors">
<img src="https://contrib.rocks/image?repo=denkiwakame/arxiv2notion" />
</a>
Binary file modified doc/arxiv2notion.gif
100644 → 100755
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 doc/arxiv2notionplus_db.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 doc/connection.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 removed doc/integrataion.png
Binary file not shown.
Binary file added doc/integration_id.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 doc/multiple_db.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 doc/my_integration.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 doc/nerf_example1.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 doc/nerf_example2.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 removed doc/notion.png
Binary file not shown.
Binary file modified doc/option.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "arxiv2notion",
"description": "easy-to-use arXiv clipper for notion.so",
"version": "0.0.2",
"version": "0.1.0",
"icons": {
"128": "icon128.png"
},
Expand Down
Loading
Loading