jarun / buku

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

ToDo list #343

Closed jarun closed 3 years ago

jarun commented 5 years ago

Continued from #268.

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 4 years ago

can you fix the travis test @Aquan1412?

also can you made test case for this? if you can't just tell us

Aquan1412 commented 4 years ago

The tests should be fixed now. Regarding a new test case: I'm not sure how to do it properly. I could just copy "test_import_md()" and adjust that accordingly?

rachmadaniHaryono commented 4 years ago

yes @Aquan1412

you can copy the test and change test method if it is different

if it is just parameter, use that pytest.mark.parametrize

see pytest documentation

Aquan1412 commented 4 years ago

Ok, I added the new test, and all the tests run successfully now, @rachmadaniHaryono

sergeevabc commented 4 years ago

Windows 7 x64, Python 3.8.1

$ pip3 install buku
$ buku
Traceback (most recent call last):
  File "c:\python\lib\site-packages\buku.py", line 43, in <module>
    import readline
ModuleNotFoundError: No module named 'readline'
jarun commented 4 years ago

We probably need to handle ModuleNotFoundError along with ImportError. Please raise a PR.

sergeevabc commented 4 years ago

@jarun, raise what? I am a mere user w/o prep who cares that tech serves people, not nerds only.

tom-i commented 4 years ago

Hi guys, is there any possibility how to secure bukuserver from internet?

jarun commented 4 years ago

@sergeevabc

raise what? I am a mere user w/o prep who cares that tech serves people, not nerds only.

I don't care who you are and what you care. I don't have any free time to implement this and I don't have Windows.

@tom-i

Hi guys, is there any possibility how to secure bukuserver from internet?

No plans for now as far as I know. @rachmadaniHaryono anything in that line?

sergeevabc commented 4 years ago

@jarun, thanks for being straightforward, your “don't care” attitude towards profane feedback is surely something broader audience should be aware of when choosing an everyday tool, recommending it to try, or even feeling an urge to donate.

Dear Windows users, I found a solution for “readline” issue on Stackoverflow: pip install pyreadline Perhaps this so-called developer can grow a conscience and conditionally include it in the main package.

jarun commented 4 years ago

@sergeevabc

As I have a open project available you have the advantage of adding whatever comments you want hoping people would see the dev of the project in that light. Once again, I am least bothered.

The problem I have with is your attitude in the following line:

raise what?

I checked your account now. You know what a PR is. What do you mean raise what? Learn to respect the time and effort of others. I do this project spending my free time and I have the right to contribute to it or not to fix stuff that I do not use - like Python 3.8 or Windows.

When I politely requested you to raise a PR the intention was to get it fixed for you as soon as possible, You have Windows, you have Python 3.8. I also explained what you need to do. If you do not have the time you could have just mentioned that.

jarun commented 4 years ago

Also, go and use profanity to litter your own projects, not mine.

rachmadaniHaryono commented 4 years ago

[part removed]

i want to comment about second comment from sergeevabc but second last comment from jarun already fixed answer that


i think we can add the fix from sergeevabc on next release by adding pyreadline package for windows installation

as i also don't have window dev, i hope someone can test it if i create pr for it (maybe tommorow)


i'm quite confused with error text because i thought ModuleNotFoundError should be catched when the program catch ImportError even if pyreadline is not installed it should be error on pyreadline import line not readline import line

example run on python3.6

>>> try:
>>>     print('hello')
>>>     raise ModuleNotFoundError
>>> except ImportError:
>>>     print('error')
>>>
hello
error

ModuleNotFoundError is only on 3.6, so if we want to catch that, we have to increase python version requirement

(e: while first part is true, there maybe a way to handle both on python 3.5, and 3.6+)


Hi guys, is there any possibility how to secure bukuserver from internet?

No plans for now as far as I know. @rachmadaniHaryono anything in that line?

because the reverse proxy feature is already added, imo it should be login feature. with this only people with the password can change your bookmark if you host it.

related package https://github.com/maxcountryman/flask-login

ping @tom-i

tom-i commented 4 years ago

@rachmadaniHaryono thx man, I'm going to try that ;)

rachmadaniHaryono commented 4 years ago

task for this wiki section

