jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.49k stars 294 forks source link

ToDo List #251

Closed jarun closed 6 years ago

jarun commented 6 years ago

Continued from #233.

Notes

The list below is a growing one. While suggesting new features please consider contributing to Buku. The code is intentionally kept simple and easy to understand with comments. We'll be happy to assist any new contributor. We need your help!

Some of the fresh-baked features may not have been released yet. Grab the master branch for those.

Identified tasks

rachmadaniHaryono commented 6 years ago

related to idea on #255

example: https://github.com/rachmadaniHaryono/Buku/tree/feature/server

screenshots buku api - chromium_002 buku api - chromium_003 buku api - chromium_004

currently only for view function on bookmark and tags. the style is taken from bootstrap starter template https://getbootstrap.com/docs/3.3/examples/starter-template/

there could be more advanced feature such whitelist/blacklist tag, so there will be + or - sign after the tag to do that

tom-i commented 6 years ago

Looks pretty awesome, @rachmadaniHaryono are you going to integrate function for having buku-server on some other network place (server) than localhost?

jarun commented 6 years ago

Awesome!!! We must have it in the main project :). Probably we can add a directory named buku_server and have the implementation there. Slowly you can add the functionality we have in core. I am pathetic with GUI stuff but I believe we will get contributors as we keep adding ToDo items.

rachmadaniHaryono commented 6 years ago

i haven't tried with other but you can put it on 0.0.0.0 so other device can reach it

https://stackoverflow.com/questions/31904761/what-does-app-runhost-0-0-0-0-mean-in-flask

so run the command like this

bukuserver run --host 0.0.0.0

see also more run option with bukuserver run --help

e: command is changed from buku-api to bukuserver

rachmadaniHaryono commented 6 years ago

Probably we can add a directory named buku_server and have the implementation there

imo we can rename the api folder to buku_api or buku_server and change the setup for the new path. the name api is too common and may conflict with other package

e:

I am pathetic with GUI stuff but I believe we will get contributors as we keep adding ToDo items.

i am also learning and most of this is done with less html and without javascript for now.

e2: changed both folder and command to bukuserver

jarun commented 6 years ago

buku_server would be fine.

Where do I run the command buku-api run --host 0.0.0.0 in your tree?

rachmadaniHaryono commented 6 years ago

first just install it in your virtualenv

pip install -e .
pip install -e .[server]

the run the command

jarun commented 6 years ago

buku_server would be fine.

I meant we can rename api to buku_server.

the run the command

cool!

rachmadaniHaryono commented 6 years ago

should the command be changed as well (from buku-api to buku-server)?

jarun commented 6 years ago

How about bukuserver in both cases?

rachmadaniHaryono commented 6 years ago

done, will edit recent comment to match new command

tom-i commented 6 years ago

@rachmadaniHaryono What am I doing wrong? :-(

(env) $ pip install -e .[server]
Obtaining file:///home/tomik/programs/buku/Buku
  buku 3.6 does not provide the extra 'server'
Installing collected packages: buku
  Found existing installation: buku 3.6
    Uninstalling buku-3.6:
      Successfully uninstalled buku-3.6
  Running setup.py develop for buku
Successfully installed buku
(env) $ bukuserver run --host 0.0.0.0
bash: bukuserver: command not found

EDIT: Ok after some missing modules in virtualenv I finally can run:

./server.py run

Unfortunatelly there is 404 on page:

(env) [api] $ ./server.py run
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [23/Mar/2018 23:21:07] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [23/Mar/2018 23:21:07] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [23/Mar/2018 23:21:18] "GET /bookmarks HTTP/1.1" 404 -
127.0.0.1 - - [23/Mar/2018 23:21:19] "GET /favicon.ico HTTP/1.1" 404 -
rachmadaniHaryono commented 6 years ago

@tom-i

also this is optional, but report if favicon is still showing error

jarun commented 6 years ago

Sorry, Friday night is family movie time and I was off the terminal! :) We watched Paddington 2.

I guess we need to document all the steps under a README.md under bukuserver directory and link to it from the main README.md. Not urgent, but eventually.

rachmadaniHaryono commented 6 years ago

For documentation I can only think of 2 points

I just realize that on ubuntu installation it is recommended to install from ppa. I haven't check if required server package is on ppa so I recommend only to install from pip for now


Also maybe inform user that this feature is still on experimental stage

jarun commented 6 years ago

:+1:

tom-i commented 6 years ago

Hi @rachmadaniHaryono, I've looked to that git show and I had this one.. so not yours :-/ I don't know, how is it possible

commit 474c403521f89798952ac1c5e4b7c09546411487 (HEAD -> master, origin/master, origin/HEAD)
Author: rachmadani haryono <rachmadaniHaryono@users.noreply.github.com>
Date:   Fri Mar 23 11:30:13 2018 +0800

but git pull shows me: Already up to date

also entry_points have not that last part about 'bukuserver=bukuserver.server:cli' and extras_require there is missing 'server': server_require,

