begin work, day 1: cli + removal script
2
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
@ -6,7 +5,6 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.vscode
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
85
CHANGELOG.md
@ -1,85 +0,0 @@
|
||||
# changelog
|
||||
|
||||
if something is ~~crossed out~~, then it is no longer a feature included by default,
|
||||
but can still easily be enabled by following instructions in the [docs](README.md).
|
||||
|
||||
### v0.7.0 (2020-07-09)
|
||||
|
||||
- new: tray option to use system default emojis (instead of twitter's emojiset).
|
||||
- new: mac support (identical functionality to others platforms with the
|
||||
exception of the native minimise/maximise/close buttons being kept, as they integrate
|
||||
better with the OS while not being out-of-place in notion).
|
||||
- new: notion-deb-builder support for linux.
|
||||
- improved: replaced button symbols with svgs for multi-platform support.
|
||||
- improved: window close button is now red on hover (thanks to [@torchatlas](https://github.com/torchatlas)).
|
||||
- bugfix: `cleaner.py` patched for linux.
|
||||
- bugfix: tray now operates as expected on linux.
|
||||
- bugfix: odd mix of `\\` and `/` being used for windows filepaths.
|
||||
- bugfix: app no longer crashes when sidebar is toggled.
|
||||
|
||||
### v0.6.0 (2020-06-30)
|
||||
|
||||
- style: custom fonts.
|
||||
- style: font resizing.
|
||||
- style: hide discussions (thanks to [u/Roosmaryn](https://www.reddit.com/user/Roosmaryn/)).
|
||||
- new: custom colour theming, demonstrated via the dark+ theme.
|
||||
- new: linux support (thanks to [@Blacksuan19](https://github.com/Blacksuan19)).
|
||||
- improved: if hotkey is pressed while notion is unfocused, it will bring it to the front rather than hiding it.
|
||||
- improved: stop window buttons breaking at smaller widths.
|
||||
- improved: more obviously visible drag area.
|
||||
- bugfix: specify UTF-8 encoding to prevent multibyte/gbk codec errors (thanks to [@etnperlong](https://github.com/etnperlong)).
|
||||
|
||||
> 📥 [notion-enhancer.v0.6.0.zip](https://github.com/dragonwocky/notion-enhancer/archive/v0.6.0.zip)
|
||||
|
||||
### v0.5.0 (2020-05-23)
|
||||
|
||||
- new: running from the wsl.
|
||||
- new: reload window with f5.
|
||||
- improved: code has been refactored and cleaned up,
|
||||
inc. file renaming and a `customiser.py` that doesn't require
|
||||
a run of `cleaner.py` to build modifications.
|
||||
improved: scrollbar colours that fit better with notion's theming.
|
||||
- bugfix: un-break having multiple notion windows open.
|
||||
|
||||
> 📥 [notion-enhancer.v0.5.0.zip](https://github.com/dragonwocky/notion-enhancer/archive/v0.5.0.zip)
|
||||
|
||||
_(forked by [@dragonwocky](https://github.com/dragonwocky).)_
|
||||
|
||||
### v0.4.1 (2020-02-13)
|
||||
|
||||
- bugfix: wider table & the "+" button not working in database pages.
|
||||
|
||||
> 📥 [notion-enhancer.v4.1.zip](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d239a3cf-d553-4ef3-ab04-8b47892d9f9a/Notion_Customization_v4.1.zip)
|
||||
|
||||
### v0.4.0
|
||||
|
||||
- new: tray icon.
|
||||
- new: app startup options (+ saving).
|
||||
- new: `Reset.py`
|
||||
- improved: better output from `Customization Patcher.py`.
|
||||
- bugfix: wider tables in "short page" mode.
|
||||
- bugfix: unclickable buttons/draggable area (of titlebar).
|
||||
|
||||
### v0.3.0
|
||||
|
||||
- new: show/hide window hotkey.
|
||||
- new: app startup options.
|
||||
- ~~style: smaller table icons.~~
|
||||
|
||||
> 📥 [notion-enhancer.v3.zip](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b01aa446-5727-476a-a25e-395472bfb1be/NotionScriptsV3.zip)
|
||||
|
||||
### v0.2.0
|
||||
|
||||
- new: light/dark theme support for window control buttons + scrollbars.
|
||||
- new: custom styles directly linked to the enhancer resources + compatible with web version.
|
||||
- ~~improved: making table column width go below 100px.~~
|
||||
|
||||
### v0.1.0
|
||||
|
||||
- new: custom window control buttons.
|
||||
- removed: default titlebar/menubar.
|
||||
- ~~removed: huge padding of board view.~~
|
||||
- ~~removed: huge padding of table view.~~
|
||||
- ~~optional: making table column width go below 100px.~~
|
||||
- ~~style: thinner cover image + higher content block.~~
|
||||
- style: scrollbars.
|
22
LICENSE
@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 TarasokUA
|
||||
Copyright (c) 2020 dragonwocky
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
14
Pipfile
@ -1,14 +0,0 @@
|
||||
[[source]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
|
||||
[dev-packages]
|
||||
pylint = "*"
|
||||
autopep8 = "*"
|
||||
|
||||
[packages]
|
||||
pyasar = "*"
|
||||
|
||||
[requires]
|
||||
python_version = "3.6"
|
150
Pipfile.lock
generated
@ -1,150 +0,0 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "1acd8226b318eb2516f81421b7f90e7c81f2119805d658a5a958e0699a1358d6"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
"python_version": "3.6"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"name": "pypi",
|
||||
"url": "https://pypi.org/simple",
|
||||
"verify_ssl": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"default": {
|
||||
"pyasar": {
|
||||
"hashes": [
|
||||
"sha256:f96b322ea5c450d129dbe6990e5ba827d1d070e818822c408abffa44058f7f08"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.0.8"
|
||||
}
|
||||
},
|
||||
"develop": {
|
||||
"astroid": {
|
||||
"hashes": [
|
||||
"sha256:2f4078c2a41bf377eea06d71c9d2ba4eb8f6b1af2135bec27bbbb7d8f12bb703",
|
||||
"sha256:bc58d83eb610252fd8de6363e39d4f1d0619c894b0ed24603b881c02e64c7386"
|
||||
],
|
||||
"markers": "python_version >= '3.5'",
|
||||
"version": "==2.4.2"
|
||||
},
|
||||
"autopep8": {
|
||||
"hashes": [
|
||||
"sha256:60fd8c4341bab59963dafd5d2a566e94f547e660b9b396f772afe67d8481dbf0"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.5.3"
|
||||
},
|
||||
"isort": {
|
||||
"hashes": [
|
||||
"sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1",
|
||||
"sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"version": "==4.3.21"
|
||||
},
|
||||
"lazy-object-proxy": {
|
||||
"hashes": [
|
||||
"sha256:0c4b206227a8097f05c4dbdd323c50edf81f15db3b8dc064d08c62d37e1a504d",
|
||||
"sha256:194d092e6f246b906e8f70884e620e459fc54db3259e60cf69a4d66c3fda3449",
|
||||
"sha256:1be7e4c9f96948003609aa6c974ae59830a6baecc5376c25c92d7d697e684c08",
|
||||
"sha256:4677f594e474c91da97f489fea5b7daa17b5517190899cf213697e48d3902f5a",
|
||||
"sha256:48dab84ebd4831077b150572aec802f303117c8cc5c871e182447281ebf3ac50",
|
||||
"sha256:5541cada25cd173702dbd99f8e22434105456314462326f06dba3e180f203dfd",
|
||||
"sha256:59f79fef100b09564bc2df42ea2d8d21a64fdcda64979c0fa3db7bdaabaf6239",
|
||||
"sha256:8d859b89baf8ef7f8bc6b00aa20316483d67f0b1cbf422f5b4dc56701c8f2ffb",
|
||||
"sha256:9254f4358b9b541e3441b007a0ea0764b9d056afdeafc1a5569eee1cc6c1b9ea",
|
||||
"sha256:9651375199045a358eb6741df3e02a651e0330be090b3bc79f6d0de31a80ec3e",
|
||||
"sha256:97bb5884f6f1cdce0099f86b907aa41c970c3c672ac8b9c8352789e103cf3156",
|
||||
"sha256:9b15f3f4c0f35727d3a0fba4b770b3c4ebbb1fa907dbcc046a1d2799f3edd142",
|
||||
"sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442",
|
||||
"sha256:a6ae12d08c0bf9909ce12385803a543bfe99b95fe01e752536a60af2b7797c62",
|
||||
"sha256:ca0a928a3ddbc5725be2dd1cf895ec0a254798915fb3a36af0964a0a4149e3db",
|
||||
"sha256:cb2c7c57005a6804ab66f106ceb8482da55f5314b7fcb06551db1edae4ad1531",
|
||||
"sha256:d74bb8693bf9cf75ac3b47a54d716bbb1a92648d5f781fc799347cfc95952383",
|
||||
"sha256:d945239a5639b3ff35b70a88c5f2f491913eb94871780ebfabb2568bd58afc5a",
|
||||
"sha256:eba7011090323c1dadf18b3b689845fd96a61ba0a1dfbd7f24b921398affc357",
|
||||
"sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4",
|
||||
"sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"version": "==1.4.3"
|
||||
},
|
||||
"mccabe": {
|
||||
"hashes": [
|
||||
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
|
||||
"sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
|
||||
],
|
||||
"version": "==0.6.1"
|
||||
},
|
||||
"pycodestyle": {
|
||||
"hashes": [
|
||||
"sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367",
|
||||
"sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"version": "==2.6.0"
|
||||
},
|
||||
"pylint": {
|
||||
"hashes": [
|
||||
"sha256:7dd78437f2d8d019717dbf287772d0b2dbdfd13fc016aa7faa08d67bccc46adc",
|
||||
"sha256:d0ece7d223fe422088b0e8f13fa0a1e8eb745ebffcb8ed53d3e95394b6101a1c"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==2.5.3"
|
||||
},
|
||||
"six": {
|
||||
"hashes": [
|
||||
"sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259",
|
||||
"sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"version": "==1.15.0"
|
||||
},
|
||||
"toml": {
|
||||
"hashes": [
|
||||
"sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f",
|
||||
"sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88"
|
||||
],
|
||||
"version": "==0.10.1"
|
||||
},
|
||||
"typed-ast": {
|
||||
"hashes": [
|
||||
"sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355",
|
||||
"sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919",
|
||||
"sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa",
|
||||
"sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652",
|
||||
"sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75",
|
||||
"sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01",
|
||||
"sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d",
|
||||
"sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1",
|
||||
"sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907",
|
||||
"sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c",
|
||||
"sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3",
|
||||
"sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b",
|
||||
"sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614",
|
||||
"sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb",
|
||||
"sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b",
|
||||
"sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41",
|
||||
"sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6",
|
||||
"sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34",
|
||||
"sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe",
|
||||
"sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4",
|
||||
"sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"
|
||||
],
|
||||
"markers": "python_version < '3.8' and implementation_name == 'cpython'",
|
||||
"version": "==1.4.1"
|
||||
},
|
||||
"wrapt": {
|
||||
"hashes": [
|
||||
"sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"
|
||||
],
|
||||
"version": "==1.12.1"
|
||||
}
|
||||
}
|
||||
}
|
140
README.md
@ -1,140 +0,0 @@
|
||||
# notion enhancer
|
||||
|
||||
an enhancer/customiser for the all-in-one productivity workspace [notion.so](https://www.notion.so/)
|
||||
|
||||
## supported clients
|
||||
|
||||
there are a lot of ways to use notion. some official clients, many not.
|
||||
|
||||
the enhancer supports:
|
||||
|
||||
- the [official windows/mac releases](https://notion.so/desktop).
|
||||
- the arch linux AUR [notion-app](https://aur.archlinux.org/packages/notion-app/) package
|
||||
- the linux [notion-app](https://github.com/jaredallard/notion-app) installer
|
||||
- the debian [notion-deb-builder](https://github.com/davidbailey00/notion-deb-builder/tree/229f2868e117e81858618783b83babd00c595000).
|
||||
|
||||
there are others, yes. the enhancer does not support them. you should not expect them to work.
|
||||
if for some reason you need to use one of them instead of the above listed ones, open a
|
||||
[platform support](https://github.com/dragonwocky/notion-enhancer/issues/new?assignees=&labels=enhancement&template=platform-support.md&title=) request.
|
||||
|
||||
please do not modify the enhancer code specifically to work for your installation.
|
||||
if you have the know-how to do so, instead open a pull request with your changes
|
||||
so that proper support can be added for all users of that client.
|
||||
|
||||
mobile clients are not supported and due to system limitations/restrictions cannot be.
|
||||
|
||||
(the [styles](#styling) should also work for the web version.
|
||||
these can be installed via an extension like [stylus](https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne?hl=en)
|
||||
or a built-in feature like [userChrome.css](https://www.userchrome.org/).)
|
||||
|
||||
if the script is run from the WSL, it will enhance the windows version of the app.
|
||||
|
||||
## installation
|
||||
|
||||
1. install node.js: [windows/macOS](https://nodejs.org/en/download/), [linux/WSL](https://github.com/mklement0/n-install).
|
||||
2. install python: [windows/macOS](https://www.python.org/downloads/), [linux/WSL](https://docs.python-guide.org/starting/install3/linux/).
|
||||
3. reboot.
|
||||
4. in the appropriate terminal/command line, run `npm install -g asar` (check installation by running `asar`).
|
||||
5. [download this enhancer](https://github.com/dragonwocky/notion-enhancer/archive/master.zip) & extract
|
||||
to a location it can safely remain (if running the script from the WSL, make sure this is from a location within the windows filesystem).
|
||||
6. ensure no notion processes are running - you may want to check the task manager to make sure.
|
||||
7. optional: to remove previous applications of the notion enhancer, run `cleaner.py`.
|
||||
8. optional: modify the `resources/user.css` file to your liking (see [styling](#styling)).
|
||||
9. run `customiser.py` to build changes. (for linux run with sudo)
|
||||
|
||||
done: run notion and enjoy.
|
||||
|
||||
## faq
|
||||
|
||||
**now the notion app won't open :(**
|
||||
|
||||
1. kill any notion tasks in the task manager (`ctrl+shift+esc`).
|
||||
2. run `cleaner.py`.
|
||||
3. reboot.
|
||||
4. follow instructions above (ensuring notion _isn't_ running! again, check task manager).
|
||||
|
||||
**i tried opening the python file but it just closed instantly and nothing happened?**
|
||||
|
||||
python scripts must be run from the terminal or command prompt via e.g. `python customiser.py`.
|
||||
|
||||
**now that I've run the script, can I delete the enhancer folder?**
|
||||
|
||||
no! user style files `resources/user.css` and `resources/theme.css` are fetched from here each time you open notion.
|
||||
additionally, if you ever need to change or reset your notion build, the `customiser.py` and `cleaner.py` files will be useful.
|
||||
|
||||
unless you're sure you know what you're doing (if you have to ask, you probably don't) then do not delete anything.
|
||||
|
||||
**something isn't working, and the suggestions here haven't fixed it...**
|
||||
|
||||
this is probably a bug. please submit a
|
||||
[bug report](https://github.com/dragonwocky/notion-enhancer/issues/new?assignees=&labels=bug&template=bug-report.md&title=).
|
||||
|
||||
**can the enhancer do \_\_\_?**
|
||||
|
||||
experienced problems with the notion app, or just want to add something a bit more to it? please submit a
|
||||
[feature request](https://github.com/dragonwocky/notion-enhancer/issues/new?assignees=&labels=enhancement&template=feature-request.md&title=).
|
||||
|
||||
## features
|
||||
|
||||
### titlebar
|
||||
|
||||
default windows titlebar/frame has been replaced by one more fitting to the theme of the app.
|
||||
|
||||
this includes the addition of an extra button, "always on top"
|
||||
symbolised with an arrow. when toggled to point up,
|
||||
notion will remain the top visible window even if not focused.
|
||||
|
||||
### nicer scrollbars
|
||||
|
||||
i mean, yeah. get rid of those ugly default scrollbars and use nice inconspicuous
|
||||
ones that actually look as if they're part of notion.
|
||||
|
||||
to add these to the web version, copy lines 74 - 105 from `user.css` into your css customiser.
|
||||
|
||||

|
||||
_image: before enhancement_
|
||||
|
||||

|
||||
_image: after default enhancement_
|
||||
|
||||
### hotkeys
|
||||
|
||||
- **reload window**: in addition to the built-in `CmdOrCtrl+R` reload,
|
||||
you can now reload a window with `F5`.
|
||||
- **toggle all notion windows to/from the tray**: `CmdOrCtrl+Shift+A` by default.
|
||||
|
||||
to set your own toggle hotkey, open `customiser.py` and change line 19 (`hotkey = 'CmdOrCtrl+Shift+A'`)
|
||||
to your preference. you will need to run or re-run `customiser.py` afterwards.
|
||||
|
||||
### tray
|
||||
|
||||
single-click to toggle app visibility. right click to open menu.
|
||||
|
||||
- **run on startup**: run notion on boot/startup. (default: true)
|
||||
- **hide on open**: hide the launch of notion to the tray. (default: false)
|
||||
- **open maximised**: maximize the app on open. (default: false)
|
||||
- **close to tray**: close window to tray rather than closing outright
|
||||
on click of `⨉`. does not apply if multiple notion windows are open. (default: false)
|
||||
- **load theme.css**: loads the custom colour theme file.
|
||||
see [colour theming](STYLING.md#colour-theming) for more information. (default: false)
|
||||
- **use system emoji**: reverts notion to using normal emojis, rather than the twitter emojiset. (default: false)
|
||||
|
||||

|
||||
|
||||
_image: open application tray_
|
||||
|
||||
## styling
|
||||
|
||||
custom appearances can be applied to the app via the `resources/user.css` and `resources/theme.css` files. for more information,
|
||||
and a list of various optional styling changes, see [the page on styling](STYLING.md).
|
||||
|
||||
## other details
|
||||
|
||||
credit where credit is due, this was originally made by Uzver (github: [@TarasokUA](https://github.com/TarasokUA),
|
||||
telegram: [UserFromUkraine](https://t.me/UserFromUkraine), discord: Uzver#8760).
|
||||
he has approved my go-ahead with this fork, as he himself no longer wishes to continue development on the project.
|
||||
|
||||
the notion logo belongs entirely to the notion team, and was sourced from their
|
||||
[media kit](https://www.notion.so/Media-Kit-205535b1d9c4440497a3d7a2ac096286).
|
||||
|
||||
if you have any questions, check [my website](https://dragonwocky.me/) for contact details.
|
333
STYLING.md
@ -1,333 +0,0 @@
|
||||
# styling
|
||||
|
||||
to modify the appearance of the notion app, edit the style rules in `resources/user.css`,
|
||||
use some of the suggested/documented optional styles below, or invent your own.
|
||||
|
||||
these styles are written in a language called "CSS". if you don't know what this is and are interested,
|
||||
check out some youtube videos or [try a free short course like the one on codecademy](https://www.codecademy.com/learn/learn-css).
|
||||
|
||||
due to the enhancements directly fetching from the local CSS files,
|
||||
changes will be applied instantly on notion reload
|
||||
(no need to re-run `customiser.py` every time you want to change some styles).
|
||||
|
||||
these should also work for the web version, if copied into your css customiser.
|
||||
|
||||
css below will work for every instance of the element, but if you wish to hide only a specific element
|
||||
(e.g. the '+ new' table row) it is recommended that you prepend each selector with
|
||||
`[data-block-id='ID']`.
|
||||
|
||||
## general/app-wide
|
||||
|
||||

|
||||
|
||||
_image: the default post-customisation appearance_
|
||||
|
||||
### colour theming
|
||||
|
||||
this replaces the default notion dark theme. the provided theme file is my custom dark+ theme:
|
||||
if you have another you wish to share, please contact me. if a few themes are submitted i will
|
||||
set up a distribution method (either including them as optionally-enableabled themes or sharing them on the website).
|
||||
|
||||
to enable, see the [tray](README.md#tray) options.
|
||||
|
||||
to modify, enter the `theme.css` file and change the colour values within the `:root {}` - value names
|
||||
should describe what each colour will affect.
|
||||
|
||||

|
||||
|
||||
_image: the dark+ theme_
|
||||
|
||||
### hide discussions (comment threads at the top of each page)
|
||||
|
||||
```css
|
||||
.notion-page-view-discussion {
|
||||
display: none !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: before styling_
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### custom fonts
|
||||
|
||||
**the `@import` statement must be added to the top of the file (with nothing above it**
|
||||
**except comments or other `@import` statements)**
|
||||
|
||||
to change the fonts, put the relevant URL in the `@import` statement and then change the [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) property.
|
||||
plenty of other fonts that can be found on google fonts or that may be on your system already.
|
||||
|
||||
```css
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fira+Code&family=Oxygen&family=Roboto+Slab:wght@300&display=swap');
|
||||
.notion-app-inner {
|
||||
font-family: 'Oxygen', sans-serif !important;
|
||||
}
|
||||
[style*='monospace;'] {
|
||||
font-family: 'Fira Code', monospace !important;
|
||||
}
|
||||
[style*=', serif;'] {
|
||||
font-family: 'Roboto Slab', serif !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### font resizing
|
||||
|
||||
**not recommended:** this can mess up container sizes.
|
||||
it is suggested to instead use `ctrl+` or `ctrl-` to scale everything up/down.
|
||||
|
||||
to change the size, change the value of `--font-scale`.
|
||||
|
||||
```css
|
||||
:root {
|
||||
--font-scale: 1.4;
|
||||
}
|
||||
.notion-app-inner {
|
||||
font-size: calc(var(--font-scale) * 16px) !important;
|
||||
}
|
||||
[style*='font-size: 40px'] {
|
||||
font-size: calc(var(--font-scale) * 40px) !important;
|
||||
}
|
||||
[style*='font-size: 16px'] {
|
||||
font-size: calc(var(--font-scale) * 16px) !important;
|
||||
}
|
||||
[style*='font-size: 14px'] {
|
||||
font-size: calc(var(--font-scale) * 14px) !important;
|
||||
}
|
||||
[style*='font-size: 12px'] {
|
||||
font-size: calc(var(--font-scale) * 12px) !important;
|
||||
}
|
||||
[style*='font-size: 11px'] {
|
||||
font-size: calc(var(--font-scale) * 11px) !important;
|
||||
}
|
||||
[style*='font-size: 1.25em'] {
|
||||
font-size: calc(var(--font-scale) * 1.25em) !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### wider page preview
|
||||
|
||||
```css
|
||||
.notion-peek-renderer > div:nth-child(2) {
|
||||
max-width: 85vw !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: before styling_
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### thinner cover image
|
||||
|
||||
```css
|
||||
[style^='position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; height: 30vh;'] {
|
||||
height: 12vh !important;
|
||||
}
|
||||
[style^='position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; height: 30vh;']
|
||||
img {
|
||||
height: 12vh !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: before styling_
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
## tables
|
||||
|
||||

|
||||
|
||||
_image: before styling_
|
||||
|
||||
### table columns below 100px
|
||||
|
||||
**not recommended!** this may cause buggy viewing.
|
||||
as it is a per-table-column style, unlike all others here, it must be prepended with the block ID and repeated for each column.
|
||||
|
||||
to see how to do this, watch [this video](https://www.youtube.com/watch?v=6V7eqShm_4w).
|
||||
|
||||
```css
|
||||
[data-block-id^='tableID']
|
||||
> [style^='display: flex; position: absolute; background: rgb(47, 52, 55); z-index: 82; height: 33px; color: rgba(255, 255, 255, 0.6);']
|
||||
> div:nth-child(1)
|
||||
> div:nth-child(COL_NUMBER)
|
||||
> div:nth-child(1),
|
||||
[data-block-id^='tableID']
|
||||
> [style^='position: relative; min-width: calc(100% - 192px);']
|
||||
> [data-block-id]
|
||||
> div:nth-child(COL_NUMBER),
|
||||
[data-block-id^='tableID'] > div:nth-child(5) > div:nth-child(COL_NUMBER) {
|
||||
width: 32px !important;
|
||||
}
|
||||
[data-block-id^='tableID']
|
||||
[style^='position: absolute; top: 0px; left: 0px; pointer-events: none;']:not(.notion-presence-container) {
|
||||
display: none;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### hide '+ new' table row
|
||||
|
||||
```css
|
||||
.notion-table-view-add-row {
|
||||
display: none !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### hide calculations table row
|
||||
|
||||
```css
|
||||
.notion-table-view-add-row + div {
|
||||
display: none !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### centre-align table column headers
|
||||
|
||||
```css
|
||||
.notion-table-view-header-cell > div > div {
|
||||
margin: 0px auto;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### smaller table column header icons
|
||||
|
||||
```css
|
||||
[style^='display: flex; position: absolute; background: rgb(47, 52, 55); z-index: 82; height: 33px; color: rgba(255, 255, 255, 0.6);']
|
||||
div:nth-child(1)
|
||||
svg {
|
||||
height: 10px !important;
|
||||
width: 10px !important;
|
||||
margin-right: -4px;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### remove icons from table column headers
|
||||
|
||||
```css
|
||||
.notion-table-view-header-cell [style^='margin-right: 6px;'] {
|
||||
display: none !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### removing/decreasing side padding for tables
|
||||
|
||||
```css
|
||||
[style^='flex-shrink: 0; flex-grow: 1; width: 100%; max-width: 100%; display: flex; align-items: center; flex-direction: column; font-size: 16px; color: rgba(255, 255, 255, 0.9); padding: 0px 96px 30vh;']
|
||||
.notion-table-view,
|
||||
[class='notion-scroller'] > .notion-table-view {
|
||||
padding-left: 35px !important;
|
||||
padding-right: 15px !important;
|
||||
min-width: 0% !important;
|
||||
}
|
||||
[style^='flex-shrink: 0; flex-grow: 1; width: 100%; max-width: 100%; display: flex; align-items: center; flex-direction: column; font-size: 16px; color: rgba(255, 255, 255, 0.9); padding: 0px 96px 30vh;']
|
||||
.notion-selectable
|
||||
.notion-scroller.horizontal::-webkit-scrollbar-track {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
## boards
|
||||
|
||||

|
||||
|
||||
_image: before styling_
|
||||
|
||||
### hide '+ new' board row
|
||||
|
||||
```css
|
||||
.notion-board-group
|
||||
[style='user-select: none; transition: background 120ms ease-in 0s; cursor: pointer; display: inline-flex; align-items: center; flex-shrink: 0; white-space: nowrap; height: 32px; border-radius: 3px; font-size: 14px; line-height: 1.2; min-width: 0px; padding-left: 6px; padding-right: 8px; color: rgba(255, 255, 255, 0.4); width: 100%;'] {
|
||||
display: none !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### hide board view hidden columns
|
||||
|
||||
```css
|
||||
.notion-board-view > [data-block-id] > div:nth-last-child(2),
|
||||
.notion-board-view > [data-block-id] > div:first-child > div:nth-last-child(2) {
|
||||
display: none !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### hide board view 'add a group'
|
||||
|
||||
```css
|
||||
.notion-board-view > [data-block-id] > div:last-child,
|
||||
.notion-board-view > [data-block-id] > div:first-child > div:last-child {
|
||||
display: none !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
||||
|
||||
### removing/decreasing side padding for boards
|
||||
|
||||
```css
|
||||
.notion-board-view {
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
_image: after styling_
|
75
cleaner.py
@ -1,75 +0,0 @@
|
||||
|
||||
# notion-enhancer
|
||||
# (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
# (c) 2020 TarasokUA
|
||||
# (https://dragonwocky.me/) under the MIT license
|
||||
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
import subprocess
|
||||
from shutil import rmtree
|
||||
from time import sleep
|
||||
|
||||
# f'{bold}=== title ==={normal}' = headers
|
||||
# '*' = information
|
||||
# '...' = actions
|
||||
# '###' = warnings
|
||||
# '>' = exit
|
||||
|
||||
bold = '\033[1m'
|
||||
normal = '\033[0m'
|
||||
|
||||
print(f'{bold}=== NOTION ENHANCER CLEANING LOG ==={normal}\n')
|
||||
try:
|
||||
filepath = ''
|
||||
if 'microsoft' in platform.uname()[3].lower() and sys.platform == 'linux':
|
||||
filepath = '/mnt/c/' + \
|
||||
subprocess.run(
|
||||
['cmd.exe', '/c', 'echo', '%localappdata%'], stdout=subprocess.PIPE).stdout \
|
||||
.rstrip().decode('utf-8')[3:].replace('\\', '/') + '/Programs/Notion/resources'
|
||||
elif sys.platform == 'win32':
|
||||
filepath = subprocess.run(['echo', '%localappdata%'], shell=True, capture_output=True).stdout \
|
||||
.rstrip().decode('utf-8') + '\\Programs\\Notion\\resources'
|
||||
elif sys.platform == 'linux':
|
||||
filepath = '/opt/notion-app' if os.path.exists(
|
||||
'/opt/notion-app') else '/opt/notion'
|
||||
elif sys.platform == 'darwin':
|
||||
filepath = '/Applications/Notion.app/Contents/Resources'
|
||||
else:
|
||||
print(' > script not compatible with your os!\n (report this to dragonwocky#8449 on discord)')
|
||||
exit()
|
||||
|
||||
if os.path.exists(os.path.join(filepath, 'app')):
|
||||
print(
|
||||
f' ...removing folder {os.path.join(filepath, "app")}')
|
||||
rmtree(os.path.join(filepath, 'app'))
|
||||
else:
|
||||
print(
|
||||
f' * {os.path.join(filepath, "app")} was not found: step skipped.')
|
||||
|
||||
if os.path.isfile(os.path.join(filepath, 'app.asar.bak')):
|
||||
print(' ...renaming asar.app.bak to asar.app')
|
||||
os.rename(os.path.join(filepath, 'app.asar.bak'),
|
||||
os.path.join(filepath, 'app.asar'))
|
||||
else:
|
||||
print(
|
||||
f' * {os.path.join(filepath, "app.asar.bak")} was not found: step skipped.')
|
||||
|
||||
if sys.platform == 'linux' and 'microsoft' not in platform.uname()[3].lower():
|
||||
bin_path = '/usr/bin/notion-app' if os.path.exists(
|
||||
'/usr/bin/notion-app') else '/usr/bin/notion'
|
||||
with open(bin_path, 'r', encoding='UTF-8') as launcher:
|
||||
if 'app.asar' not in launcher:
|
||||
print(
|
||||
f' ...patching app launcher')
|
||||
subprocess.call(
|
||||
['sed', '-i', r's/electron\ app/electron\ app\.asar/',
|
||||
bin_path])
|
||||
|
||||
print(f'\n{bold}>>> SUCCESSFULLY CLEANED <<<{normal}')
|
||||
|
||||
except Exception as e:
|
||||
print(f'\n{bold}### ERROR (report this to dragonwocky#8449 on discord) ###{normal}\n{str(e)}')
|
||||
|
||||
print(f'\n{bold}=== END OF LOG ==={normal}')
|
239
customiser.py
@ -1,239 +0,0 @@
|
||||
|
||||
# notion-enhancer
|
||||
# (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
# (c) 2020 TarasokUA
|
||||
# (https://dragonwocky.me/) under the MIT license
|
||||
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
import subprocess
|
||||
from shutil import copyfile, rmtree
|
||||
from time import sleep
|
||||
|
||||
# to smooth the update process
|
||||
enhancer_version = '0.7.0'
|
||||
|
||||
# for toggling notion visibility
|
||||
hotkey = 'CmdOrCtrl+Shift+A'
|
||||
|
||||
# '=== title ===' = headers
|
||||
# '*' = information
|
||||
# '...' = actions
|
||||
# '##' = warnings
|
||||
# '>' = exit
|
||||
|
||||
print('=== NOTION ENHANCER CUSTOMISATION LOG ===\n')
|
||||
|
||||
try:
|
||||
filepath = ''
|
||||
__dirname__ = os.path.dirname(__file__)
|
||||
enhancer_folder = os.path.realpath(__dirname__)
|
||||
if 'microsoft' in platform.uname()[3].lower() and sys.platform == 'linux':
|
||||
filepath = '/mnt/c/' + \
|
||||
subprocess.run(
|
||||
['cmd.exe', '/c', 'echo', '%localappdata%'], stdout=subprocess.PIPE).stdout \
|
||||
.rstrip().decode('utf-8')[3:].replace('\\', '/') + '/Programs/Notion/resources'
|
||||
drive = enhancer_folder[5].capitalize() if enhancer_folder.startswith(
|
||||
'/mnt/') else 'C'
|
||||
enhancer_folder = drive + ':\\' + enhancer_folder[6:]
|
||||
elif sys.platform == 'win32':
|
||||
filepath = subprocess.run(['echo', '%localappdata%'], shell=True, capture_output=True).stdout \
|
||||
.rstrip().decode('utf-8') + '\\Programs\\Notion\\resources'
|
||||
elif sys.platform == 'linux':
|
||||
if os.path.exists('/opt/notion-app'):
|
||||
filepath = '/opt/notion-app'
|
||||
elif os.path.exists('/opt/notion'):
|
||||
filepath = '/opt/notion'
|
||||
elif os.path.exists('/usr/lib/notion-desktop/resources'):
|
||||
filepath = '/usr/lib/notion-desktop/resources'
|
||||
elif sys.platform == 'darwin':
|
||||
filepath = '/Applications/Notion.app/Contents/Resources'
|
||||
else:
|
||||
print(' > script not compatible with your os!\n (report this to dragonwocky#8449 on discord)')
|
||||
exit()
|
||||
if not filepath or not os.path.exists(filepath):
|
||||
print(
|
||||
' > nothing found: exiting. notion install is either corrupted or non-existent.')
|
||||
exit()
|
||||
|
||||
unpacking_asar = True
|
||||
if not os.path.isfile(os.path.join(filepath, 'app.asar')):
|
||||
print(f' ## file {os.path.join(filepath, "app.asar")} not found!')
|
||||
print(' * attempting to locate')
|
||||
if os.path.exists(os.path.join(filepath, 'app')):
|
||||
unpacking_asar = False
|
||||
print(' * app.asar was already unpacked: checking version.')
|
||||
cleaning_asar = True
|
||||
if os.path.isfile(os.path.join(filepath, 'app', 'ENHANCER_VERSION.txt')):
|
||||
with open(os.path.join(filepath, 'app', 'ENHANCER_VERSION.txt'), 'r', encoding='UTF-8') as content:
|
||||
if content.read() == enhancer_version:
|
||||
cleaning_asar = False
|
||||
if cleaning_asar:
|
||||
unpacking_asar = True
|
||||
print(' * version does not match: cleaning.')
|
||||
if os.path.exists(os.path.join(filepath, 'app')):
|
||||
print(
|
||||
f' ...removing folder {os.path.join(filepath, "app")}')
|
||||
rmtree(os.path.join(filepath, 'app'))
|
||||
else:
|
||||
print(
|
||||
f' * {os.path.join(filepath, "app")} was not found: step skipped.')
|
||||
if os.path.isfile(os.path.join(filepath, 'app.asar.bak')):
|
||||
print(' ...renaming asar.app.bak to asar.app')
|
||||
os.rename(os.path.join(filepath, 'app.asar.bak'),
|
||||
os.path.join(filepath, 'app.asar'))
|
||||
else:
|
||||
print(
|
||||
f' * {os.path.join(filepath, "app.asar.bak")} was not found: exiting. notion install is corrupted.')
|
||||
exit()
|
||||
else:
|
||||
print(' * version matches: continuing.')
|
||||
else:
|
||||
print(
|
||||
' > nothing found: exiting. notion install is either corrupted or non-existent.')
|
||||
exit()
|
||||
if unpacking_asar:
|
||||
print(' ...unpacking app.asar')
|
||||
subprocess.run(['asar', 'extract', os.path.join(filepath, 'app.asar'), os.path.join(
|
||||
filepath, 'app')], shell=(True if sys.platform == 'win32' else False))
|
||||
print(' ...renaming asar.app to asar.app.bak')
|
||||
os.rename(os.path.join(filepath, 'app.asar'),
|
||||
os.path.join(filepath, 'app.asar.bak'))
|
||||
with open(os.path.join(filepath, 'app', 'ENHANCER_VERSION.txt'), 'w', encoding='UTF-8') as write:
|
||||
write.write(enhancer_version)
|
||||
|
||||
if os.path.isfile(os.path.join(filepath, 'app', 'renderer', 'preload.js')):
|
||||
print(
|
||||
f' ...adding preload.js to {os.path.join(filepath, "app","renderer","preload.js")}')
|
||||
with open(os.path.join(filepath, 'app', 'renderer', 'preload.js'), 'r', encoding='UTF-8') as content:
|
||||
if '/* === INJECTION MARKER === */' in content.read():
|
||||
print(' * preload.js already added. replacing it.')
|
||||
content.seek(0)
|
||||
original = []
|
||||
for num, line in enumerate(content):
|
||||
if '/* === INJECTION MARKER === */' in line:
|
||||
break
|
||||
original += line
|
||||
with open(os.path.join(filepath, 'app', 'renderer', 'preload.js'), 'w', encoding='UTF-8') as write:
|
||||
write.writelines(original)
|
||||
else:
|
||||
with open(os.path.join(filepath, 'app', 'renderer', 'preload.js'), 'a', encoding='UTF-8') as append:
|
||||
append.write('\n\n')
|
||||
with open(os.path.join(filepath, 'app', 'renderer', 'preload.js'), 'a', encoding='UTF-8') as append:
|
||||
print(
|
||||
f' ...linking to {os.path.join(".", "resources", "user.css")}')
|
||||
with open(os.path.join(__dirname__, 'resources', 'preload.js'), 'r', encoding='UTF-8') as insert:
|
||||
append.write(insert.read().replace(
|
||||
'☃☃☃resources☃☃☃', os.path.join(enhancer_folder, 'resources').replace('\\', '/'))
|
||||
.replace('☃☃☃version☃☃☃', enhancer_version))
|
||||
else:
|
||||
print(
|
||||
f' * {os.path.join(filepath, "app","renderer","preload.js")} was not found: step skipped.')
|
||||
|
||||
if os.path.isfile(os.path.join(filepath, "app", "main", "createWindow.js")):
|
||||
with open(os.path.join(filepath, "app", "main", "createWindow.js"), 'r', encoding='UTF-8') as content:
|
||||
content = content.read()
|
||||
print(
|
||||
f' ...making window frameless @ {os.path.join(filepath, "app", "main", "createWindow.js")}')
|
||||
if '{ frame: false, show: false' not in content:
|
||||
content = content.replace(
|
||||
'{ show: false', '{ frame: false, show: false')
|
||||
print(
|
||||
f' ...adding "open hidden" capabilities to {os.path.join(filepath, "app", "main", "createWindow.js")}')
|
||||
content = re.sub('\\s*\\/\\* === INJECTION START === \\*\\/.*?\\/\\* === INJECTION END === \\*\\/\\s*',
|
||||
'window.show()', content, flags=re.DOTALL).replace('window.show()', """
|
||||
/* === INJECTION START === */
|
||||
const path = require('path'),
|
||||
store = require(path.join(__dirname, '..', 'store.js'))({
|
||||
config: 'user-preferences',
|
||||
defaults: {
|
||||
openhidden: false,
|
||||
maximized: false,
|
||||
tray: false,
|
||||
}
|
||||
});
|
||||
if (!store.openhidden || electron_1.BrowserWindow.getAllWindows().some(win => win.isVisible()))
|
||||
{ window.show(); if (store.maximized) window.maximize(); }
|
||||
let appQuit = false;
|
||||
window.on('close', (e) => {
|
||||
if (appQuit || !store.tray) window = null;
|
||||
else {
|
||||
e.preventDefault();
|
||||
window.hide();
|
||||
}
|
||||
});
|
||||
electron_1.app.on('activate', () => window.show());
|
||||
electron_1.app.on('before-quit', () => (appQuit = true));
|
||||
/* === INJECTION END === */
|
||||
""")
|
||||
with open(os.path.join(filepath, "app", "main", "createWindow.js"), 'w', encoding='UTF-8') as write:
|
||||
write.write(content)
|
||||
else:
|
||||
print(
|
||||
f' * {os.path.join(filepath, "app", "main", "createWindow.js")} was not found: step skipped.')
|
||||
|
||||
if os.path.isfile(os.path.join(filepath, "app", "renderer", "index.js")):
|
||||
with open(os.path.join(filepath, "app", "renderer", "index.js"), 'r', encoding='UTF-8') as content:
|
||||
print(
|
||||
f' ...adjusting drag area for frameless window in {os.path.join(filepath, "app", "renderer", "index.js")}')
|
||||
content = content.read()
|
||||
loc = content.rfind('dragRegionStyle')
|
||||
content = content[:loc] + content[loc:] \
|
||||
.replace('top: 0', 'top: 1', 1) \
|
||||
.replace('height: 34', 'height: 10', 1)
|
||||
with open(os.path.join(filepath, "app", "renderer", "index.js"), 'w', encoding='UTF-8') as write:
|
||||
write.write(content)
|
||||
else:
|
||||
print(
|
||||
f' * {os.path.join(filepath, "app", "renderer", "index.js")} was not found: step skipped.')
|
||||
|
||||
if os.path.isfile(os.path.join(filepath, "app", "main", "main.js")):
|
||||
with open(os.path.join(filepath, "app", "main", "main.js"), 'r', encoding='UTF-8') as content:
|
||||
print(
|
||||
f' ...adding tray support (inc. context menu with settings) to {os.path.join(filepath, "app", "main", "main.js")}')
|
||||
print(
|
||||
f' ...adding window toggle hotkey to {os.path.join(filepath, "app", "main", "main.js")}')
|
||||
content = content.read()
|
||||
with open(os.path.join(filepath, "app", "main", "main.js"), 'w', encoding='UTF-8') as write:
|
||||
if '/* === INJECTION MARKER === */' in content:
|
||||
print(' * tray.js already added. replacing it.')
|
||||
original = []
|
||||
for line in content.splitlines():
|
||||
if '/* === INJECTION MARKER === */' in line:
|
||||
break
|
||||
original.append(line)
|
||||
write.write('\n'.join(original))
|
||||
else:
|
||||
write.write(content.replace(
|
||||
'electron_1.app.on("ready", handleReady);',
|
||||
'electron_1.app.on("ready", () => handleReady() && enhancements());') + '\n')
|
||||
with open(os.path.join(filepath, "app", "main", "main.js"), 'a', encoding='UTF-8') as append:
|
||||
with open(os.path.join(__dirname__, 'resources', 'tray.js'), 'r', encoding='UTF-8') as insert:
|
||||
append.write('\n' + insert.read().replace(
|
||||
'☃☃☃hotkey☃☃☃', hotkey).replace(
|
||||
'☃☃☃resources☃☃☃', os.path.join(enhancer_folder, 'resources').replace('\\', '/'))
|
||||
)
|
||||
print(
|
||||
f' ...copying datastore wrapper {os.path.join(".", "resources", "store.js")} to {os.path.join(filepath, "app")}')
|
||||
copyfile(os.path.join(__dirname__, 'resources', 'store.js'),
|
||||
os.path.join(filepath, "app", "store.js"))
|
||||
else:
|
||||
print(
|
||||
f' * {os.path.join(filepath, "app", "main", "main.js")} was not found: step skipped.')
|
||||
|
||||
if sys.platform == 'linux' and 'microsoft' not in platform.uname()[3].lower():
|
||||
print(
|
||||
f' ...patching app launcher')
|
||||
subprocess.call(
|
||||
['sed', '-i', r's/electron\ app\.asar/electron\ app/',
|
||||
'/usr/bin/notion-app' if os.path.exists('/usr/bin/notion-app') else '/usr/bin/notion'])
|
||||
|
||||
print('\n>>> SUCCESSFULLY CUSTOMISED <<<')
|
||||
|
||||
except Exception as e:
|
||||
print(
|
||||
f'\n### ERROR (report this to dragonwocky#8449 on discord) ###\n{str(e)}')
|
||||
|
||||
print('\n=== END OF LOG ===')
|
34
docs.json
@ -1,34 +0,0 @@
|
||||
{
|
||||
"title": "notion enhancer",
|
||||
"primary": "rgb(75, 133, 209)",
|
||||
"git": "https://github.com/dragonwocky/notion-enhancer/blob/master/",
|
||||
"footer": "[Edit on GitHub](__git__) // © 2020 dragonwocky & Uzver, under the [MIT license](https://choosealicense.com/licenses/mit/).",
|
||||
"card": {
|
||||
"description": "an enhancer/customiser for the all-in-one productivity workspace notion.so",
|
||||
"url": "https://dragonwocky.me/notion-enhancer/"
|
||||
},
|
||||
"icon": {
|
||||
"light": "notion.png"
|
||||
},
|
||||
"overwrite": true,
|
||||
"exclude": [
|
||||
"cleaner.py",
|
||||
"customiser.py",
|
||||
"resources/*",
|
||||
".gitignore",
|
||||
"Pipfile",
|
||||
"Pipfile.lock"
|
||||
],
|
||||
"nav": [
|
||||
["index.html", "README.md"],
|
||||
["styling.html", "STYLING.md"],
|
||||
"resources",
|
||||
["changelog.html", "CHANGELOG.md"],
|
||||
[
|
||||
"license",
|
||||
"https://github.com/dragonwocky/notion-enhancer/blob/master/LICENSE"
|
||||
],
|
||||
["github", "https://github.com/dragonwocky/notion-enhancer/"],
|
||||
["me (dragonwocky)", "https://dragonwocky.me/"]
|
||||
]
|
||||
}
|
22
docs/LICENSE
@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 TarasokUA
|
||||
Copyright (c) 2020 dragonwocky
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -1,135 +0,0 @@
|
||||
<!DOCTYPE html><!-- Documentative--><!-- (c) 2020 dragonwocky <thedragonring.bod@gmail.com>--><!-- (https://dragonwocky.me/) under the MIT license--><html prefix="og: http://ogp.me/ns#"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>changelog | notion enhancer</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro|Nunito+Sans"><link rel="stylesheet" href="docs.css"><script src="docs.js"></script><link rel="icon" href="notion.png" media="(prefers-color-scheme: dark)"><link rel="icon" href="notion.png"><meta name="title" content="changelog | notion enhancer"><meta name="description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta name="theme-color" content="rgb(75, 133, 209)"><meta property="og:type" content="article"><meta property="og:url" content="https://dragonwocky.me/notion-enhancer/changelog.html"><meta property="og:title" content="changelog"><meta property="og:site_name" content="notion enhancer"><meta property="og:description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta property="og:image" content="https://dragonwocky.me/notion-enhancer/notion.png"><meta property="twitter:card" content="summary"></head><body><aside class="menu"><div><div class="title"><h1>notion enhancer</h1><picture class="icon"><source srcset="notion.png" media="(prefers-color-scheme: dark)"><img src="notion.png"></picture></div></div><ul class="nav"><li class="entry"><a href="index.html">notion enhancer</a></li><li class="entry"><a href="styling.html">styling</a></li><li class="entry"><p>resources</p></li><li class="entry"><a href="#changelog">changelog</a><ul><li class="level-3"><a href="#v070-2020-07-09">v0.7.0 (2020-07-09)</a></li><li class="level-3"><a href="#v060-2020-06-30">v0.6.0 (2020-06-30)</a></li><li class="level-3"><a href="#v050-2020-05-23">v0.5.0 (2020-05-23)</a></li><li class="level-3"><a href="#v041-2020-02-13">v0.4.1 (2020-02-13)</a></li><li class="level-3"><a href="#v040">v0.4.0</a></li><li class="level-3"><a href="#v030">v0.3.0</a></li><li class="level-3"><a href="#v020">v0.2.0</a></li><li class="level-3"><a href="#v010">v0.1.0</a></li></ul></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/blob/master/LICENSE">license</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/">github</a></li><li class="entry"><a href="https://dragonwocky.me/">me (dragonwocky)</a></li></ul><p class="mark"><a href="https://dragonwocky.me/documentative">docs by documentative</a></p></aside><div class="wrapper"><div class="toggle"><button>☰</button><h1>notion enhancer</h1></div><article class="documentative"><div class="content">
|
||||
|
||||
<section class="block" id="changelog">
|
||||
<h1>
|
||||
<a href="#changelog">changelog</a>
|
||||
</h1>
|
||||
<p>if something is <del>crossed out</del>, then it is no longer a feature included by default,
|
||||
but can still easily be enabled by following instructions in the <a href="index.html#" title="">docs</a>.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="v070-2020-07-09">
|
||||
<h3>
|
||||
<a href="#v070-2020-07-09">v0.7.0 (2020-07-09)</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>new: tray option to use system default emojis (instead of twitter's emojiset).</li>
|
||||
<li>new: mac support (identical functionality to others platforms with the
|
||||
exception of the native minimise/maximise/close buttons being kept, as they integrate
|
||||
better with the OS while not being out-of-place in notion).</li>
|
||||
<li>new: notion-deb-builder support for linux.</li>
|
||||
<li>improved: replaced button symbols with svgs for multi-platform support.</li>
|
||||
<li>improved: window close button is now red on hover (thanks to <a href="https://github.com/torchatlas#" title="">@torchatlas</a>).</li>
|
||||
<li>bugfix: <code>cleaner.py</code> patched for linux.</li>
|
||||
<li>bugfix: tray now operates as expected on linux.</li>
|
||||
<li>bugfix: odd mix of <code>\\</code> and <code>/</code> being used for windows filepaths.</li>
|
||||
<li>bugfix: app no longer crashes when sidebar is toggled.</li>
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
<section class="block" id="v060-2020-06-30">
|
||||
<h3>
|
||||
<a href="#v060-2020-06-30">v0.6.0 (2020-06-30)</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>style: custom fonts.</li>
|
||||
<li>style: font resizing.</li>
|
||||
<li>style: hide discussions (thanks to <a href="https://www.reddit.com/user/Roosmaryn/#" title="">u/Roosmaryn</a>).</li>
|
||||
<li>new: custom colour theming, demonstrated via the dark+ theme.</li>
|
||||
<li>new: linux support (thanks to <a href="https://github.com/Blacksuan19#" title="">@Blacksuan19</a>).</li>
|
||||
<li>improved: if hotkey is pressed while notion is unfocused, it will bring it to the front rather than hiding it.</li>
|
||||
<li>improved: stop window buttons breaking at smaller widths.</li>
|
||||
<li>improved: more obviously visible drag area.</li>
|
||||
<li>bugfix: specify UTF-8 encoding to prevent multibyte/gbk codec errors (thanks to <a href="https://github.com/etnperlong#" title="">@etnperlong</a>).</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>📥 <a href="https://github.com/dragonwocky/notion-enhancer/archive/v0.6.0.zip#" title="">notion-enhancer.v0.6.0.zip</a></p>
|
||||
</blockquote>
|
||||
|
||||
</section>
|
||||
<section class="block" id="v050-2020-05-23">
|
||||
<h3>
|
||||
<a href="#v050-2020-05-23">v0.5.0 (2020-05-23)</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>new: running from the wsl.</li>
|
||||
<li>new: reload window with f5.</li>
|
||||
<li>improved: code has been refactored and cleaned up,
|
||||
inc. file renaming and a <code>customiser.py</code> that doesn't require
|
||||
a run of <code>cleaner.py</code> to build modifications.
|
||||
improved: scrollbar colours that fit better with notion's theming.</li>
|
||||
<li>bugfix: un-break having multiple notion windows open.</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>📥 <a href="https://github.com/dragonwocky/notion-enhancer/archive/v0.5.0.zip#" title="">notion-enhancer.v0.5.0.zip</a></p>
|
||||
</blockquote>
|
||||
<p><em>(forked by <a href="https://github.com/dragonwocky#" title="">@dragonwocky</a>.)</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="v041-2020-02-13">
|
||||
<h3>
|
||||
<a href="#v041-2020-02-13">v0.4.1 (2020-02-13)</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>bugfix: wider table & the "+" button not working in database pages.</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>📥 <a href="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d239a3cf-d553-4ef3-ab04-8b47892d9f9a/Notion_Customization_v4.1.zip#" title="">notion-enhancer.v4.1.zip</a></p>
|
||||
</blockquote>
|
||||
|
||||
</section>
|
||||
<section class="block" id="v040">
|
||||
<h3>
|
||||
<a href="#v040">v0.4.0</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>new: tray icon.</li>
|
||||
<li>new: app startup options (+ saving).</li>
|
||||
<li>new: <code>Reset.py</code></li>
|
||||
<li>improved: better output from <code>Customization Patcher.py</code>.</li>
|
||||
<li>bugfix: wider tables in "short page" mode.</li>
|
||||
<li>bugfix: unclickable buttons/draggable area (of titlebar).</li>
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
<section class="block" id="v030">
|
||||
<h3>
|
||||
<a href="#v030">v0.3.0</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>new: show/hide window hotkey.</li>
|
||||
<li>new: app startup options.</li>
|
||||
<li><del>style: smaller table icons.</del></li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>📥 <a href="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b01aa446-5727-476a-a25e-395472bfb1be/NotionScriptsV3.zip#" title="">notion-enhancer.v3.zip</a></p>
|
||||
</blockquote>
|
||||
|
||||
</section>
|
||||
<section class="block" id="v020">
|
||||
<h3>
|
||||
<a href="#v020">v0.2.0</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>new: light/dark theme support for window control buttons + scrollbars.</li>
|
||||
<li>new: custom styles directly linked to the enhancer resources + compatible with web version.</li>
|
||||
<li><del>improved: making table column width go below 100px.</del></li>
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
<section class="block" id="v010">
|
||||
<h3>
|
||||
<a href="#v010">v0.1.0</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>new: custom window control buttons.</li>
|
||||
<li>removed: default titlebar/menubar.</li>
|
||||
<li><del>removed: huge padding of board view.</del></li>
|
||||
<li><del>removed: huge padding of table view.</del></li>
|
||||
<li><del>optional: making table column width go below 100px.</del></li>
|
||||
<li><del>style: thinner cover image + higher content block.</del></li>
|
||||
<li>style: scrollbars.</li>
|
||||
</ul>
|
||||
|
||||
</section></div><footer class="footer"><hr><p><a href="https://github.com/dragonwocky/notion-enhancer/blob/master/CHANGELOG.md">Edit on GitHub</a> // © 2020 dragonwocky & Uzver, under the <a href="https://choosealicense.com/licenses/mit/">MIT license</a>.</p>
|
||||
</footer><nav><a class="prev" href="styling.html">ᐊ</a></nav></article></div></body></html>
|
501
docs/docs.css
@ -1,501 +0,0 @@
|
||||
/*
|
||||
* Documentative Styling
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (https://dragonwocky.me/) under the MIT license
|
||||
*/
|
||||
:root {
|
||||
--primary: #4b85d1;
|
||||
--absolute: #000;
|
||||
--contrast: #fff;
|
||||
--text: rgba(0, 0, 0, 0.84);
|
||||
--link: var(--primary);
|
||||
--grey: #6f6f6f;
|
||||
--bg: #fbfcfc;
|
||||
--box: #f2f3f4;
|
||||
--code: #f7f9f9;
|
||||
--button: #eee;
|
||||
--border: #e5e7e9;
|
||||
--shadow: #eee;
|
||||
--glow: transparent;
|
||||
--scroll: #e9e9e9;
|
||||
--hover: #dedede;
|
||||
--code-lang: #555;
|
||||
--hljs-html: #000080;
|
||||
--hljs-attr: #008080;
|
||||
--hljs-obj: #2c426b;
|
||||
--hljs-string: #d14;
|
||||
--hljs-builtin: #0086b3;
|
||||
--hljs-keyword: rgba(0, 0, 0, 0.84);
|
||||
--hljs-selector: #900;
|
||||
--hljs-type: #458;
|
||||
--hljs-regex: #009926;
|
||||
--hljs-symbol: #990073;
|
||||
--hljs-meta: #999;
|
||||
--hljs-comment: #707070;
|
||||
--hljs-deletion: #e8b9b8;
|
||||
--hljs-deletion-text: #4c232d;
|
||||
--hljs-addition: #b9e0d3;
|
||||
--hljs-addition-text: #1e4839;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--absolute: #fff;
|
||||
--contrast: #000;
|
||||
--text: #ddd;
|
||||
--link: #a6c3e8;
|
||||
--grey: #52555c;
|
||||
--bg: #0e0f0f;
|
||||
--box: #050505;
|
||||
--code: #000;
|
||||
--button: #2d2d2d;
|
||||
--border: #2d2e2f;
|
||||
--shadow: #070707;
|
||||
--glow: var(--primary);
|
||||
--scroll: #202225;
|
||||
--hover: #36393f;
|
||||
--code-lang: #ccc;
|
||||
--hljs-html: #46db8c;
|
||||
--hljs-attr: #dd1111;
|
||||
--hljs-obj: #c6cbda;
|
||||
--hljs-string: #abcdef;
|
||||
--hljs-builtin: #b8528d;
|
||||
/* bd1a79, 926956 */
|
||||
--hljs-keyword: #2d8b59;
|
||||
--hljs-comment: #a0a0a0;
|
||||
--hljs-deletion: #4c232d;
|
||||
--hljs-deletion-text: #e8b9b8;
|
||||
--hljs-addition: #1e4839;
|
||||
--hljs-addition-text: #b9e0d3;
|
||||
}
|
||||
}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
word-break: break-word;
|
||||
text-decoration: none;
|
||||
text-size-adjust: 100%;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body {
|
||||
color: var(--text);
|
||||
background-color: var(--bg);
|
||||
font-family: 'Nunito Sans', sans-serif;
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 2px;
|
||||
height: 2px;
|
||||
}
|
||||
::-webkit-scrollbar-corner,
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: var(--scroll);
|
||||
border-radius: 5px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--hover);
|
||||
}
|
||||
aside {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: var(--box);
|
||||
overflow-x: auto;
|
||||
}
|
||||
aside .title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
aside .title h1 {
|
||||
font: 1.8em 'Source Code Pro', monospace;
|
||||
margin: 0 0 1em 1.5rem;
|
||||
padding: 1em 8px 2.5px 0;
|
||||
letter-spacing: -2px;
|
||||
border-bottom: 5px solid var(--primary);
|
||||
color: var(--absolute);
|
||||
}
|
||||
aside .title .icon {
|
||||
margin: auto 0.5em;
|
||||
}
|
||||
aside .title .icon img {
|
||||
width: 2.5em;
|
||||
margin: auto 0.5em;
|
||||
}
|
||||
aside > ul:first-child > li:first-child {
|
||||
padding-top: 1em;
|
||||
}
|
||||
aside ul {
|
||||
list-style-type: none;
|
||||
padding-inline-start: 0;
|
||||
margin: 0;
|
||||
}
|
||||
aside ul li p {
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.5px;
|
||||
margin-bottom: 0;
|
||||
padding: 2px 1.3em;
|
||||
font-size: 1.1em;
|
||||
color: var(--hljs-comment);
|
||||
}
|
||||
aside ul li a {
|
||||
color: var(--text);
|
||||
padding-bottom: 0.1em 5em;
|
||||
display: block;
|
||||
padding: 2px 1.5em;
|
||||
}
|
||||
aside ul li a:hover,
|
||||
aside ul li a:active {
|
||||
background: var(--scroll);
|
||||
}
|
||||
aside ul li a.active {
|
||||
color: var(--link);
|
||||
font-weight: bold;
|
||||
text-shadow: 0 0 0.75em var(--glow);
|
||||
}
|
||||
aside ul li.entry > a {
|
||||
text-decoration: underline var(--border);
|
||||
}
|
||||
aside ul li.level-1 > a {
|
||||
padding-left: 1.75em;
|
||||
}
|
||||
aside ul li.level-2 > a {
|
||||
padding-left: calc(1.5em + calc(0.75em * 1));
|
||||
}
|
||||
aside ul li.level-3 > a {
|
||||
padding-left: calc(1.5em + calc(0.75em * 2));
|
||||
}
|
||||
aside ul li.level-4 > a {
|
||||
padding-left: calc(1.5em + calc(0.75em * 3));
|
||||
}
|
||||
aside ul li.level-5 > a {
|
||||
padding-left: calc(1.5em + calc(0.75em * 4));
|
||||
}
|
||||
aside ul li.level-6 > a {
|
||||
padding-left: calc(1.5em + calc(0.75em * 5));
|
||||
}
|
||||
aside .mark {
|
||||
text-align: right;
|
||||
margin-top: auto;
|
||||
padding: 1.5em 1.5em 2px 1.5em;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
aside .mark a {
|
||||
color: var(--grey);
|
||||
}
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.wrapper .documentative {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 0 1.5em;
|
||||
padding-bottom: 4em;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.wrapper .documentative .block {
|
||||
margin: 1.5em;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.wrapper .documentative .block:first-child {
|
||||
margin: 0 1.5em 1.5em 1.5em;
|
||||
}
|
||||
.wrapper .documentative .example {
|
||||
margin-top: 1em;
|
||||
padding: 1em;
|
||||
background-color: var(--box);
|
||||
box-shadow: 0.4em 0.4em 1em var(--shadow);
|
||||
}
|
||||
.wrapper .documentative .example p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.wrapper .documentative .example p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.wrapper .documentative nav {
|
||||
width: 75%;
|
||||
position: fixed;
|
||||
bottom: 1em;
|
||||
right: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
.wrapper .documentative nav .prev {
|
||||
float: left;
|
||||
padding-right: 0.13em;
|
||||
}
|
||||
.wrapper .documentative nav .next {
|
||||
float: right;
|
||||
padding-left: 0.13em;
|
||||
}
|
||||
.wrapper .documentative nav .prev,
|
||||
.wrapper .documentative nav .next {
|
||||
opacity: 1;
|
||||
transition: opacity 200ms ease;
|
||||
pointer-events: all;
|
||||
border-radius: 50%;
|
||||
width: 1.75em;
|
||||
height: 1.75em;
|
||||
margin: 0 1em;
|
||||
font: 1.5em 'Source Code Pro', monospace;
|
||||
line-height: 1.75em;
|
||||
text-align: center;
|
||||
color: var(--text);
|
||||
text-shadow: none !important;
|
||||
background-color: var(--button);
|
||||
}
|
||||
.wrapper .documentative .footer {
|
||||
text-align: right;
|
||||
color: var(--grey);
|
||||
margin: auto 1.5em 0;
|
||||
}
|
||||
.wrapper .documentative .footer hr {
|
||||
border-color: var(--grey);
|
||||
}
|
||||
.wrapper .documentative .footer a {
|
||||
color: var(--grey);
|
||||
font-weight: bold;
|
||||
text-shadow: none;
|
||||
text-decoration: dotted underline;
|
||||
}
|
||||
.wrapper .documentative h1,
|
||||
.wrapper .documentative h2,
|
||||
.wrapper .documentative h3,
|
||||
.wrapper .documentative h4,
|
||||
.wrapper .documentative h5,
|
||||
.wrapper .documentative h6 {
|
||||
margin: 0;
|
||||
padding-top: 1em;
|
||||
}
|
||||
.wrapper .documentative h1 a,
|
||||
.wrapper .documentative h2 a,
|
||||
.wrapper .documentative h3 a,
|
||||
.wrapper .documentative h4 a,
|
||||
.wrapper .documentative h5 a,
|
||||
.wrapper .documentative h6 a {
|
||||
color: var(--text);
|
||||
text-shadow: none;
|
||||
}
|
||||
.wrapper .documentative h1 {
|
||||
padding-top: 1.5em;
|
||||
}
|
||||
.wrapper .documentative a {
|
||||
color: var(--link);
|
||||
text-shadow: 0 0 0.75em var(--glow);
|
||||
}
|
||||
.wrapper .documentative img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.wrapper .documentative blockquote {
|
||||
margin-left: 0;
|
||||
padding-left: 1em;
|
||||
border-left: 0.25em solid var(--border);
|
||||
}
|
||||
.wrapper .documentative h1 + table,
|
||||
.wrapper .documentative h2 + table,
|
||||
.wrapper .documentative h3 + table,
|
||||
.wrapper .documentative h4 + table,
|
||||
.wrapper .documentative h5 + table,
|
||||
.wrapper .documentative h6 + table {
|
||||
margin-top: 1em;
|
||||
}
|
||||
.wrapper .documentative table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.wrapper .documentative table,
|
||||
.wrapper .documentative th,
|
||||
.wrapper .documentative td {
|
||||
padding: 0.2em 0.7em;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.wrapper .documentative code {
|
||||
font-size: 0.8em;
|
||||
background-color: var(--code);
|
||||
overflow-x: auto;
|
||||
position: relative;
|
||||
display: block;
|
||||
font-family: 'Source Code Pro', monospace;
|
||||
}
|
||||
.wrapper .documentative *:not(pre) > code {
|
||||
padding: 0.275em 0.35em;
|
||||
border-radius: 2px;
|
||||
display: inline;
|
||||
}
|
||||
.wrapper .documentative pre {
|
||||
position: relative;
|
||||
}
|
||||
.wrapper .documentative pre code {
|
||||
padding: 1.8em;
|
||||
border-radius: 5px;
|
||||
position: static;
|
||||
}
|
||||
.wrapper .documentative pre code::before {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
color: var(--code-lang);
|
||||
font-size: 0.65em;
|
||||
padding: 0.5em 0.8em;
|
||||
}
|
||||
@media (min-width: 769px) {
|
||||
body {
|
||||
display: grid;
|
||||
grid-template-columns: 25% 75%;
|
||||
}
|
||||
aside::-webkit-scrollbar-corner,
|
||||
aside::-webkit-scrollbar-track {
|
||||
background-color: var(--bg);
|
||||
}
|
||||
.toggle {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
aside {
|
||||
z-index: 1;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: calc(4.5em - 100%);
|
||||
width: calc(100% - 4.5em);
|
||||
transition: left 300ms ease;
|
||||
}
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transition: left 300ms ease;
|
||||
}
|
||||
.wrapper .documentative {
|
||||
flex-shrink: 1;
|
||||
}
|
||||
.wrapper .documentative nav {
|
||||
width: 100%;
|
||||
}
|
||||
.wrapper .toggle {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-shrink: 0;
|
||||
padding: 0.8em 0;
|
||||
background-color: var(--box);
|
||||
}
|
||||
.wrapper .toggle h1 {
|
||||
letter-spacing: -2px;
|
||||
font-size: 1.8em;
|
||||
padding-top: 1.5px;
|
||||
margin: auto 1.5rem auto 0;
|
||||
}
|
||||
.wrapper .toggle button {
|
||||
font-size: 1.8em;
|
||||
width: 2.5em;
|
||||
margin: auto 0.5em;
|
||||
color: var(--absolute);
|
||||
border: none;
|
||||
background: none;
|
||||
text-align: center;
|
||||
transition: transform 150ms ease;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
.wrapper .toggle button:hover,
|
||||
.wrapper .toggle button:focus {
|
||||
color: var(--text);
|
||||
}
|
||||
.wrapper .toggle button:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
.mobilemenu aside {
|
||||
left: 0;
|
||||
}
|
||||
.mobilemenu .wrapper {
|
||||
left: calc(100% - 4.75em);
|
||||
}
|
||||
.mobilemenu .wrapper .prev,
|
||||
.mobilemenu .wrapper .next {
|
||||
opacity: 0 !important;
|
||||
pointer-events: none !important;
|
||||
}
|
||||
}
|
||||
.hljs-subst {
|
||||
color: var(--text);
|
||||
}
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: var(--hljs-comment);
|
||||
font-style: italic;
|
||||
}
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag {
|
||||
color: var(--hljs-keyword);
|
||||
font-weight: bold;
|
||||
}
|
||||
.hljs-attr {
|
||||
color: var(--hljs-obj);
|
||||
}
|
||||
.hljs-number,
|
||||
.hljs-literal,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-tag .hljs-attr {
|
||||
color: var(--hljs-attr);
|
||||
}
|
||||
.hljs-string,
|
||||
.hljs-doctag {
|
||||
color: var(--hljs-string);
|
||||
}
|
||||
.hljs-name,
|
||||
.hljs-attribute {
|
||||
color: var(--hljs-html);
|
||||
}
|
||||
.hljs-built_in,
|
||||
.hljs-builtin-name {
|
||||
color: var(--hljs-builtin);
|
||||
}
|
||||
.hljs-title,
|
||||
.hljs-section,
|
||||
.hljs-selector-id {
|
||||
color: var(--hljs-selector);
|
||||
font-weight: bold;
|
||||
}
|
||||
.hljs-type,
|
||||
.hljs-class .hljs-title {
|
||||
color: var(--hljs-type);
|
||||
font-weight: bold;
|
||||
}
|
||||
.hljs-regexp,
|
||||
.hljs-link {
|
||||
color: var(--hljs-regex);
|
||||
}
|
||||
.hljs-symbol,
|
||||
.hljs-bullet {
|
||||
color: var(--hljs-symbol);
|
||||
}
|
||||
.hljs-meta {
|
||||
color: var(--hljs-meta);
|
||||
font-weight: bold;
|
||||
}
|
||||
.hljs-deletion {
|
||||
background: var(--hljs-deletion);
|
||||
color: var(--hljs-deletion-text);
|
||||
}
|
||||
.hljs-addition {
|
||||
background: var(--hljs-addition);
|
||||
color: var(--hljs-addition-text);
|
||||
}
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
.documentative pre .lang-css::before { content: 'CSS'; }
|
193
docs/docs.js
@ -1,193 +0,0 @@
|
||||
/*
|
||||
* Documentative
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (https://dragonwocky.me/) under the MIT license
|
||||
*/
|
||||
|
||||
class Scrollnav {
|
||||
constructor(menu, content, options) {
|
||||
if (!(menu instanceof HTMLElement))
|
||||
throw Error('scrollnav: invalid <menu> element provided');
|
||||
if (!(content instanceof HTMLElement))
|
||||
throw Error('scrollnav: invalid <content> element provided');
|
||||
if (typeof options !== 'object') options = {};
|
||||
|
||||
if (Scrollnav.prototype.INITIATED)
|
||||
throw Error('scrollnav: only 1 instance per page allowed!');
|
||||
Scrollnav.prototype.INITIATED = true;
|
||||
|
||||
this.ID;
|
||||
this.ticking = [];
|
||||
this._menu = menu;
|
||||
this._content = content;
|
||||
this._links = [];
|
||||
this._sections = [...this._menu.querySelectorAll('ul li a')].reduce(
|
||||
(list, link) => {
|
||||
if (!link.getAttribute('href').startsWith('#')) return list;
|
||||
let section = this._content.querySelector(link.getAttribute('href'));
|
||||
if (!section) return list;
|
||||
|
||||
this._links.push(link);
|
||||
link.onclick = async ev => {
|
||||
ev.preventDefault();
|
||||
const ID = link.getAttribute('href');
|
||||
this.highlightHeading(ID);
|
||||
this.scrollContent(ID);
|
||||
this.setHash(ID);
|
||||
};
|
||||
|
||||
return [...list, section];
|
||||
},
|
||||
[]
|
||||
);
|
||||
this._topheading = `#${this._sections[0].id}`;
|
||||
|
||||
window.onhashchange = this.watchHash.bind(this);
|
||||
this._content.addEventListener('scroll', ev => {
|
||||
if (!this.ticking.length) {
|
||||
this.ticking.push(1);
|
||||
requestAnimationFrame(() => {
|
||||
this.watchScroll(ev);
|
||||
this.ticking.pop();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.set(null, false);
|
||||
return this;
|
||||
}
|
||||
|
||||
set(ID, smooth) {
|
||||
this.highlightHeading(ID);
|
||||
this.scrollMenu(ID, smooth);
|
||||
this.scrollContent(ID, smooth);
|
||||
this.setHash(ID);
|
||||
}
|
||||
|
||||
parseID(ID) {
|
||||
if (!ID || typeof ID !== 'string') ID = location.hash || this._topheading;
|
||||
if (!ID.startsWith('#')) ID = `#${ID}`;
|
||||
if (!this._links.find(el => el.getAttribute('href') === ID))
|
||||
ID = this._topheading;
|
||||
this.ID = ID;
|
||||
return ID;
|
||||
}
|
||||
highlightHeading(ID) {
|
||||
this.parseID(ID);
|
||||
this._links.forEach(el =>
|
||||
el.getAttribute('href') === this.ID
|
||||
? el.classList.add('active')
|
||||
: el.classList.remove('active')
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
watchHash(ev) {
|
||||
ev.preventDefault();
|
||||
if (ev.newURL !== ev.oldURL) {
|
||||
this.set();
|
||||
}
|
||||
}
|
||||
setHash(ID) {
|
||||
if (!history.replaceState) return false;
|
||||
this.parseID(ID);
|
||||
history.replaceState(null, null, ID === this._topheading ? '#' : this.ID);
|
||||
return true;
|
||||
}
|
||||
|
||||
scrollContent(ID, smooth = true) {
|
||||
this.ticking.push(1);
|
||||
this.parseID(ID);
|
||||
let offset = this._sections.find(el => `#${el.id}` === this.ID).offsetTop;
|
||||
if (offset < this._content.clientHeight / 2) offset = 0;
|
||||
this._content.scroll({
|
||||
top: offset,
|
||||
behavior: smooth ? 'smooth' : 'auto'
|
||||
});
|
||||
setTimeout(() => this.ticking.pop(), 1000);
|
||||
return true;
|
||||
}
|
||||
scrollMenu(ID, smooth = true) {
|
||||
this.parseID(ID);
|
||||
let offset = this._links.find(el => el.getAttribute('href') === this.ID)
|
||||
.offsetTop;
|
||||
if (offset < this._menu.clientHeight / 2) offset = 0;
|
||||
this._menu.scroll({
|
||||
top: offset,
|
||||
behavior: smooth ? 'smooth' : 'auto'
|
||||
});
|
||||
return true;
|
||||
}
|
||||
watchScroll(ev) {
|
||||
const viewport = this._content.clientHeight,
|
||||
ID = this._sections.reduce(
|
||||
(carry, el) => {
|
||||
const rect = el.getBoundingClientRect(),
|
||||
height = rect.bottom - rect.top,
|
||||
visible = {
|
||||
top: rect.top >= 0 && rect.top < viewport,
|
||||
bottom: rect.bottom > 0 && rect.top < viewport
|
||||
};
|
||||
let pixels = 0;
|
||||
if (visible.top && visible.bottom) {
|
||||
pixels = height; // whole el
|
||||
} else if (visible.top) {
|
||||
pixels = viewport - rect.top;
|
||||
} else if (visible.bottom) {
|
||||
pixels = rect.bottom;
|
||||
} else if (height > viewport && rect.top < 0) {
|
||||
const absolute = Math.abs(rect.top);
|
||||
if (absolute < height) pixels = height - absolute; // part of el
|
||||
}
|
||||
pixels = (pixels / height) * 100;
|
||||
return pixels > carry[0] ? [pixels, el] : carry;
|
||||
},
|
||||
[0, null]
|
||||
)[1].id;
|
||||
this.ID = ID;
|
||||
this.scrollMenu(this.ID);
|
||||
clearTimeout(this.afterScroll);
|
||||
this.afterScroll = setTimeout(
|
||||
() => void (this.highlightHeading(this.ID) && this.setHash(this.ID)),
|
||||
100
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let constructed = false;
|
||||
const construct = () => {
|
||||
if (document.readyState !== 'complete' || constructed) return false;
|
||||
constructed = true;
|
||||
|
||||
if (
|
||||
location.pathname.endsWith('index.html') &&
|
||||
window.location.protocol === 'https:'
|
||||
)
|
||||
location.replace('./' + location.hash);
|
||||
|
||||
new Scrollnav(
|
||||
document.querySelector('aside'),
|
||||
document.querySelector('.documentative')
|
||||
);
|
||||
|
||||
document.querySelector('.toggle button').onclick = () =>
|
||||
document.body.classList.toggle('mobilemenu');
|
||||
|
||||
if (window.matchMedia) {
|
||||
let prev;
|
||||
const links = [...document.head.querySelectorAll('link[rel*="icon"]')],
|
||||
pointer = document.createElement('link');
|
||||
pointer.setAttribute('rel', 'icon');
|
||||
document.head.appendChild(pointer);
|
||||
setInterval(() => {
|
||||
const match = links.find(link => window.matchMedia(link.media).matches);
|
||||
if (!match || match.media === prev) return;
|
||||
prev = match.media;
|
||||
pointer.setAttribute('href', match.getAttribute('href'));
|
||||
}, 500);
|
||||
links.forEach(link => document.head.removeChild(link));
|
||||
}
|
||||
};
|
||||
|
||||
construct();
|
||||
document.addEventListener('readystatechange', construct);
|
160
docs/index.html
@ -1,160 +0,0 @@
|
||||
<!DOCTYPE html><!-- Documentative--><!-- (c) 2020 dragonwocky <thedragonring.bod@gmail.com>--><!-- (https://dragonwocky.me/) under the MIT license--><html prefix="og: http://ogp.me/ns#"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>notion enhancer</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro|Nunito+Sans"><link rel="stylesheet" href="docs.css"><script src="docs.js"></script><link rel="icon" href="notion.png" media="(prefers-color-scheme: dark)"><link rel="icon" href="notion.png"><meta name="title" content="notion enhancer"><meta name="description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta name="theme-color" content="rgb(75, 133, 209)"><meta property="og:type" content="article"><meta property="og:url" content="https://dragonwocky.me/notion-enhancer/index.html"><meta property="og:title" content="notion enhancer"><meta property="og:site_name" content="notion enhancer"><meta property="og:description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta property="og:image" content="https://dragonwocky.me/notion-enhancer/notion.png"><meta property="twitter:card" content="summary"></head><body><aside class="menu"><div><div class="title"><h1>notion enhancer</h1><picture class="icon"><source srcset="notion.png" media="(prefers-color-scheme: dark)"><img src="notion.png"></picture></div></div><ul class="nav"><li class="entry"><a href="#notion-enhancer">notion enhancer</a><ul><li class="level-2"><a href="#supported-clients">supported clients</a></li><li class="level-2"><a href="#installation">installation</a></li><li class="level-2"><a href="#faq">faq</a></li><li class="level-2"><a href="#features">features</a></li><li class="level-3"><a href="#titlebar">titlebar</a></li><li class="level-3"><a href="#nicer-scrollbars">nicer scrollbars</a></li><li class="level-3"><a href="#hotkeys">hotkeys</a></li><li class="level-3"><a href="#tray">tray</a></li><li class="level-2"><a href="#styling">styling</a></li><li class="level-2"><a href="#other-details">other details</a></li></ul></li><li class="entry"><a href="styling.html">styling</a></li><li class="entry"><p>resources</p></li><li class="entry"><a href="changelog.html">changelog</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/blob/master/LICENSE">license</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/">github</a></li><li class="entry"><a href="https://dragonwocky.me/">me (dragonwocky)</a></li></ul><p class="mark"><a href="https://dragonwocky.me/documentative">docs by documentative</a></p></aside><div class="wrapper"><div class="toggle"><button>☰</button><h1>notion enhancer</h1></div><article class="documentative"><div class="content">
|
||||
|
||||
<section class="block" id="notion-enhancer">
|
||||
<h1>
|
||||
<a href="#notion-enhancer">notion enhancer</a>
|
||||
</h1>
|
||||
<p>an enhancer/customiser for the all-in-one productivity workspace <a href="https://www.notion.so/#" title="">notion.so</a></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="supported-clients">
|
||||
<h2>
|
||||
<a href="#supported-clients">supported clients</a>
|
||||
</h2>
|
||||
<p>there are a lot of ways to use notion. some official clients, many not.</p>
|
||||
<p>the enhancer supports:</p>
|
||||
<ul>
|
||||
<li>the <a href="https://notion.so/desktop#" title="">official windows/mac releases</a>.</li>
|
||||
<li>the arch linux AUR <a href="https://aur.archlinux.org/packages/notion-app/#" title="">notion-app</a> package</li>
|
||||
<li>the linux <a href="https://github.com/jaredallard/notion-app#" title="">notion-app</a> installer</li>
|
||||
<li>the debian <a href="https://github.com/davidbailey00/notion-deb-builder/tree/229f2868e117e81858618783b83babd00c595000#" title="">notion-deb-builder</a>.</li>
|
||||
</ul>
|
||||
<p>there are others, yes. the enhancer does not support them. you should not expect them to work.
|
||||
if for some reason you need to use one of them instead of the above listed ones, open a
|
||||
<a href="https://github.com/dragonwocky/notion-enhancer/issues/new?assignees=&labels=enhancement&template=platform-support.md&title=#" title="">platform support</a> request.</p>
|
||||
<p>please do not modify the enhancer code specifically to work for your installation.
|
||||
if you have the know-how to do so, instead open a pull request with your changes
|
||||
so that proper support can be added for all users of that client.</p>
|
||||
<p>mobile clients are not supported and due to system limitations/restrictions cannot be.</p>
|
||||
<p>(the <a href="#styling" title="">styles</a> should also work for the web version.
|
||||
these can be installed via an extension like <a href="https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne?hl=en#" title="">stylus</a>
|
||||
or a built-in feature like <a href="https://www.userchrome.org/#" title="">userChrome.css</a>.)</p>
|
||||
<p>if the script is run from the WSL, it will enhance the windows version of the app.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="installation">
|
||||
<h2>
|
||||
<a href="#installation">installation</a>
|
||||
</h2>
|
||||
<ol>
|
||||
<li>install node.js: <a href="https://nodejs.org/en/download/#" title="">windows/macOS</a>, <a href="https://github.com/mklement0/n-install#" title="">linux/WSL</a>.</li>
|
||||
<li>install python: <a href="https://www.python.org/downloads/#" title="">windows/macOS</a>, <a href="https://docs.python-guide.org/starting/install3/linux/#" title="">linux/WSL</a>.</li>
|
||||
<li>reboot.</li>
|
||||
<li>in the appropriate terminal/command line, run <code>npm install -g asar</code> (check installation by running <code>asar</code>).</li>
|
||||
<li><a href="https://github.com/dragonwocky/notion-enhancer/archive/master.zip#" title="">download this enhancer</a> & extract
|
||||
to a location it can safely remain (if running the script from the WSL, make sure this is from a location within the windows filesystem).</li>
|
||||
<li>ensure no notion processes are running - you may want to check the task manager to make sure.</li>
|
||||
<li>optional: to remove previous applications of the notion enhancer, run <code>cleaner.py</code>.</li>
|
||||
<li>optional: modify the <code>resources/user.css</code> file to your liking (see <a href="#styling" title="">styling</a>).</li>
|
||||
<li>run <code>customiser.py</code> to build changes. (for linux run with sudo)</li>
|
||||
</ol>
|
||||
<p>done: run notion and enjoy.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="faq">
|
||||
<h2>
|
||||
<a href="#faq">faq</a>
|
||||
</h2>
|
||||
<p><strong>now the notion app won't open :(</strong></p>
|
||||
<ol>
|
||||
<li>kill any notion tasks in the task manager (<code>ctrl+shift+esc</code>).</li>
|
||||
<li>run <code>cleaner.py</code>.</li>
|
||||
<li>reboot.</li>
|
||||
<li>follow instructions above (ensuring notion <em>isn't</em> running! again, check task manager).</li>
|
||||
</ol>
|
||||
<p><strong>i tried opening the python file but it just closed instantly and nothing happened?</strong></p>
|
||||
<p>python scripts must be run from the terminal or command prompt via e.g. <code>python customiser.py</code>.</p>
|
||||
<p><strong>now that I've run the script, can I delete the enhancer folder?</strong></p>
|
||||
<p>no! user style files <code>resources/user.css</code> and <code>resources/theme.css</code> are fetched from here each time you open notion.
|
||||
additionally, if you ever need to change or reset your notion build, the <code>customiser.py</code> and <code>cleaner.py</code> files will be useful.</p>
|
||||
<p>unless you're sure you know what you're doing (if you have to ask, you probably don't) then do not delete anything.</p>
|
||||
<p><strong>something isn't working, and the suggestions here haven't fixed it...</strong></p>
|
||||
<p>this is probably a bug. please submit a
|
||||
<a href="https://github.com/dragonwocky/notion-enhancer/issues/new?assignees=&labels=bug&template=bug-report.md&title=#" title="">bug report</a>.</p>
|
||||
<p><strong>can the enhancer do ___?</strong></p>
|
||||
<p>experienced problems with the notion app, or just want to add something a bit more to it? please submit a
|
||||
<a href="https://github.com/dragonwocky/notion-enhancer/issues/new?assignees=&labels=enhancement&template=feature-request.md&title=#" title="">feature request</a>.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="features">
|
||||
<h2>
|
||||
<a href="#features">features</a>
|
||||
</h2>
|
||||
|
||||
</section>
|
||||
<section class="block" id="titlebar">
|
||||
<h3>
|
||||
<a href="#titlebar">titlebar</a>
|
||||
</h3>
|
||||
<p>default windows titlebar/frame has been replaced by one more fitting to the theme of the app.</p>
|
||||
<p>this includes the addition of an extra button, "always on top"
|
||||
symbolised with an arrow. when toggled to point up,
|
||||
notion will remain the top visible window even if not focused.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="nicer-scrollbars">
|
||||
<h3>
|
||||
<a href="#nicer-scrollbars">nicer scrollbars</a>
|
||||
</h3>
|
||||
<p>i mean, yeah. get rid of those ugly default scrollbars and use nice inconspicuous
|
||||
ones that actually look as if they're part of notion.</p>
|
||||
<p>to add these to the web version, copy lines 74 - 105 from <code>user.css</code> into your css customiser.</p>
|
||||
<p><img loading="lazy" src="screenshots/app-unenhanced.jpg" alt="" title="">
|
||||
<em>image: before enhancement</em></p>
|
||||
<p><img loading="lazy" src="screenshots/app-enhanced.jpg" alt="" title="">
|
||||
<em>image: after default enhancement</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="hotkeys">
|
||||
<h3>
|
||||
<a href="#hotkeys">hotkeys</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li><strong>reload window</strong>: in addition to the built-in <code>CmdOrCtrl+R</code> reload,
|
||||
you can now reload a window with <code>F5</code>.</li>
|
||||
<li><strong>toggle all notion windows to/from the tray</strong>: <code>CmdOrCtrl+Shift+A</code> by default.</li>
|
||||
</ul>
|
||||
<p>to set your own toggle hotkey, open <code>customiser.py</code> and change line 19 (<code>hotkey = 'CmdOrCtrl+Shift+A'</code>)
|
||||
to your preference. you will need to run or re-run <code>customiser.py</code> afterwards.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="tray">
|
||||
<h3>
|
||||
<a href="#tray">tray</a>
|
||||
</h3>
|
||||
<p>single-click to toggle app visibility. right click to open menu.</p>
|
||||
<ul>
|
||||
<li><strong>run on startup</strong>: run notion on boot/startup. (default: true)</li>
|
||||
<li><strong>hide on open</strong>: hide the launch of notion to the tray. (default: false)</li>
|
||||
<li><strong>open maximised</strong>: maximize the app on open. (default: false)</li>
|
||||
<li><strong>close to tray</strong>: close window to tray rather than closing outright
|
||||
on click of <code>⨉</code>. does not apply if multiple notion windows are open. (default: false)</li>
|
||||
<li><strong>load theme.css</strong>: loads the custom colour theme file.
|
||||
see <a href="styling.html#colour-theming" title="">colour theming</a> for more information. (default: false)</li>
|
||||
<li><strong>use system emoji</strong>: reverts notion to using normal emojis, rather than the twitter emojiset. (default: false)</li>
|
||||
</ul>
|
||||
<p><img loading="lazy" src="screenshots/app-tray.jpg" alt="" title=""></p>
|
||||
<p><em>image: open application tray</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="styling">
|
||||
<h2>
|
||||
<a href="#styling">styling</a>
|
||||
</h2>
|
||||
<p>custom appearances can be applied to the app via the <code>resources/user.css</code> and <code>resources/theme.css</code> files. for more information,
|
||||
and a list of various optional styling changes, see <a href="styling.html#" title="">the page on styling</a>.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="other-details">
|
||||
<h2>
|
||||
<a href="#other-details">other details</a>
|
||||
</h2>
|
||||
<p>credit where credit is due, this was originally made by Uzver (github: <a href="https://github.com/TarasokUA#" title="">@TarasokUA</a>,
|
||||
telegram: <a href="https://t.me/UserFromUkraine#" title="">UserFromUkraine</a>, discord: Uzver#8760).
|
||||
he has approved my go-ahead with this fork, as he himself no longer wishes to continue development on the project.</p>
|
||||
<p>the notion logo belongs entirely to the notion team, and was sourced from their
|
||||
<a href="https://www.notion.so/Media-Kit-205535b1d9c4440497a3d7a2ac096286#" title="">media kit</a>.</p>
|
||||
<p>if you have any questions, check <a href="https://dragonwocky.me/#" title="">my website</a> for contact details.</p>
|
||||
|
||||
</section></div><footer class="footer"><hr><p><a href="https://github.com/dragonwocky/notion-enhancer/blob/master/README.md">Edit on GitHub</a> // © 2020 dragonwocky & Uzver, under the <a href="https://choosealicense.com/licenses/mit/">MIT license</a>.</p>
|
||||
</footer><nav><a class="next" href="styling.html">ᐅ</a></nav></article></div></body></html>
|
BIN
docs/notion.png
Before Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 183 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 306 KiB |
Before Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 221 KiB |
Before Width: | Height: | Size: 217 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 70 KiB |
@ -1,313 +0,0 @@
|
||||
<!DOCTYPE html><!-- Documentative--><!-- (c) 2020 dragonwocky <thedragonring.bod@gmail.com>--><!-- (https://dragonwocky.me/) under the MIT license--><html prefix="og: http://ogp.me/ns#"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>styling | notion enhancer</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro|Nunito+Sans"><link rel="stylesheet" href="docs.css"><script src="docs.js"></script><link rel="icon" href="notion.png" media="(prefers-color-scheme: dark)"><link rel="icon" href="notion.png"><meta name="title" content="styling | notion enhancer"><meta name="description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta name="theme-color" content="rgb(75, 133, 209)"><meta property="og:type" content="article"><meta property="og:url" content="https://dragonwocky.me/notion-enhancer/styling.html"><meta property="og:title" content="styling"><meta property="og:site_name" content="notion enhancer"><meta property="og:description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta property="og:image" content="https://dragonwocky.me/notion-enhancer/notion.png"><meta property="twitter:card" content="summary"></head><body><aside class="menu"><div><div class="title"><h1>notion enhancer</h1><picture class="icon"><source srcset="notion.png" media="(prefers-color-scheme: dark)"><img src="notion.png"></picture></div></div><ul class="nav"><li class="entry"><a href="index.html">notion enhancer</a></li><li class="entry"><a href="#styling">styling</a><ul><li class="level-2"><a href="#generalapp-wide">general/app-wide</a></li><li class="level-3"><a href="#colour-theming">colour theming</a></li><li class="level-3"><a href="#hide-discussions-comment-threads-at-the-top-of-each-page">hide discussions (comment threads at the top of each page)</a></li><li class="level-3"><a href="#custom-fonts">custom fonts</a></li><li class="level-3"><a href="#font-resizing">font resizing</a></li><li class="level-3"><a href="#wider-page-preview">wider page preview</a></li><li class="level-3"><a href="#thinner-cover-image">thinner cover image</a></li><li class="level-2"><a href="#tables">tables</a></li><li class="level-3"><a href="#table-columns-below-100px">table columns below 100px</a></li><li class="level-3"><a href="#hide--new-table-row">hide '+ new' table row</a></li><li class="level-3"><a href="#hide-calculations-table-row">hide calculations table row</a></li><li class="level-3"><a href="#centre-align-table-column-headers">centre-align table column headers</a></li><li class="level-3"><a href="#smaller-table-column-header-icons">smaller table column header icons</a></li><li class="level-3"><a href="#remove-icons-from-table-column-headers">remove icons from table column headers</a></li><li class="level-3"><a href="#removingdecreasing-side-padding-for-tables">removing/decreasing side padding for tables</a></li><li class="level-2"><a href="#boards">boards</a></li><li class="level-3"><a href="#hide--new-board-row">hide '+ new' board row</a></li><li class="level-3"><a href="#hide-board-view-hidden-columns">hide board view hidden columns</a></li><li class="level-3"><a href="#hide-board-view-add-a-group">hide board view 'add a group'</a></li><li class="level-3"><a href="#removingdecreasing-side-padding-for-boards">removing/decreasing side padding for boards</a></li></ul></li><li class="entry"><p>resources</p></li><li class="entry"><a href="changelog.html">changelog</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/blob/master/LICENSE">license</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/">github</a></li><li class="entry"><a href="https://dragonwocky.me/">me (dragonwocky)</a></li></ul><p class="mark"><a href="https://dragonwocky.me/documentative">docs by documentative</a></p></aside><div class="wrapper"><div class="toggle"><button>☰</button><h1>notion enhancer</h1></div><article class="documentative"><div class="content">
|
||||
|
||||
<section class="block" id="styling">
|
||||
<h1>
|
||||
<a href="#styling">styling</a>
|
||||
</h1>
|
||||
<p>to modify the appearance of the notion app, edit the style rules in <code>resources/user.css</code>,
|
||||
use some of the suggested/documented optional styles below, or invent your own.</p>
|
||||
<p>these styles are written in a language called "CSS". if you don't know what this is and are interested,
|
||||
check out some youtube videos or <a href="https://www.codecademy.com/learn/learn-css#" title="">try a free short course like the one on codecademy</a>.</p>
|
||||
<p>due to the enhancements directly fetching from the local CSS files,
|
||||
changes will be applied instantly on notion reload
|
||||
(no need to re-run <code>customiser.py</code> every time you want to change some styles).</p>
|
||||
<p>these should also work for the web version, if copied into your css customiser.</p>
|
||||
<p>css below will work for every instance of the element, but if you wish to hide only a specific element
|
||||
(e.g. the '+ new' table row) it is recommended that you prepend each selector with
|
||||
<code>[data-block-id='ID']</code>.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="generalapp-wide">
|
||||
<h2>
|
||||
<a href="#generalapp-wide">general/app-wide</a>
|
||||
</h2>
|
||||
<p><img loading="lazy" src="screenshots/app-enhanced.jpg" alt="" title=""></p>
|
||||
<p><em>image: the default post-customisation appearance</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="colour-theming">
|
||||
<h3>
|
||||
<a href="#colour-theming">colour theming</a>
|
||||
</h3>
|
||||
<p>this replaces the default notion dark theme. the provided theme file is my custom dark+ theme:
|
||||
if you have another you wish to share, please contact me. if a few themes are submitted i will
|
||||
set up a distribution method (either including them as optionally-enableabled themes or sharing them on the website).</p>
|
||||
<p>to enable, see the <a href="index.html#tray" title="">tray</a> options.</p>
|
||||
<p>to modify, enter the <code>theme.css</code> file and change the colour values within the <code>:root {}</code> - value names
|
||||
should describe what each colour will affect.</p>
|
||||
<p><img loading="lazy" src="screenshots/theme-dark+.jpg" alt="" title=""></p>
|
||||
<p><em>image: the dark+ theme</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="hide-discussions-comment-threads-at-the-top-of-each-page">
|
||||
<h3>
|
||||
<a href="#hide-discussions-comment-threads-at-the-top-of-each-page">hide discussions (comment threads at the top of each page)</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-page-view-discussion</span> {
|
||||
<span class="hljs-attribute">display</span>: none <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/discussion-default.jpg" alt="" title=""></p>
|
||||
<p><em>image: before styling</em></p>
|
||||
<p><img loading="lazy" src="screenshots/discussion-hidden.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="custom-fonts">
|
||||
<h3>
|
||||
<a href="#custom-fonts">custom fonts</a>
|
||||
</h3>
|
||||
<p><strong>the <code>@import</code> statement must be added to the top of the file (with nothing above it</strong>
|
||||
<strong>except comments or other <code>@import</code> statements)</strong></p>
|
||||
<p>to change the fonts, put the relevant URL in the <code>@import</code> statement and then change the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#" title="">font-family</a> property.
|
||||
plenty of other fonts that can be found on google fonts or that may be on your system already.</p>
|
||||
<pre><code class="lang-css"><span class="hljs-keyword">@import</span> url(<span class="hljs-string">'https://fonts.googleapis.com/css2?family=Fira+Code&family=Oxygen&family=Roboto+Slab:wght@300&display=swap'</span>);
|
||||
<span class="hljs-selector-class">.notion-app-inner</span> {
|
||||
<span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Oxygen'</span>, sans-serif <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'monospace;'</span>]</span> {
|
||||
<span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Fira Code'</span>, monospace <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">', serif;'</span>]</span> {
|
||||
<span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Roboto Slab'</span>, serif <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/fonts-custom.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="font-resizing">
|
||||
<h3>
|
||||
<a href="#font-resizing">font resizing</a>
|
||||
</h3>
|
||||
<p><strong>not recommended:</strong> this can mess up container sizes.
|
||||
it is suggested to instead use <code>ctrl+</code> or <code>ctrl-</code> to scale everything up/down.</p>
|
||||
<p>to change the size, change the value of <code>--font-scale</code>.</p>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-pseudo">:root</span> {
|
||||
<span class="hljs-attribute">--font-scale</span>: <span class="hljs-number">1.4</span>;
|
||||
}
|
||||
<span class="hljs-selector-class">.notion-app-inner</span> {
|
||||
<span class="hljs-attribute">font-size</span>: <span class="hljs-built_in">calc</span>(var(--font-scale) * <span class="hljs-number">16px</span>) <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'font-size: 40px'</span>]</span> {
|
||||
<span class="hljs-attribute">font-size</span>: <span class="hljs-built_in">calc</span>(var(--font-scale) * <span class="hljs-number">40px</span>) <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'font-size: 16px'</span>]</span> {
|
||||
<span class="hljs-attribute">font-size</span>: <span class="hljs-built_in">calc</span>(var(--font-scale) * <span class="hljs-number">16px</span>) <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'font-size: 14px'</span>]</span> {
|
||||
<span class="hljs-attribute">font-size</span>: <span class="hljs-built_in">calc</span>(var(--font-scale) * <span class="hljs-number">14px</span>) <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'font-size: 12px'</span>]</span> {
|
||||
<span class="hljs-attribute">font-size</span>: <span class="hljs-built_in">calc</span>(var(--font-scale) * <span class="hljs-number">12px</span>) <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'font-size: 11px'</span>]</span> {
|
||||
<span class="hljs-attribute">font-size</span>: <span class="hljs-built_in">calc</span>(var(--font-scale) * <span class="hljs-number">11px</span>) <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'font-size: 1.25em'</span>]</span> {
|
||||
<span class="hljs-attribute">font-size</span>: <span class="hljs-built_in">calc</span>(var(--font-scale) * <span class="hljs-number">1.25em</span>) <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/fonts-resized.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="wider-page-preview">
|
||||
<h3>
|
||||
<a href="#wider-page-preview">wider page preview</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-peek-renderer</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(2)</span> {
|
||||
<span class="hljs-attribute">max-width</span>: <span class="hljs-number">85vw</span> <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/preview-default.jpg" alt="" title=""></p>
|
||||
<p><em>image: before styling</em></p>
|
||||
<p><img loading="lazy" src="screenshots/preview-wider.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="thinner-cover-image">
|
||||
<h3>
|
||||
<a href="#thinner-cover-image">thinner cover image</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-attr">[style^=<span class="hljs-string">'position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; height: 30vh;'</span>]</span> {
|
||||
<span class="hljs-attribute">height</span>: <span class="hljs-number">12vh</span> <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style^=<span class="hljs-string">'position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; height: 30vh;'</span>]</span>
|
||||
<span class="hljs-selector-tag">img</span> {
|
||||
<span class="hljs-attribute">height</span>: <span class="hljs-number">12vh</span> <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/cover-default.jpg" alt="" title=""></p>
|
||||
<p><em>image: before styling</em></p>
|
||||
<p><img loading="lazy" src="screenshots/cover-thinner.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="tables">
|
||||
<h2>
|
||||
<a href="#tables">tables</a>
|
||||
</h2>
|
||||
<p><img loading="lazy" src="screenshots/table-before.jpg" alt="" title=""></p>
|
||||
<p><em>image: before styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="table-columns-below-100px">
|
||||
<h3>
|
||||
<a href="#table-columns-below-100px">table columns below 100px</a>
|
||||
</h3>
|
||||
<p><strong>not recommended!</strong> this may cause buggy viewing.
|
||||
as it is a per-table-column style, unlike all others here, it must be prepended with the block ID and repeated for each column.</p>
|
||||
<p>to see how to do this, watch <a href="https://www.youtube.com/watch?v=6V7eqShm_4w#" title="">this video</a>.</p>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-attr">[data-block-id^=<span class="hljs-string">'tableID'</span>]</span>
|
||||
> <span class="hljs-selector-attr">[style^=<span class="hljs-string">'display: flex; position: absolute; background: rgb(47, 52, 55); z-index: 82; height: 33px; color: rgba(255, 255, 255, 0.6);'</span>]</span>
|
||||
> <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(1)</span>
|
||||
> <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(COL_NUMBER)</span>
|
||||
> <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(1)</span>,
|
||||
<span class="hljs-selector-attr">[data-block-id^=<span class="hljs-string">'tableID'</span>]</span>
|
||||
> <span class="hljs-selector-attr">[style^=<span class="hljs-string">'position: relative; min-width: calc(100% - 192px);'</span>]</span>
|
||||
> <span class="hljs-selector-attr">[data-block-id]</span>
|
||||
> <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(COL_NUMBER)</span>,
|
||||
<span class="hljs-selector-attr">[data-block-id^=<span class="hljs-string">'tableID'</span>]</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(5)</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(COL_NUMBER)</span> {
|
||||
<span class="hljs-attribute">width</span>: <span class="hljs-number">32px</span> <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[data-block-id^=<span class="hljs-string">'tableID'</span>]</span>
|
||||
<span class="hljs-selector-attr">[style^=<span class="hljs-string">'position: absolute; top: 0px; left: 0px; pointer-events: none;'</span>]</span><span class="hljs-selector-pseudo">:not(.notion-presence-container)</span> {
|
||||
<span class="hljs-attribute">display</span>: none;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/table-columnunder100px.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="hide--new-table-row">
|
||||
<h3>
|
||||
<a href="#hide--new-table-row">hide '+ new' table row</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-table-view-add-row</span> {
|
||||
<span class="hljs-attribute">display</span>: none <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/table-hideaddrow.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="hide-calculations-table-row">
|
||||
<h3>
|
||||
<a href="#hide-calculations-table-row">hide calculations table row</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-table-view-add-row</span> + <span class="hljs-selector-tag">div</span> {
|
||||
<span class="hljs-attribute">display</span>: none <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/table-hidecalculationsrow.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="centre-align-table-column-headers">
|
||||
<h3>
|
||||
<a href="#centre-align-table-column-headers">centre-align table column headers</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-table-view-header-cell</span> > <span class="hljs-selector-tag">div</span> > <span class="hljs-selector-tag">div</span> {
|
||||
<span class="hljs-attribute">margin</span>: <span class="hljs-number">0px</span> auto;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/table-centredheaders.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="smaller-table-column-header-icons">
|
||||
<h3>
|
||||
<a href="#smaller-table-column-header-icons">smaller table column header icons</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-attr">[style^=<span class="hljs-string">'display: flex; position: absolute; background: rgb(47, 52, 55); z-index: 82; height: 33px; color: rgba(255, 255, 255, 0.6);'</span>]</span>
|
||||
<span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(1)</span>
|
||||
<span class="hljs-selector-tag">svg</span> {
|
||||
<span class="hljs-attribute">height</span>: <span class="hljs-number">10px</span> <span class="hljs-meta">!important</span>;
|
||||
<span class="hljs-attribute">width</span>: <span class="hljs-number">10px</span> <span class="hljs-meta">!important</span>;
|
||||
<span class="hljs-attribute">margin-right</span>: -<span class="hljs-number">4px</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/table-smallercolumnicons.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="remove-icons-from-table-column-headers">
|
||||
<h3>
|
||||
<a href="#remove-icons-from-table-column-headers">remove icons from table column headers</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-table-view-header-cell</span> <span class="hljs-selector-attr">[style^=<span class="hljs-string">'margin-right: 6px;'</span>]</span> {
|
||||
<span class="hljs-attribute">display</span>: none <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/table-hidecolumnicons.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="removingdecreasing-side-padding-for-tables">
|
||||
<h3>
|
||||
<a href="#removingdecreasing-side-padding-for-tables">removing/decreasing side padding for tables</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-attr">[style^=<span class="hljs-string">'flex-shrink: 0; flex-grow: 1; width: 100%; max-width: 100%; display: flex; align-items: center; flex-direction: column; font-size: 16px; color: rgba(255, 255, 255, 0.9); padding: 0px 96px 30vh;'</span>]</span>
|
||||
<span class="hljs-selector-class">.notion-table-view</span>,
|
||||
<span class="hljs-selector-attr">[class=<span class="hljs-string">'notion-scroller'</span>]</span> > <span class="hljs-selector-class">.notion-table-view</span> {
|
||||
<span class="hljs-attribute">padding-left</span>: <span class="hljs-number">35px</span> <span class="hljs-meta">!important</span>;
|
||||
<span class="hljs-attribute">padding-right</span>: <span class="hljs-number">15px</span> <span class="hljs-meta">!important</span>;
|
||||
<span class="hljs-attribute">min-width</span>: <span class="hljs-number">0%</span> <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-selector-attr">[style^=<span class="hljs-string">'flex-shrink: 0; flex-grow: 1; width: 100%; max-width: 100%; display: flex; align-items: center; flex-direction: column; font-size: 16px; color: rgba(255, 255, 255, 0.9); padding: 0px 96px 30vh;'</span>]</span>
|
||||
<span class="hljs-selector-class">.notion-selectable</span>
|
||||
<span class="hljs-selector-class">.notion-scroller</span><span class="hljs-selector-class">.horizontal</span><span class="hljs-selector-pseudo">::-webkit-scrollbar-track</span> {
|
||||
<span class="hljs-attribute">margin-left</span>: <span class="hljs-number">10px</span>;
|
||||
<span class="hljs-attribute">margin-right</span>: <span class="hljs-number">10px</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/table-shrinkpadding.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="boards">
|
||||
<h2>
|
||||
<a href="#boards">boards</a>
|
||||
</h2>
|
||||
<p><img loading="lazy" src="screenshots/board-default.jpg" alt="" title=""></p>
|
||||
<p><em>image: before styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="hide--new-board-row">
|
||||
<h3>
|
||||
<a href="#hide--new-board-row">hide '+ new' board row</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-board-group</span>
|
||||
<span class="hljs-selector-attr">[style=<span class="hljs-string">'user-select: none; transition: background 120ms ease-in 0s; cursor: pointer; display: inline-flex; align-items: center; flex-shrink: 0; white-space: nowrap; height: 32px; border-radius: 3px; font-size: 14px; line-height: 1.2; min-width: 0px; padding-left: 6px; padding-right: 8px; color: rgba(255, 255, 255, 0.4); width: 100%;'</span>]</span> {
|
||||
<span class="hljs-attribute">display</span>: none <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/board-hideaddnew.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="hide-board-view-hidden-columns">
|
||||
<h3>
|
||||
<a href="#hide-board-view-hidden-columns">hide board view hidden columns</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-board-view</span> > <span class="hljs-selector-attr">[data-block-id]</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-last-child(2)</span>,
|
||||
<span class="hljs-selector-class">.notion-board-view</span> > <span class="hljs-selector-attr">[data-block-id]</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:first-child</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-last-child(2)</span> {
|
||||
<span class="hljs-attribute">display</span>: none <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/board-hidehidden.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="hide-board-view-add-a-group">
|
||||
<h3>
|
||||
<a href="#hide-board-view-add-a-group">hide board view 'add a group'</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-board-view</span> > <span class="hljs-selector-attr">[data-block-id]</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:last-child</span>,
|
||||
<span class="hljs-selector-class">.notion-board-view</span> > <span class="hljs-selector-attr">[data-block-id]</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:first-child</span> > <span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:last-child</span> {
|
||||
<span class="hljs-attribute">display</span>: none <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/board-hideaddgroup.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="removingdecreasing-side-padding-for-boards">
|
||||
<h3>
|
||||
<a href="#removingdecreasing-side-padding-for-boards">removing/decreasing side padding for boards</a>
|
||||
</h3>
|
||||
<pre><code class="lang-css"><span class="hljs-selector-class">.notion-board-view</span> {
|
||||
<span class="hljs-attribute">padding-left</span>: <span class="hljs-number">10px</span> <span class="hljs-meta">!important</span>;
|
||||
<span class="hljs-attribute">padding-right</span>: <span class="hljs-number">10px</span> <span class="hljs-meta">!important</span>;
|
||||
}</code></pre>
|
||||
<p><img loading="lazy" src="screenshots/board-shrinkpadding.jpg" alt="" title=""></p>
|
||||
<p><em>image: after styling</em></p>
|
||||
|
||||
</section></div><footer class="footer"><hr><p><a href="https://github.com/dragonwocky/notion-enhancer/blob/master/STYLING.md">Edit on GitHub</a> // © 2020 dragonwocky & Uzver, under the <a href="https://choosealicense.com/licenses/mit/">MIT license</a>.</p>
|
||||
</footer><nav><a class="prev" href="index.html">ᐊ</a><a class="next" href="changelog.html">ᐅ</a></nav></article></div></body></html>
|
46
index.js
Normal file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (c) 2020 TarasokUA
|
||||
* (https://dragonwocky.me/notion-enhancer) under the MIT license
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
const meta = require('./package.json'),
|
||||
cli = require('cac')();
|
||||
|
||||
// '=== title ==='
|
||||
// ' ...information'
|
||||
// ' * warning'
|
||||
// ' > prompt'
|
||||
// ' ~~ exit'
|
||||
// '### error ###'
|
||||
|
||||
cli.option('-y, --yes', ': skip prompts (may overwrite data)');
|
||||
|
||||
cli
|
||||
.command('apply', ': add enhancements to the notion app')
|
||||
.action((options) => {
|
||||
require('./apply.js')(options.yes);
|
||||
});
|
||||
cli
|
||||
.command('remove', ': return notion to its pre-enhanced/pre-modded state')
|
||||
.action((options) => {
|
||||
require('./remove.js')(options.yes);
|
||||
});
|
||||
|
||||
cli.globalCommand.option('-h, --help', ': display usage information');
|
||||
cli.globalCommand.helpCallback = (sections) => {
|
||||
sections[0].body += '\nhttps://github.com/dragonwocky/notion-enhancer';
|
||||
};
|
||||
cli.showHelpOnExit = true;
|
||||
|
||||
cli.globalCommand.option('-v, --version', ': display version number');
|
||||
cli.globalCommand.versionNumber = meta.version;
|
||||
cli.showVersionOnExit = true;
|
||||
|
||||
cli.parse();
|
||||
|
||||
if (!cli.matchedCommand) cli.outputHelp();
|
BIN
notion.png
Before Width: | Height: | Size: 7.0 KiB |
169
package-lock.json
generated
Normal file
@ -0,0 +1,169 @@
|
||||
{
|
||||
"name": "notion-enhancer",
|
||||
"version": "0.8.0-beta",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@types/glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"@types/minimatch": "*",
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/minimatch": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
|
||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
|
||||
"optional": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.0.22",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.22.tgz",
|
||||
"integrity": "sha512-emeGcJvdiZ4Z3ohbmw93E/64jRzUHAItSHt8nF7M4TGgQTiWqFVGB8KNpLGFmUHmHLvjvBgFwVlqNcq+VuGv9g==",
|
||||
"optional": true
|
||||
},
|
||||
"asar": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/asar/-/asar-3.0.3.tgz",
|
||||
"integrity": "sha512-k7zd+KoR+n8pl71PvgElcoKHrVNiSXtw7odKbyNpmgKe7EGRF9Pnu3uLOukD37EvavKwVFxOUpqXTIZC5B5Pmw==",
|
||||
"requires": {
|
||||
"@types/glob": "^7.1.1",
|
||||
"chromium-pickle-js": "^0.2.0",
|
||||
"commander": "^5.0.0",
|
||||
"glob": "^7.1.6",
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"at-least-node": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
|
||||
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg=="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"cac": {
|
||||
"version": "6.5.12",
|
||||
"resolved": "https://registry.npmjs.org/cac/-/cac-6.5.12.tgz",
|
||||
"integrity": "sha512-XUhnXoAEdDCufbxn0U1vhbPKMoTx3D/D5Dcn8s0bOl6RZmYdxFE7TsWFbMqMMAqVFGhdbnZpXN+HosiuJiGfAQ=="
|
||||
},
|
||||
"chromium-pickle-js": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz",
|
||||
"integrity": "sha1-BKEGZywYsIWrd02YPfo+oTjyIgU="
|
||||
},
|
||||
"commander": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
|
||||
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg=="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz",
|
||||
"integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==",
|
||||
"requires": {
|
||||
"at-least-node": "^1.0.0",
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
|
||||
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw=="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz",
|
||||
"integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6",
|
||||
"universalify": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"universalify": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
|
||||
"integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug=="
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
}
|
||||
}
|
||||
}
|
38
package.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "notion-enhancer",
|
||||
"version": "0.8.0-beta",
|
||||
"description": "an enhancer/customiser for the all-in-one productivity workspace notion.so",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"notion-enhancer": "index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"no test specified\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dragonwocky/notion-enhancer.git"
|
||||
},
|
||||
"keywords": [
|
||||
"notion",
|
||||
"productivity",
|
||||
"mod",
|
||||
"loader",
|
||||
"enhancer",
|
||||
"hack",
|
||||
"macOS",
|
||||
"windows",
|
||||
"linux"
|
||||
],
|
||||
"author": "dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/dragonwocky/notion-enhancer/issues"
|
||||
},
|
||||
"homepage": "https://dragonwocky.me/notion-enhancer",
|
||||
"dependencies": {
|
||||
"asar": "^3.0.3",
|
||||
"cac": "^6.5.12",
|
||||
"fs-extra": "^9.0.1"
|
||||
}
|
||||
}
|
110
remove.js
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (https://dragonwocky.me/notion-enhancer) under the MIT license
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
const os = require('os'),
|
||||
fs = require('fs-extra'),
|
||||
path = require('path'),
|
||||
exec = require('util').promisify(require('child_process').exec),
|
||||
utils = require('./utils.js');
|
||||
|
||||
let __notion = utils.get_notion();
|
||||
|
||||
module.exports = async function (yes) {
|
||||
console.info('=== NOTION RESTORATION LOG ===');
|
||||
try {
|
||||
const file_operations = [];
|
||||
__notion = await __notion;
|
||||
|
||||
const app_folder = path.join(__notion, 'app');
|
||||
if (await fs.pathExists(app_folder)) {
|
||||
console.info(` ...removing folder ${app_folder}`);
|
||||
file_operations.push(fs.remove(app_folder));
|
||||
} else console.warn(` * ${app_folder} not found: step skipped.`);
|
||||
|
||||
const asar_bak = path.join(__notion, 'app.asar.bak');
|
||||
if (await fs.pathExists(asar_bak)) {
|
||||
console.info(' ...moving asar.app.bak to app.asar');
|
||||
|
||||
let write = true;
|
||||
if (await fs.pathExists(path.join(__notion, 'app.asar'))) {
|
||||
console.warn(' * app.asar already exists!');
|
||||
if (!yes) {
|
||||
do {
|
||||
process.stdout.write(' > overwrite? [Y/n]: ');
|
||||
write = await utils.readline();
|
||||
} while (write && !['y', 'n'].includes(write.toLowerCase()));
|
||||
write = !write || write.toLowerCase() == 'y';
|
||||
} else write = true;
|
||||
console.info(
|
||||
write
|
||||
? ' ...overwriting app.asar with app.asar.bak'
|
||||
: ' ...removing app.asar.bak'
|
||||
);
|
||||
}
|
||||
|
||||
file_operations.push(
|
||||
write
|
||||
? fs.move(asar_bak, path.join(__notion, 'app.asar'), {
|
||||
overwrite: true,
|
||||
})
|
||||
: fs.remove(asar_bak)
|
||||
);
|
||||
} else console.warn(` * ${asar_bak} not found: step skipped.`);
|
||||
|
||||
await Promise.all(file_operations);
|
||||
|
||||
if (
|
||||
[
|
||||
'/opt/notion-app', // https://aur.archlinux.org/packages/notion-app/
|
||||
'/opt/notion', // https://github.com/jaredallard/notion-app
|
||||
].includes(__notion)
|
||||
) {
|
||||
console.info(
|
||||
' ...patching app launcher (notion-app linux wrappers only).'
|
||||
);
|
||||
const bin_path = `/usr/bin/${(await __notion).split('/')[2]}`,
|
||||
bin_script = await fs.readFile(bin_path, 'utf8');
|
||||
if (!bin_script.includes('app.asar')) {
|
||||
await fs.outputFile(
|
||||
bin_path,
|
||||
bin_script.replace('electron app\n', 'electron app.asar\n')
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`### ERROR ###\n${err}`);
|
||||
}
|
||||
console.info(' ~~ success.');
|
||||
console.info('=== END OF LOG ===');
|
||||
};
|
||||
|
||||
// getNotion()
|
||||
// .then(async (__notion) => {
|
||||
// console.log(__notion);
|
||||
// await exec(
|
||||
// `"${__dirname}/node_modules/asar/bin/asar.js" extract "${__notion}/app.asar" "${__notion}/app"`
|
||||
// );
|
||||
// })
|
||||
// .catch((err) => console.log(err.message));
|
||||
|
||||
// if sys.platform == `linux` and `microsoft` not in platform.uname()[3].lower():
|
||||
// bin_path = `/usr/bin/notion-app` if os.path.exists(
|
||||
// `/usr/bin/notion-app`) else `/usr/bin/notion`
|
||||
// with open(bin_path, `r`, encoding=`UTF-8`) as launcher:
|
||||
// if `app.asar` not in launcher:
|
||||
// print(
|
||||
// f` ...patching app launcher`)
|
||||
// subprocess.call(
|
||||
// [`sed`, `-i`, r`s/electron\ app/electron\ app\.asar/`,
|
||||
// bin_path])
|
||||
|
||||
// print(f`\n{bold}>>> SUCCESSFULLY CLEANED <<<{normal}`)
|
||||
|
||||
// except Exception as e:
|
||||
// print(f`\n{bold}### ERROR (report this to dragonwocky#8449 on discord) ###{normal}\n{str(e)}`)
|
||||
|
||||
// print(f`\n{bold}=== END OF LOG ==={normal}`)
|
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" fill="none" viewBox="0 0 250 250"><path fill="#000" d="M124.859 234.52L67.5474 135.736H102.683V12.184H147.323V135.736H182.459L124.859 234.52Z"/></svg>
|
Before Width: | Height: | Size: 215 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" fill="none" viewBox="0 0 250 250"><path fill="#000" d="M102.683 234.52V110.968H67.5474L124.859 12.184L182.459 110.968H147.323V234.52H102.683Z"/></svg>
|
Before Width: | Height: | Size: 215 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" fill="none" viewBox="0 0 250 250"><line x1="21.393" x2="233.525" y1="229.525" y2="17.393" stroke="#000" stroke-miterlimit="4.139" stroke-width="30"/><line x1="17.607" x2="229.739" y1="17.393" y2="229.525" stroke="#000" stroke-linejoin="round" stroke-width="30"/></svg>
|
Before Width: | Height: | Size: 333 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" fill="none" viewBox="0 0 250 250"><path fill="#000" d="M14.7346 227.26V7.03998H235.215V227.26H14.7346ZM46.4546 195.8H203.495V70.48H46.4546V195.8Z"/></svg>
|
Before Width: | Height: | Size: 219 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" fill="none" viewBox="0 0 250 250"><path fill="#000" d="M16.1311 225.96V76.72H84.5111V8.07999H233.751V157.32H165.371V225.96H16.1311ZM110.771 53.58V76.72H165.371V131.32H207.491V53.58H110.771ZM42.3911 199.96H139.111V122.22H42.3911V199.96Z"/></svg>
|
Before Width: | Height: | Size: 309 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" fill="none" viewBox="0 0 250 250"><path fill="#000" d="M17.8021 138.04V106.072H232.074V138.04H17.8021Z"/></svg>
|
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 110 KiB |
@ -1,211 +0,0 @@
|
||||
/* === INJECTION MARKER === */
|
||||
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (c) 2020 TarasokUA
|
||||
* (https://dragonwocky.me/) under the MIT license
|
||||
*/
|
||||
|
||||
// adds: custom styles, nicer window control buttons
|
||||
|
||||
// DO NOT REMOVE THE MARKERS ABOVE.
|
||||
|
||||
require('electron').remote.getGlobal('setTimeout')(() => {
|
||||
const fs = require('fs'),
|
||||
path = require('path'),
|
||||
store = require(path.join(__dirname, '..', 'store.js'))({
|
||||
config: 'user-preferences',
|
||||
defaults: {
|
||||
openhidden: false,
|
||||
maximized: false,
|
||||
tray: false,
|
||||
theme: false,
|
||||
emoji: false,
|
||||
},
|
||||
}),
|
||||
isMac = process.platform === 'darwin';
|
||||
|
||||
const intervalID = setInterval(injection, 100);
|
||||
function injection() {
|
||||
if (document.querySelector('div.notion-topbar > div') == undefined) return;
|
||||
clearInterval(intervalID);
|
||||
|
||||
/* style injection */
|
||||
const head = document.getElementsByTagName('head')[0],
|
||||
css = ['user'];
|
||||
if (store.theme) css.push('theme');
|
||||
css.forEach((file) => {
|
||||
file = fs.readFileSync(`☃☃☃resources☃☃☃/${file}.css`); // will be set by python script
|
||||
let style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = file;
|
||||
head.appendChild(style);
|
||||
});
|
||||
document.body.classList.add('enhanced');
|
||||
|
||||
const appwindow = require('electron').remote.getCurrentWindow();
|
||||
|
||||
/* titlebar */
|
||||
const buttons = document.createElement('span'),
|
||||
dragarea = document.createElement('div');
|
||||
dragarea.className = 'window-dragarea';
|
||||
document.querySelector('.notion-topbar').prepend(dragarea);
|
||||
buttons.className = 'window-buttons-area';
|
||||
buttons.innerHTML = `
|
||||
<button class="window-button btn-alwaysontop"></button>
|
||||
`;
|
||||
if (!isMac)
|
||||
buttons.innerHTML += `
|
||||
<button class="window-button btn-minimize"></button>
|
||||
<button class="window-button btn-maximize"></button>
|
||||
<button class="window-button btn-close"></button>
|
||||
`;
|
||||
document
|
||||
.querySelector('.notion-topbar > div[style*="display: flex"]')
|
||||
.appendChild(buttons);
|
||||
document
|
||||
.querySelector('.notion-history-back-button')
|
||||
.parentElement.nextElementSibling.classList.add(
|
||||
'notion-topbar-breadcrumb'
|
||||
);
|
||||
document
|
||||
.querySelector('.notion-topbar-share-menu')
|
||||
.parentElement.classList.add('notion-topbar-actions');
|
||||
|
||||
const button_icons_raw = {
|
||||
alwaysontop_on: fs.readFileSync(
|
||||
'☃☃☃resources☃☃☃/icons/alwaysontop_on.svg'
|
||||
),
|
||||
alwaysontop_off: fs.readFileSync(
|
||||
'☃☃☃resources☃☃☃/icons/alwaysontop_off.svg'
|
||||
),
|
||||
minimize: fs.readFileSync('☃☃☃resources☃☃☃/icons/minimise.svg'),
|
||||
maximize_on: fs.readFileSync('☃☃☃resources☃☃☃/icons/maximise_on.svg'),
|
||||
maximize_off: fs.readFileSync('☃☃☃resources☃☃☃/icons/maximise_off.svg'),
|
||||
close: fs.readFileSync('☃☃☃resources☃☃☃/icons/close.svg'),
|
||||
},
|
||||
button_icons = {
|
||||
alwaysontop() {
|
||||
return appwindow.isAlwaysOnTop()
|
||||
? button_icons_raw.alwaysontop_on
|
||||
: button_icons_raw.alwaysontop_off; // '🠙' : '🠛'
|
||||
},
|
||||
minimize() {
|
||||
return button_icons_raw.minimize; // '⚊'
|
||||
},
|
||||
maximize() {
|
||||
return appwindow.isMaximized()
|
||||
? button_icons_raw.maximize_on
|
||||
: button_icons_raw.maximize_off; // '🗗' : '🗖'
|
||||
},
|
||||
close() {
|
||||
return button_icons_raw.close; // '⨉'
|
||||
},
|
||||
},
|
||||
button_actions = {
|
||||
alwaysontop() {
|
||||
appwindow.setAlwaysOnTop(!appwindow.isAlwaysOnTop());
|
||||
this.innerHTML = button_icons.alwaysontop();
|
||||
},
|
||||
minimize() {
|
||||
appwindow.minimize();
|
||||
},
|
||||
maximize() {
|
||||
appwindow.isMaximized()
|
||||
? appwindow.unmaximize()
|
||||
: appwindow.maximize();
|
||||
this.innerHTML = button_icons.maximize();
|
||||
},
|
||||
close(event = null) {
|
||||
if (
|
||||
store.tray &&
|
||||
require('electron').remote.BrowserWindow.getAllWindows().length ===
|
||||
1
|
||||
) {
|
||||
if (event) event.preventDefault();
|
||||
appwindow.hide();
|
||||
} else appwindow.close();
|
||||
},
|
||||
},
|
||||
button_elements = {
|
||||
alwaysontop: document.querySelector('.window-button.btn-alwaysontop'),
|
||||
minimize: document.querySelector('.window-button.btn-minimize'),
|
||||
maximize: document.querySelector('.window-button.btn-maximize'),
|
||||
close: document.querySelector('.window-button.btn-close'),
|
||||
};
|
||||
|
||||
button_elements.alwaysontop.innerHTML = button_icons.alwaysontop();
|
||||
button_elements.alwaysontop.onclick = button_actions.alwaysontop;
|
||||
|
||||
if (!isMac) {
|
||||
button_elements.minimize.innerHTML = button_icons.minimize();
|
||||
button_elements.minimize.onclick = button_actions.minimize;
|
||||
|
||||
button_elements.maximize.innerHTML = button_icons.maximize();
|
||||
button_elements.maximize.onclick = button_actions.maximize;
|
||||
setInterval(() => {
|
||||
if (button_elements.maximize.innerHTML != button_icons.maximize())
|
||||
button_elements.maximize.innerHTML = button_icons.maximize();
|
||||
}, 1000);
|
||||
|
||||
button_elements.close.innerHTML = button_icons.close();
|
||||
button_elements.close.onclick = button_actions.close;
|
||||
}
|
||||
|
||||
/* emoji */
|
||||
if (store.emoji) {
|
||||
const observer = new MutationObserver((list, observer) => {
|
||||
document
|
||||
.querySelectorAll('.notion-record-icon .notion-emoji')
|
||||
.forEach((el) => {
|
||||
el.outerHTML = `<span style="font-size: 0.9em; position: relative; bottom: 0.1em; right: 0.05em">
|
||||
${el.getAttribute('alt')}
|
||||
</span>`;
|
||||
});
|
||||
document.querySelectorAll('.notion-emoji').forEach((el) => {
|
||||
el.outerHTML = `<span>${el.getAttribute('alt')}</span>`;
|
||||
});
|
||||
});
|
||||
observer.observe(document, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
});
|
||||
}
|
||||
|
||||
/* update checker */
|
||||
fetch(
|
||||
`https://api.github.com/repos/dragonwocky/notion-enhancer/releases/latest`
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
const local_version = '☃☃☃version☃☃☃'.split('~')[0],
|
||||
repo_version = res.tag_name.slice(1);
|
||||
// compare func from https://github.com/substack/semver-compare
|
||||
if (
|
||||
local_version != repo_version &&
|
||||
[local_version, repo_version].sort((a, b) => {
|
||||
var pa = a.split('.');
|
||||
var pb = b.split('.');
|
||||
for (var i = 0; i < 3; i++) {
|
||||
var na = Number(pa[i]);
|
||||
var nb = Number(pb[i]);
|
||||
if (na > nb) return 1;
|
||||
if (nb > na) return -1;
|
||||
if (!isNaN(na) && isNaN(nb)) return 1;
|
||||
if (isNaN(na) && !isNaN(nb)) return -1;
|
||||
}
|
||||
return 0;
|
||||
})[0] == local_version
|
||||
)
|
||||
alert('notion-enhancer update available!');
|
||||
});
|
||||
|
||||
/* hotkey: reload window */
|
||||
document.defaultView.addEventListener(
|
||||
'keyup',
|
||||
(ev) => void (ev.code === 'F5' ? appwindow.reload() : 0),
|
||||
true
|
||||
);
|
||||
}
|
||||
}, 100);
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (c) 2020 TarasokUA
|
||||
* (https://dragonwocky.me/) under the MIT license
|
||||
*/
|
||||
|
||||
// a wrapper for accessing data stored in a JSON file.
|
||||
// editing this WILL break things if you don't know what you're doing.
|
||||
|
||||
const path = require('path'),
|
||||
fs = require('fs');
|
||||
|
||||
function getJSON(from) {
|
||||
try {
|
||||
return JSON.parse(fs.readFileSync(from));
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = (opts) => {
|
||||
opts = {
|
||||
config: 'user-preferences',
|
||||
defaults: {},
|
||||
...opts,
|
||||
};
|
||||
const config = path.join(__dirname, opts.config + '.json');
|
||||
return new Proxy(
|
||||
{},
|
||||
{
|
||||
get(obj, prop) {
|
||||
obj = { ...opts.defaults, ...getJSON(config) };
|
||||
return obj[prop];
|
||||
},
|
||||
set(obj, prop, val) {
|
||||
obj = { ...opts.defaults, ...getJSON(config) };
|
||||
obj[prop] = val;
|
||||
fs.writeFileSync(config, JSON.stringify(obj));
|
||||
return true;
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
@ -1,245 +0,0 @@
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (c) 2020 TarasokUA
|
||||
* (https://dragonwocky.me/) under the MIT license
|
||||
*/
|
||||
|
||||
:root {
|
||||
/** backgrounds **/
|
||||
--theme-main: rgb(5, 5, 5);
|
||||
--theme-sidebar: rgb(1, 1, 1);
|
||||
--theme-drag: #030303;
|
||||
--theme-primary: rgb(177, 24, 24);
|
||||
--theme-primary_hover: rgb(202, 26, 26);
|
||||
--theme-primary_click: rgb(219, 41, 41);
|
||||
--theme-primary_indicator: rgb(202, 26, 26);
|
||||
|
||||
/** databases **/
|
||||
--theme-card: rgb(4, 4, 4);
|
||||
--theme-card_border: rgba(10, 10, 10, 0.7);
|
||||
--theme-button: rgb(15, 15, 15);
|
||||
--theme-button_border: rgba(78, 78, 78, 0.7);
|
||||
--theme-table_border: rgba(255, 255, 255, 0.1);
|
||||
|
||||
/** scrollbars **/
|
||||
--theme-scrollbar: #232425;
|
||||
--theme-scrollbar_hover: #373838;
|
||||
|
||||
/** colours **/
|
||||
--theme-text_gray: rgba(151, 154, 155, 0.95);
|
||||
--theme-text_brown: rgb(147, 114, 100);
|
||||
--theme-text_orange: rgb(255, 163, 68);
|
||||
--theme-text_yellow: rgb(255, 220, 73);
|
||||
--theme-text_green: rgb(50, 169, 104);
|
||||
--theme-text_blue: rgb(82, 156, 202);
|
||||
--theme-text_purple: rgb(154, 109, 215);
|
||||
--theme-text_pink: rgb(226, 85, 161);
|
||||
--theme-text_red: rgb(218, 47, 35);
|
||||
--theme-bg_gray: rgba(126, 128, 129, 0.5);
|
||||
--theme-bg_brown: #50331f;
|
||||
--theme-bg_orange: rgba(255, 155, 0, 0.58);
|
||||
--theme-bg_yellow: rgba(183, 155, 0, 1);
|
||||
--theme-bg_green: rgb(50, 129, 47);
|
||||
--theme-bg_blue: rgba(0, 90, 146, 0.71);
|
||||
--theme-bg_purple: rgba(91, 49, 148, 0.74);
|
||||
--theme-bg_pink: rgba(243, 61, 159, 0.5);
|
||||
--theme-bg_red: rgb(122, 20, 20);
|
||||
--theme-line_gray: rgba(126, 128, 129, 0.301);
|
||||
--theme-line_brown: #50331fad;
|
||||
--theme-line_orange: rgba(255, 153, 0, 0.315);
|
||||
--theme-line_yellow: rgba(183, 156, 0, 0.445);
|
||||
--theme-line_green: rgba(50, 129, 47, 0.39);
|
||||
--theme-line_blue: rgba(0, 90, 146, 0.521);
|
||||
--theme-line_purple: rgba(90, 49, 148, 0.349);
|
||||
--theme-line_pink: rgba(243, 61, 158, 0.301);
|
||||
--theme-line_red: rgba(122, 20, 20, 0.623);
|
||||
}
|
||||
|
||||
/** backgrounds **/
|
||||
|
||||
.notion-dark-theme .window-dragarea {
|
||||
background: var(--theme-drag);
|
||||
}
|
||||
|
||||
[style*='background: rgb(55, 60, 63)'],
|
||||
[style*='background: rgba(69, 75, 78, 0.3)'] {
|
||||
background: var(--theme-sidebar) !important;
|
||||
}
|
||||
.notion-dark-theme .window-button,
|
||||
.notion-body.dark,
|
||||
[style*='background: rgb(47, 52, 55)'] {
|
||||
background: var(--theme-main) !important;
|
||||
}
|
||||
|
||||
/** databases **/
|
||||
|
||||
[style*='box-shadow: rgb(47, 52, 55) -3px 0px 0px'] {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.notion-table-view > :first-child > :first-child,
|
||||
.notion-dark-theme .window-button:hover,
|
||||
[style*='background: rgb(71, 76, 80)'],
|
||||
[style*='background: rgb(80, 85, 88)'],
|
||||
[style*='background: rgb(98, 102, 104)'] {
|
||||
background: var(--theme-button) !important;
|
||||
box-shadow: 0 0 0 0.5px var(--theme-button_border);
|
||||
}
|
||||
.window-button.btn-close:hover {
|
||||
background: #e81123 !important;
|
||||
}
|
||||
|
||||
[style*='background: rgb(63, 68, 71)'] {
|
||||
background: var(--theme-card) !important;
|
||||
}
|
||||
.notion-frame [style*='background: rgb(63, 68, 71)'] {
|
||||
border: 0.5px solid var(--theme-card_border);
|
||||
}
|
||||
|
||||
[style*='border-top: 1px solid rgba(255, 255, 255, 0.14)'],
|
||||
[style*='border-top: 1px solid rgba(255, 255, 255, 0.07)'] {
|
||||
border-top: 1px solid var(--theme-table_border) !important;
|
||||
}
|
||||
[style*='box-shadow: rgba(255, 255, 255, 0.14) -1px 0px 0px'] {
|
||||
box-shadow: var(--theme-table_border) -1px 0px 0px !important;
|
||||
}
|
||||
[style*='border-bottom: 1px solid rgba(255, 255, 255, 0.14)'],
|
||||
[style*='border-bottom: 1px solid rgba(255, 255, 255, 0.07)'] {
|
||||
border-bottom: 1px solid var(--theme-table_border) !important;
|
||||
}
|
||||
[style*='box-shadow: rgba(255, 255, 255, 0.14) 0px 1px 0px'] {
|
||||
box-shadow: var(--theme-table_border) 0px 1px 0px !important;
|
||||
}
|
||||
[style*='border-right: 1px solid rgba(255, 255, 255, 0.14)'],
|
||||
[style*='border-right: 1px solid rgba(255, 255, 255, 0.07)'] {
|
||||
border-right: 1px solid var(--theme-table_border) !important;
|
||||
}
|
||||
[style*='box-shadow: rgba(255, 255, 255, 0.07) 0px -1px 0px'] {
|
||||
box-shadow: var(--theme-table_border) 0px -1px 0px !important;
|
||||
}
|
||||
[style*='border-left: 1px solid rgba(255, 255, 255, 0.14)'],
|
||||
[style*='border-left: 1px solid rgba(255, 255, 255, 0.07)'] {
|
||||
border-left: 1px solid var(--theme-table_border) !important;
|
||||
}
|
||||
[style*='box-shadow: rgba(255, 255, 255, 0.14) 0px 1px 0px inset'] {
|
||||
box-shadow: var(--theme-table_border) 0px 1px 0px inset !important;
|
||||
}
|
||||
|
||||
/* scrollbars */
|
||||
|
||||
.notion-dark-theme ::-webkit-scrollbar-corner {
|
||||
background-color: transparent; /* for overlap */
|
||||
}
|
||||
.notion-dark-theme ::-webkit-scrollbar-thumb {
|
||||
border-radius: 5px;
|
||||
background-color: var(--theme-scrollbar);
|
||||
}
|
||||
.notion-dark-theme ::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--theme-scrollbar_hover);
|
||||
}
|
||||
|
||||
/** colours **/
|
||||
|
||||
[style*='background: rgb(46, 170, 220)'] {
|
||||
background: var(--theme-primary) !important;
|
||||
}
|
||||
[style*='background: rgb(6, 156, 205)'] {
|
||||
background: var(--theme-primary_hover) !important;
|
||||
}
|
||||
[style*='background: rgb(0, 141, 190)'] {
|
||||
background: var(--theme-primary_click) !important;
|
||||
}
|
||||
[style*='background: rgb(235, 87, 87)'] {
|
||||
background: var(--theme-primary_indicator) !important;
|
||||
}
|
||||
|
||||
[style*='color:rgba(151,154,155,0.95)'] {
|
||||
color: var(--theme-text_gray) !important;
|
||||
}
|
||||
[style*='background: rgba(151, 154, 155, 0.5)'],
|
||||
[style*='background:rgb(69,75,78)'] {
|
||||
background: var(--theme-bg_gray) !important;
|
||||
}
|
||||
[style*='background: rgb(69, 75, 78)'] {
|
||||
background: var(--theme-line_gray) !important;
|
||||
}
|
||||
[style*='color:rgb(147,114,100)'] {
|
||||
color: var(--theme-text_brown) !important;
|
||||
}
|
||||
[style*='background: rgba(147, 114, 100, 0.5)'],
|
||||
[style*='background:rgb(67,64,64)'] {
|
||||
background: var(--theme-bg_brown) !important;
|
||||
}
|
||||
[style*='background: rgb(67, 64, 64)'] {
|
||||
background: var(--theme-line_brown) !important;
|
||||
}
|
||||
[style*='color:rgb(255,163,68)'] {
|
||||
color: var(--theme-text_orange) !important;
|
||||
}
|
||||
[style*='background: rgba(255, 163, 68, 0.5)'],
|
||||
[style*='background:rgb(89,74,58)'] {
|
||||
background: var(--theme-bg_orange) !important;
|
||||
}
|
||||
[style*='background: rgb(89, 74, 58)'] {
|
||||
background: var(--theme-line_orange) !important;
|
||||
}
|
||||
[style*='color:rgb(255,220,73)'] {
|
||||
color: var(--theme-text_yellow) !important;
|
||||
}
|
||||
[style*='background: rgba(255, 220, 73, 0.5)'],
|
||||
[style*='background:rgb(89,86,59)'] {
|
||||
background: var(--theme-bg_yellow) !important;
|
||||
}
|
||||
[style*='background: rgb(89, 86, 59)'] {
|
||||
background: var(--theme-line_yellow) !important;
|
||||
}
|
||||
[style*='color:rgb(77,171,154)'] {
|
||||
color: var(--theme-text_green) !important;
|
||||
}
|
||||
[style*='background: rgba(77, 171, 154, 0.5)'],
|
||||
[style*='background:rgb(53,76,75)'] {
|
||||
background: var(--theme-bg_green) !important;
|
||||
}
|
||||
[style*='background: rgb(53, 76, 75)'] {
|
||||
background: var(--theme-line_green) !important;
|
||||
}
|
||||
[style*='color:rgb(82,156,202)'] {
|
||||
color: var(--theme-text_blue) !important;
|
||||
}
|
||||
[style*='background: rgba(82, 156, 202, 0.5)'],
|
||||
[style*='background:rgb(54,73,84)'] {
|
||||
background: var(--theme-bg_blue) !important;
|
||||
}
|
||||
[style*='background: rgb(54, 73, 84)'] {
|
||||
background: var(--theme-line_blue) !important;
|
||||
}
|
||||
[style*='color:rgb(154,109,215)'] {
|
||||
color: var(--theme-text_purple) !important;
|
||||
}
|
||||
[style*='background: rgba(154, 109, 215, 0.5)'],
|
||||
[style*='background:rgb(68,63,87)'] {
|
||||
background: var(--theme-bg_purple) !important;
|
||||
}
|
||||
[style*='background: rgb(68, 63, 87)'] {
|
||||
background: var(--theme-line_purple) !important;
|
||||
}
|
||||
[style*='color:rgb(226,85,161)'] {
|
||||
color: var(--theme-text_pink) !important;
|
||||
}
|
||||
[style*='background: rgba(226, 85, 161, 0.5)'],
|
||||
[style*='background:rgb(83,59,76)'] {
|
||||
background: var(--theme-bg_pink) !important;
|
||||
}
|
||||
[style*='background: rgb(83, 59, 76)'] {
|
||||
background: var(--theme-line_pink) !important;
|
||||
}
|
||||
[style*='color:rgb(255,115,105)'] {
|
||||
color: var(--theme-text_red) !important;
|
||||
}
|
||||
[style*='background: rgba(255, 115, 105, 0.5);'],
|
||||
[style*='background:rgb(89,65,65)'] {
|
||||
background: var(--theme-bg_red) !important;
|
||||
}
|
||||
[style*='background: rgb(89, 65, 65)'] {
|
||||
background: var(--theme-line_red) !important;
|
||||
}
|
@ -1,136 +0,0 @@
|
||||
/* === INJECTION MARKER === */
|
||||
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (c) 2020 TarasokUA
|
||||
* (https://dragonwocky.me/) under the MIT license
|
||||
*/
|
||||
|
||||
// adds: tray support (inc. context menu with settings), window toggle hotkey
|
||||
|
||||
// DO NOT REMOVE THE MARKERS ABOVE.
|
||||
// DO NOT CHANGE THE NAME OF THE 'enhancements()' FUNCTION.
|
||||
|
||||
let tray;
|
||||
|
||||
function enhancements() {
|
||||
const { Tray, Menu, nativeImage, app } = require('electron'),
|
||||
isMac = process.platform === 'darwin',
|
||||
isWin = process.platform === 'win32',
|
||||
path = require('path'),
|
||||
store = require(path.join(__dirname, '..', 'store.js'))({
|
||||
config: 'user-preferences',
|
||||
defaults: {
|
||||
openhidden: false,
|
||||
maximized: false,
|
||||
tray: false,
|
||||
theme: false,
|
||||
emoji: false,
|
||||
},
|
||||
});
|
||||
tray = new Tray(
|
||||
isWin
|
||||
? '☃☃☃resources☃☃☃/icons/windows.ico'
|
||||
: new nativeImage.createFromPath('☃☃☃resources☃☃☃/icons/tray.png').resize(
|
||||
{
|
||||
width: 16,
|
||||
height: 16,
|
||||
}
|
||||
)
|
||||
);
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
id: 'startup',
|
||||
label: 'Run on startup',
|
||||
type: 'checkbox',
|
||||
checked: electron_1.app.getLoginItemSettings().openAtLogin,
|
||||
click: () => {
|
||||
contextMenu.getMenuItemById('startup').checked
|
||||
? electron_1.app.setLoginItemSettings({ openAtLogin: true })
|
||||
: electron_1.app.setLoginItemSettings({ openAtLogin: false });
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'openhidden',
|
||||
label: 'Hide on open',
|
||||
type: 'checkbox',
|
||||
checked: store.openhidden,
|
||||
click: () => {
|
||||
store.openhidden = contextMenu.getMenuItemById('openhidden').checked;
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'maximized',
|
||||
label: 'Open maximised',
|
||||
type: 'checkbox',
|
||||
checked: store.maximized,
|
||||
click: () => {
|
||||
store.maximized = contextMenu.getMenuItemById('maximized').checked;
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'tray',
|
||||
label: 'Close to tray',
|
||||
type: 'checkbox',
|
||||
checked: store.tray,
|
||||
click: () => {
|
||||
store.tray = contextMenu.getMenuItemById('tray').checked;
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'theme',
|
||||
label: 'Load theme.css',
|
||||
type: 'checkbox',
|
||||
checked: store.theme,
|
||||
click: () => {
|
||||
store.theme = contextMenu.getMenuItemById('theme').checked;
|
||||
electron_1.BrowserWindow.getAllWindows().forEach((win) => win.reload());
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'emoji',
|
||||
label: 'Use system emoji',
|
||||
type: 'checkbox',
|
||||
checked: store.emoji,
|
||||
click: () => {
|
||||
store.emoji = contextMenu.getMenuItemById('emoji').checked;
|
||||
electron_1.BrowserWindow.getAllWindows().forEach((win) => win.reload());
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
},
|
||||
{
|
||||
label: 'Quit',
|
||||
role: 'quit',
|
||||
},
|
||||
]);
|
||||
tray.setContextMenu(contextMenu);
|
||||
tray.setToolTip('Notion Enhancements');
|
||||
|
||||
function showWindows() {
|
||||
const windows = electron_1.BrowserWindow.getAllWindows();
|
||||
if (isMac) app.show();
|
||||
if (store.maximized) windows.forEach((win) => [win.maximize()]);
|
||||
else windows.forEach((win) => win.show());
|
||||
app.focus({ steal: true });
|
||||
}
|
||||
function hideWindows() {
|
||||
const windows = electron_1.BrowserWindow.getAllWindows();
|
||||
windows.forEach((win) => [win.isFocused() && win.blur(), win.hide()]);
|
||||
if (isMac) app.hide();
|
||||
}
|
||||
tray.on('click', () => {
|
||||
const windows = electron_1.BrowserWindow.getAllWindows();
|
||||
if (windows.some((win) => win.isVisible())) hideWindows();
|
||||
else showWindows();
|
||||
});
|
||||
// hotkey will be set by python script
|
||||
electron_1.globalShortcut.register('CmdOrCtrl+Shift+A', () => {
|
||||
const windows = electron_1.BrowserWindow.getAllWindows();
|
||||
if (windows.some((win) => win.isFocused() && win.isVisible()))
|
||||
hideWindows();
|
||||
else showWindows();
|
||||
});
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (c) 2020 TarasokUA
|
||||
* (https://dragonwocky.me/) under the MIT license
|
||||
*/
|
||||
|
||||
/* titlebar */
|
||||
.notion-topbar {
|
||||
height: 55px !important;
|
||||
}
|
||||
.window-dragarea {
|
||||
height: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
.notion-light-theme .window-dragarea {
|
||||
background: #e6e6e6;
|
||||
}
|
||||
.notion-dark-theme .window-dragarea {
|
||||
background: #272d2f;
|
||||
}
|
||||
.window-buttons-area {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.notion-topbar {
|
||||
height: 95px !important;
|
||||
}
|
||||
.notion-topbar > :nth-child(2) {
|
||||
display: grid !important;
|
||||
height: 85px !important;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.window-buttons-area {
|
||||
grid-row: 1;
|
||||
grid-column: 9 / span end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.notion-topbar-breadcrumb {
|
||||
grid-row: 2;
|
||||
grid-column: 1 / span 8;
|
||||
}
|
||||
.notion-topbar-actions {
|
||||
grid-row: 2;
|
||||
grid-column: 9 / span end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
/* window control buttons */
|
||||
.window-button {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 0px 0px 0px 9px;
|
||||
width: 32px;
|
||||
line-height: 26px;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
transition-duration: 0.2s;
|
||||
cursor: default; /* -- not sure? on windows native window buttons have the default cursor,
|
||||
but other buttons in the titlebar have cursor: pointer */
|
||||
}
|
||||
.window-button svg {
|
||||
margin-top: 8px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
.window-button svg path {
|
||||
fill: currentColor;
|
||||
}
|
||||
.window-button svg line {
|
||||
stroke: currentColor;
|
||||
}
|
||||
.window-button.btn-close:hover {
|
||||
background: #e81123 !important;
|
||||
}
|
||||
.window-button.btn-close:hover svg line {
|
||||
stroke: white;
|
||||
}
|
||||
|
||||
/* window control buttons: light theme */
|
||||
.notion-light-theme .window-button {
|
||||
font-weight: bold;
|
||||
}
|
||||
.notion-light-theme .window-button:hover {
|
||||
background: rgb(239, 239, 239);
|
||||
}
|
||||
|
||||
/* window control buttons: dark theme */
|
||||
.notion-dark-theme .window-button:hover {
|
||||
background: rgb(71, 76, 80);
|
||||
}
|
||||
|
||||
/* scrollbar: pointer */
|
||||
.notion-scroller {
|
||||
cursor: auto;
|
||||
}
|
||||
/* scrollbar: size */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px; /* for vertical */
|
||||
height: 8px; /* for horizontal */
|
||||
}
|
||||
/* scrollbar: light theme */
|
||||
.notion-light-theme ::-webkit-scrollbar-corner {
|
||||
background-color: transparent; /* for overlap */
|
||||
}
|
||||
.notion-light-theme ::-webkit-scrollbar-thumb {
|
||||
border-radius: 5px;
|
||||
background-color: #d9d8d6;
|
||||
border: 1px solid #cacac8;
|
||||
}
|
||||
.notion-light-theme ::-webkit-scrollbar-thumb:hover {
|
||||
background: #cacac8;
|
||||
}
|
||||
/* scrollbar: dark theme */
|
||||
.notion-dark-theme ::-webkit-scrollbar-corner {
|
||||
background-color: transparent; /* for overlap */
|
||||
}
|
||||
.notion-dark-theme ::-webkit-scrollbar-thumb {
|
||||
border-radius: 5px;
|
||||
background-color: #505457;
|
||||
}
|
||||
.notion-dark-theme ::-webkit-scrollbar-thumb:hover {
|
||||
background: #696d6f;
|
||||
}
|
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 183 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 306 KiB |
Before Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 221 KiB |
Before Width: | Height: | Size: 217 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 70 KiB |
71
utils.js
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (c) 2020 TarasokUA
|
||||
* (https://dragonwocky.me/notion-enhancer) under the MIT license
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
const os = require('os'),
|
||||
fs = require('fs-extra'),
|
||||
exec = require('util').promisify(require('child_process').exec);
|
||||
|
||||
function is_wsl() {
|
||||
return (
|
||||
process.platform == 'linux' &&
|
||||
os.release().toLowerCase().includes('microsoft')
|
||||
);
|
||||
}
|
||||
|
||||
async function get_notion() {
|
||||
let folder = '';
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
folder = '/Applications/Notion.app/Contents/Resources';
|
||||
break;
|
||||
case 'win32':
|
||||
folder = process.env.LOCALAPPDATA + '\\Programs\\Notion\\resources';
|
||||
break;
|
||||
case 'linux':
|
||||
if (is_wsl()) {
|
||||
const { stdout } = await exec('cmd.exe /c echo %localappdata%'),
|
||||
drive = stdout[0];
|
||||
folder = `/mnt/${drive.toLowerCase()}${stdout
|
||||
.replace(/\\/g, '/')
|
||||
.slice(2)
|
||||
.trim()}/Programs/Notion/resources`;
|
||||
} else {
|
||||
for (let loc of [
|
||||
'/usr/lib/notion-desktop/resources', // https://github.com/davidbailey00/notion-deb-builder/
|
||||
'/opt/notion-app', // https://aur.archlinux.org/packages/notion-app/
|
||||
'/opt/notion', // https://github.com/jaredallard/notion-app
|
||||
]) {
|
||||
if (await fs.pathExists(loc)) folder = loc;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!folder)
|
||||
throw new Error(
|
||||
' ~~ platform not supported: exiting. open a request in the github repo:\n' +
|
||||
'https://github.com/dragonwocky/notion-enhancer/issues/new?assignees=&labels=enhancement&template=platform-support.md'
|
||||
);
|
||||
if (!(await fs.pathExists(folder)))
|
||||
throw new Error(
|
||||
' ~~ nothing found: exiting. notion install is either corrupted or non-existent.'
|
||||
);
|
||||
return folder;
|
||||
}
|
||||
|
||||
function readline() {
|
||||
return new Promise((res, rej) => {
|
||||
process.stdin.resume();
|
||||
process.stdin.setEncoding('utf8');
|
||||
process.stdin.on('data', (key) => {
|
||||
if (key === '\u0003') process.exit(); // CTRL+C
|
||||
process.stdin.pause();
|
||||
res(key.trim());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { get_notion, is_wsl, readline };
|