https://github.com/jarun/buku/wiki/Buku-as-a-library

thepenguinthatwants commented 4 years ago

How to backup or restore the saved bookmarks? Normally I thought that

buku -w Would be reading and saving from a file. But now it seems that it most likely saves to the database? Any way to easily backup or restore the bookmarks?

rachmadaniHaryono commented 4 years ago

not sure if it is the answer but there is user who use git to backup buku everytime buku command invoked

https://github.com/jarun/buku/issues/308

jarun commented 4 years ago

You can also store the actual database file in a synced cloud storage directory and have a symlink to the file at the location buku looks for.

bitozoid commented 4 years ago

This is just an idea. Think of a wiki. A wiki consists of a set of nodes, every node with an id, a title and a content, and in the content you may found references to others ids. Think of a Zettelkasten. It consists of a set of nodes (zettel, cards), every node with an id, maybe a title, a content with references to others ids, and a link to an external source (a book). I wonder whether buku could be used like those ones. The description could hold references to other entries. And maybe the link could be any URI (e.g. a book or specification URN). I wonder whether there is an unique ID for every entry that could be referenced in the description, or any other field.

jarun commented 4 years ago

The url is the unique thing and tags relate the bookmarks.

bitozoid commented 4 years ago

How about is the url is slightly modified? The "link" from one entry to the other would be missing. Tags relate bookmarks, but they do not point other specific entries.

jarun commented 4 years ago

other specific entries

Can you please elaborate?

bitozoid commented 4 years ago

The point is to create a "brain" of bookmark entries linked among them, where every bookmark entry has a description and internal links to other bookmark entries. A bookmark entry may have tags, but its tags do not work as pointers to other named bookmark entries (they would refer to every entry that has that tag). Is my point clearer? Anyway it is just an idea.

jarun commented 4 years ago

I think it will make the solution over-complicated. We have extensive search facilities already and I am of the opinion that the types of search is more than adequate to find a bookmark.

@rachmadaniHaryono what do you think?

rachmadaniHaryono commented 4 years ago

for buku itself imo kinda hard due to terminal user interface

for bukuserver it may have work by creating custom text-to-html, which will link any matching text to another entry (e.g. reddit r/subreddit text)

Unknow0059 commented 4 years ago

Does bukuserver have a Grid View? Or even something like Windows' File Explorer List View?

The concept of an offline bookmark manager is one that I love because most alternatives are webapps intent on using your data and/or being a social platform, but I need an alternative because the list-based approach used by browsers to manage bookmarks doesn't show enough bookmarks at once, making managing difficult.

jarun commented 4 years ago

@rachmadaniHaryono do you have any plans for a grid-based view?

rachmadaniHaryono commented 4 years ago

grid based view

while it is possible, i'm not good enough in html to hack flask admin that. i may try but i will not promise anything

but i will love if bukuserver can what shiori does https://github.com/go-shiori/shiori

Windows' File Explorer List View

https://i.stack.imgur.com/BW7xN.png

i kinda confused with this because i have no idea how does each item will look like

doesn't show enough bookmarks at once, making managing difficult.

increase bookmarks per page config here https://github.com/jarun/buku/tree/master/bukuserver#configuration

Unknow0059 commented 4 years ago

but i will love if bukuserver can what shiori does https://github.com/go-shiori/shiori

Yeah it'd be nice. I tried shiori but it just offers nothing when it comes to actual management.

Windows' File Explorer List View

https://i.stack.imgur.com/BW7xN.png

i kinda confused with this because i have no idea how does each item will look like

Wdym? You mean you're not sure how to implement the max length of each column list? You can truncate it to a variable limit. e.g. a limit of 20 (or any chosen number) characters per item, then after that you just get ellipsis.

rachmadaniHaryono commented 4 years ago

Wdym? You mean you're not sure how to implement the max length of each column list? You can truncate it to a variable limit.

e.g. a limit of 20 (or any chosen number) characters per item, then after that you just get ellipsis.

so just url (or shortened one or click/hover to see full url) on single line. that maybe simple enough

Unknow0059 commented 4 years ago

so just url (or shortened one or click/hover to see full url) on single line. that maybe simple enough