So it looks, that I'm using wrong commit or so :-/ Because I have there api folder and not bukuserver as you have it in your git repository :(

Buku [ ls -l                                                                                                                               master * ] 10:55 AM
total 296
-rw-r--r-- 1 tomik tomik  14461 Mar 23 22:04 CHANGELOG
-rw-r--r-- 1 tomik tomik  35142 Mar 23 22:04 LICENSE
-rw-r--r-- 1 tomik tomik    125 Mar 23 22:04 MANIFEST.in
-rw-r--r-- 1 tomik tomik    508 Mar 23 22:04 Makefile
-rw-r--r-- 1 tomik tomik  22988 Mar 23 22:04 README.md
drwxr-xr-x 2 tomik tomik   4096 Mar 23 22:33 __pycache__
drwxr-xr-x 4 tomik tomik   4096 Mar 23 23:12 api
drwxr-xr-x 5 tomik tomik   4096 Mar 23 22:04 auto-completion
-rw-r--r-- 1 tomik tomik  24529 Mar 23 22:04 buku.1
drwxr-xr-x 2 tomik tomik   4096 Mar 23 22:22 buku.egg-info
-rwxr-xr-x 1 tomik tomik 145022 Mar 23 22:04 buku.py
drwxr-xr-x 3 tomik tomik   4096 Mar 23 22:04 docs
drwxr-xr-x 5 tomik tomik   4096 Mar 23 23:05 env
-rw-r--r-- 1 tomik tomik   1531 Mar 23 22:04 packagecore.yaml
-rw-r--r-- 1 tomik tomik     58 Mar 23 22:04 requirements.txt
-rwxr-xr-x 1 tomik tomik   1877 Mar 23 22:22 setup.py
drwxr-xr-x 2 tomik tomik   4096 Mar 23 22:04 tests
-rw-r--r-- 1 tomik tomik   1042 Mar 23 22:04 tox.ini

EDIT: Aha.. I'm using @jarun git repository :-/ But it's strange I thought that I've used @rachmadaniHaryono :-/ I'll try to repair it..

rachmadaniHaryono commented 6 years ago

Try this to get server branch https://stackoverflow.com/questions/9153598/how-do-i-fetch-a-branch-on-someone-elses-fork-on-github

E: you can also add other fork to your local git repo. See git remote add

tom-i commented 6 years ago
buku/Buku [ git remote add rachmadaniHaryono https://github.com/rachmadaniHaryono/Buku.git
buku/Buku [ git fetch rachmadaniHaryono                                                                                                                 master ] 11:05 AM
From https://github.com/rachmadaniHaryono/Buku
 * [new branch]      feature/codecov                    -> rachmadaniHaryono/feature/codecov
 * [new branch]      feature/exception-on-malformed-url -> rachmadaniHaryono/feature/exception-on-malformed-url
 * [new branch]      feature/fix-idx                    -> rachmadaniHaryono/feature/fix-idx
 * [new branch]      feature/fix-server                 -> rachmadaniHaryono/feature/fix-server
 * [new branch]      feature/release-branch             -> rachmadaniHaryono/feature/release-branch
 * [new branch]      feature/server                     -> rachmadaniHaryono/feature/server
 * [new branch]      master                             -> rachmadaniHaryono/master
buku/Buku [ git checkout -b rachmadaniHaryono/Buku                                                                                                      master ] 11:07 AM
Switched to a new branch 'rachmadaniHaryono/Buku'
buku/Buku [ git pull rachmadaniHaryono/Buku                                                                                             rachmadaniHaryono/Buku ] 11:08 AM
fatal: 'rachmadaniHaryono/Buku' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What should I put to pull?

rachmadaniHaryono commented 6 years ago

You can checkout the branch git checkout rachmadaniHaryono/feature/server

tom-i commented 6 years ago

@rachmadaniHaryono I'm noob with this, anyway how to pull your branch?

buku/Buku [ git pull                                                    rachmadaniHaryono/feature/server ] 6:11 PM
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=<remote>/<branch> rachmadaniHaryono/feature/server

I'm using yours, but git pull or git pull rachmadaniHaryono/feature/server doesn't do anything :-/

jarun commented 6 years ago

Try

git remote add upstream ...

Otherwise, wait till we merge this on Buku master branch and then you can test it out much easily.

tom-i commented 6 years ago

Hmm doesn't help. How long that merge will take, please? A week?

jarun commented 6 years ago

We don't know at this moment. Please have patience.

rachmadaniHaryono commented 6 years ago
git remote add rachmadaniHaryono https://github.com/rachmadaniHaryono/Buku.git
git checkout rachmadaniHaryono
git checkout -b rh-server rachmadaniHaryono/feature/server

That will create rh-server branch on you local repo

Currently I don't have my laptop until few hours later, so please check the command again

tom-i commented 6 years ago

@rachmadaniHaryono ha.. cool that helps ;) Now I see that page with my bookmarks ;) Tomorrow, I'll try to install it on my EspressoBin server, to check if it's working with --host 0.0.0.0 ;) Thx man..