Title, then URL displayed on hover

klartext commented 4 years ago

Any idea on using different database-files? Found a feature in the list, which supports it internall, but not for usage. Planned to add that?

OK, found it in the operational notes. It was not mentioned in the output of --help. This is intended (because of "Manual usage is prone to issues arising from human error.")?

jarun commented 4 years ago

Yes, it is intended. Use at your own risk.

klartext commented 4 years ago

Yes, it is intended. Use at your own risk.

I think -d switch to delete the whole database is rather a risk to destroy the data than -db to use a different database-file.

2ynn commented 4 years ago

I use bookmark folders extensively on firefox (rarely tags) and use the "Add parent folder names as tags" option when importing automatically from firefox. I am interested in preserving my folder tree structure and have it reflected in the sequence of comma separated tags. I therefore removed sorted() in the parse_tags function. buku line 3687: unique_tags = set(orig_tags)

Is there any side effects from doing this?

Thanks for the great work!

jarun commented 4 years ago

Is there any side effects from doing this?

I am not sure. Never tested it this way. If your search results are fine maybe it works.

2ynn commented 4 years ago

Thanks for your reply. Actually my solution doesn't work as set() does not preserve the insertion order from the orig_tags list. Instead, I am now directly returning the orig_tags list (wrapped with delimiter). My search results seem to work fine. I suppose I could run into issues if I use subfolders which have the same name as their parents.... but I just won't

jarun commented 4 years ago

You can have this modification in your fork. At this stage of the project I do not expect too many changes so it shouldn't be difficult to merge at a later point.

rachmadaniHaryono commented 4 years ago

@jarun i want to update this page https://github.com/jarun/buku/wiki/Buku-as-a-library


buku is developed as a powerful python library for bookmark management. All functionality are available through carefully designed APIs. main() is a good usage example. It's also possible to use a custom database file in multi-user scenarios. Check out the documentation for the following APIs which accept an optional argument as database.

>>> import buku
>>> buku.BukuDb.initdb(dbfile=None)
>>> buku.BukuCrypt.encrypt_file(iterations, dbfile=None)
>>> buku.BukuCrypt.decrypt_file(iterations, dbfile=None)

NOTE: This flexibility is not exposed in the program.

An example to use buku as library

>>> import buku
>>> buku.__version__
'4.4'
>>> bdb = buku.BukuDb(dbfile='temp.db')
>>> bdb.get_rec_all()
[]
>>> bdb.add_rec(url='https://example.com', title_in='example title', tags_in='tag1', desc='example desc')
1
>>> bdb.get_rec_all()
[(1, 'https://example.com', 'example title', ',tag1,', 'example desc', 0)]
>>> # id, url, title, tags, description, flags
>>> bdb.add_rec(url='https://example.com/1.jpg')
1
>>> bdb.get_rec_all()
[(1, 'https://example.com', 'example title', ',tag1,', 'example desc', 0),
 (2, 'https://example.com/1.jpg', None, ',', '', 0)]
>>> # Note: if record don't have tags, it will return ',' (comma character)

The bukuserver has several wrapper web APIs. Feel free to update if you need them.


changes

jarun commented 4 years ago

Sure thing!

Clarkinia commented 3 years ago

On fedora 33, copying a link in a search (c #id) throws this error: Failed to locate suitable clipboard utility I was thinking maybe it's a Wayland issue? When I right-click on the link in terminal I am able to copy.

The reason I want to copy is to be able to open in a browser other than Firefox (or the browsers listed in the Python webbrowser controller). Perhaps this is too much of a pipe dream, but I would like to choose a different browser with one letter. For example: O 5 f Open index 5 in firefox O 5 c Open index 5 in chrome

jarun commented 3 years ago

You may have to install wl-copy. See function copy_to_clipboard() for a list of supported copiers.

Switching browsers on the fly is not supported.

Clarkinia commented 3 years ago

Thanks! That worked. I had also installed buku from fedora dnf and the code was older. I looked at the file in /usr/bin/buku and the "wl-copy" info was not there yet. So I downloaded the latest from the buku github repository and replaced the buku file. And I installed wl-clipboard from the fedora's package manager. Now copy works. Thanks.