rachmadaniHaryono commented 6 years ago

note on doc conversion for pypi upload

2 example from last time (#233) is already fixed directly by pypandoc

now it seems example 1 to 9 is not formatted correctly

see https://test.pypi.org/project/buku/3.7/

pypandoc seems merge some line on one of those example

other than that removing raw html part should make generated rst file ready to upload

jarun commented 6 years ago

Fine by me. Not a major issue.

RyanRLong commented 6 years ago

@jarun FYI, not sure if anyone else is working on it yet, but I plan on having a PR for paging this weekend.

jarun commented 6 years ago

@SaltyCatFish that would be awesome!

tsaoyu commented 6 years ago

Any interests on orgmode markdown .org export? So that bookmarks can be integrated with GTD.

jarun commented 6 years ago

So that bookmarks can be integrated with GTD.

which service is GTD?

tsaoyu commented 6 years ago

@jarun GTD, stand for get things done, here it is not a service but a way to manage bookmarks within personal workflow. Suppose we come across GitHub.com and we want to read it in the future. It is easy to do so with orgmode by exporting .org list from buku. See example here

jarun commented 6 years ago

OK, I have an idea now. How about importing a .org file? Also, would you raise a PR for this?

jarun commented 6 years ago

@SaltyCatFish can you please let us know how you are planning to implement paging? We can have a short review of the design and all of us can be on the same page as to what we expect. Please raise an issue for the discussion and add the details so we can review it.

RyanRLong commented 6 years ago

Will do.

On Fri, Mar 30, 2018, 9:37 AM Arun Prakash Jana notifications@github.com wrote:

@SaltyCatFish https://github.com/SaltyCatFish can you please let us know how you are planning to implement paging? We can have a short review of the design and all of us can be on the same page as to what we expect. Please raise an issue for the discussion and add the details so we can review it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jarun/Buku/issues/251#issuecomment-377525749, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5IH9GQZRt9b-6PeIhmrSuI6NsFZxWpks5tjjUYgaJpZM4St7lU .

rachmadaniHaryono commented 6 years ago

This means release branch can be deleted and no conversion needed for next release

jarun commented 6 years ago

👍

jarun commented 6 years ago

@SaltyCatFish any update on the paging task?

RyanRLong commented 6 years ago

Sorry, not yet.

jarun commented 6 years ago

No problem! I know it's tricky. You can get some clues from ddgr interface and code.

Thanks for the update!

RyanRLong commented 6 years ago

Awesome, thanks!

jarun commented 6 years ago

@SaltyCatFish any update on paging?

RyanRLong commented 6 years ago

No, I've bit off a bit more than I can chew with some other projects. I still hope to spend some quality time with the code base this week, but if anyone else wants to tackle this request, feel free.

jarun commented 6 years ago

if anyone else wants to tackle this request, feel free

I don't think it's happening... even I have one pending task and I can't find time due to other things... but please try to spare some time on it.

RyanRLong commented 6 years ago

@jarun How should this work? Does the user type "buku -paging-option 10 20" to see rows 10 - 20, or do you want a something like unixs less/more?

jarun commented 6 years ago

The results should be paged:

buku -n 10 ...

should show 10 results per page and one should be able to navigate with the n and p keys at the prompt. Just run googler and ddgr for a feel of it.

rachmadaniHaryono commented 6 years ago

1_011

https://github.com/rachmadaniHaryono/Buku/tree/feature/statistic

no link yet to statistic page and user have to go directly e.g. 127.0.0.1:5000/statistic

the chart is using chartjs from http://chartjs.org/docs/latest/

it can more expanded, e.g.

FUN idea: Badge:


here is kinda concept that i imagine for additional feature on bukuserver. user/developer/thirdparty can add plugin which can be shown on each page.

this is kinda tricky because

jarun commented 6 years ago

We do not track usage data. If we want to have this feature (and it looks great) we should have it disabled by default and enable only if user wants it.

plugin

there are issues around the DB desing as well shared DB: pugin may corrupt it separate DB: plugin may get out of sync

rachmadaniHaryono commented 6 years ago

We do not track usage data. If we want to have this feature (and it looks great) we should have it disabled by default and enable only if user wants it.

Not quite sure if this is categorized as tracking usage data, because all data calculated each time per request and the result is not saved anywhere. Also no other database request other the first time getting all records. So Imo opinion it is similar to display number of your bookmarks

Of course unless the flask bootstrap or the included chart.js is compromised, it will be different story

should have it disabled by default and enable only if user wants it.

There is several way I can think of to do this

dB

I have no idea how to approach this. I imagine that the new side database never hold any buku index and buku dB is always prioritized (except some exceptional case). The disadvantage is more database request

The side database can hold url, tag, title and produce/process something about it.

E.g.Url icon plugin (or something similar). first server get requested url after that looking for paired icon in side database


But still this is just some idea because I think it is already out of scope of what buku should be.

If people really want it may have to create another repo for this