News for hackers. Stuff that matters.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @04:42PM (#23228098)
This is still not as powerful as my one, simple trick to handle all bookmarks, ever: Print to PDF.

I've been doing it since last century, and I have 10's of thousands of PDF's of every single web page I've ever found interesting, sitting right there in a directory on my computer. Its indexable, searchable, grok'able, available off-line, allows me to harvest data without fuss, and gives me access to anything I can remember about the article, almost instantaneously.

    $ ls -l ~/PDFArchive/ | grep -i "bookmark" | grep -i "manage" | wc -l 
= I've seen 20 other bookmark management 'solution' articles in 20 years

.. nothing beats print-to-PDF. Its just awesome.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by ropeladder on Monday May 18, 2020 @05:07PM (#23228380)
It's too bad browsers don't have an easy way to print to browser-page-sized PDF. Standard 8.5x11/A4 paper sized PDFs of webpages tend to look pretty terrible.

I used to use the Scrapbook plugin for Firefox but I realized for the most part just plaintext might be best. So I'm in the process of setting up a workflow that will save article in markdown in one click and sync between my phone and my computer.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by jannes on Monday May 18, 2020 @05:48PM (#23228781)
You could try the awesome SingleFile extension: https://github.com/gildas-lormeau/SingleFile

It might be a good compromise between PDF and plain text. It's pretty nice because it essentially serialises a snapshot of the current DOM tree, so it works with all kinds of JS-generated pages.

The files should be relatively grep-able, because it's normal HTML. Of course, you might want to strip HTML tags for more sophisticated searching.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by ropeladder on Monday May 18, 2020 @06:49PM (#23229291)
SingleFile is a really great extension, but I wanted something a bit more pared down that I could easily use on both mobile and desktop and sync between them using Syncthing. So I'm trying to copy some of SingleFile's UI and graft it on to Markdown-Clipper.[1] And also add the ability to save the images that get picked up by Readability (which Markdown-Clipper uses).

[1] https://github.com/enrico-kaack/markdown-clipper

Re:WorldBrain's Memex: Bookmarking for the power users of th... by gexla on Tuesday May 19, 2020 @03:43AM (#23232323)
Joplin already has this feature via browser extension. It has a mobile app, but never tested it myself.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by dyukqu on Tuesday May 19, 2020 @09:56AM (#23234902)
Thank you for this! I've just tested it on desktop and I think it's wonderful.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by rpdillon on Monday May 18, 2020 @09:37PM (#23230448)
FWIW, I use SingleFile on mobile and sync with NextCloud. Works beautifully.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by OkGoDoIt on Monday May 18, 2020 @10:36PM (#23230784)
How do you use singlefile on mobile? Android or iOS? Is there some sort of userscript or browser extension on mobile?
Re:WorldBrain's Memex: Bookmarking for the power users of th... by ropeladder on Monday May 18, 2020 @11:09PM (#23230944)
It works in Firefox for Android.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:10PM (#23228420)
Reader View is the solution to the A4- problem, imho. But I honestly don't mind the rendering issue - this is just a reference repository, after all. If I really need the cleaner page, I either Reader-View it beforehand, or just open it up on the Web again - links are preserved in PDF.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by jannes on Monday May 18, 2020 @05:23PM (#23228541)
Links are only preserved if you use Chrome's PDF export... This is not true for Firefox. (At least on Windows. I haven't tried Firefox on macOS.)
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:30PM (#23228599)
Safari for the win! ;)

(Seems like a bug in Firefox to me.. maybe this should be a config option..)

Re:WorldBrain's Memex: Bookmarking for the power users of th... by wlesieutre on Monday May 18, 2020 @06:46PM (#23229267)
Safari on iPhone can do this:

https://images.macrumors.com/t/zbOsBhKGQj6VvA9oq8KaZkLxXUc=/...

(note the scrollable preview at right edge of screen, the main preview is only showing a small fraction of the document)

Re:WorldBrain's Memex: Bookmarking for the power users of th... by mattalbie on Monday May 18, 2020 @09:12PM (#23230279)
Yeah, but there’s a length limit. And I hit that limit frequently, so it’s only usable (for me) about 50% of the time. Bug? Not sure.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by gexla on Tuesday May 19, 2020 @03:40AM (#23232292)
> So I'm in the process of setting up a workflow

There shouldn't be a need to setup a process. This functionality exists in many places.

For example, I use Joplin to save articles in Markdown format. It's the best web to markdown conversion tool I have found. Then at some point later, I'll pick what's still interesting to me and export from Joplin to PDF if I like.

Insapaper is $3 / month and is a save for later tool. You can then export all your articles in Epub and other formats.

I'm sure there are loads others.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by filoleg on Monday May 18, 2020 @05:38PM (#23228675)
I would be careful with using this method and check the generated PDF versions with your eyes before writing them off as "all is good, it is archived now".

I recently got bitten by that, when I was trying to print out some page in Chrome, and it was rendering as a bunch of white space surrounded by some elements from the page, but without any actual content I cared about. Turns out, my situation isn't that uncommon for pages that are heavily JS-dependent

Note: I am not saying JS=bad. This has nothing to do with JS itself and everything to do with how JS is used to generate/render the page. A lot of pages just don't bother with doing it the right way that doesn't screw up generated PDFs.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:41PM (#23228703)
I've since learned in this thread that Chrome and Firefox are not as good as Safari for this technique - it hasn't impacted me much since I only use Chrome/Firefox for development, mostly.

And although I do occasionally check the produced PDF's, the layout doesn't matter to me at all since I use a cmd-line grep or combination of 'pdftotext' to find the page, open the PDF, and click the link to go to the original web page if I need to .. haven't found a single dud PDF in the collection in a randomised sampling, but then again in 20,000+ files, there's bound to be one that didn't make it through the rendering pipeline, but so far, hasn't been an issue.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by filoleg on Monday May 18, 2020 @07:26PM (#23229574)
That clarifies it a lot, thanks for explaining.

I actually remember having to eventually go through Safari to print out that one page I mentioned above that was giving me issues in Chrome, so that makes a lot of sense. Glad to find out it wasn't just me somehow being lucky with Safari, and that it is actually a known thing.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by detaro on Tuesday May 19, 2020 @06:44AM (#23233410)
I really hate this kind of response. No, your thing is not strictly better. It's cool, it might be better for you and many others, but it doesn't even do the same thing (archive all visited pages)!
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Wednesday May 20, 2020 @03:42AM (#23244328)
I really hate this kind of whinging response.

This archives every page I'm ever interested in, just fine. Links are preserved just fine, all the data that got me interested in the web page in the first place are just there on my disk, easily accessible any time of day without requiring any further accounts.

It is better since it doesn't require any involvement of a third party, is always accessible to me no matter the state of the Internet, and gives me absolute control over all of the data, which I can mine using whatever toolset I want. In fact, I get more data out of this method than the service described in the article.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by Abishek_Muthian on Tuesday May 19, 2020 @10:09AM (#23235014)
True, there are different approaches to solve this problem according to the individual preferences.

A user recently said, X would use 'Calendar to remind about bookmarks' in a discussion about this problem[1].

[1]https://needgap.com/problems/57-i-forget-my-web-bookmarks-qu...

Re:WorldBrain's Memex: Bookmarking for the power users of th... by wazoox on Monday May 18, 2020 @05:48PM (#23228778)
I discovered Zotero for this use. I don't have any use of its bibliographical abilities, but it stores web pages and PDF articles fine, and is searchable, etc.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by igravious on Tuesday May 19, 2020 @05:02AM (#23232828)
Yes, because of all the metadata you can preserve with the save.

Also, frequently what yo want to save is a link to a book or an article (or a Wikipedia article, say) and Zotero recognizes many of these formats and saves them correctly, it's toolbar icon even changes to let you know.

It's a fantastic tool. It's got cloud storage, and it has an API (which I've used -- it's super easy).

Re:WorldBrain's Memex: Bookmarking for the power users of th... by nishparadox on Monday May 18, 2020 @10:12PM (#23230654)
True Zotero is a neat tool, especially for files and web pages. I've been using it to read research papers mostly.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by phiresky on Tuesday May 19, 2020 @04:38AM (#23232683)
> Yeah, my computer is fast enough that I can just do "find . -name '*.pdf' -exec pdftotext {} \; | grep -i someSearchTerm" and come back later.

You may be interested in my ripgrep-all [1] tool, it should allow you to search those tens of thousands of PDFs in under a second (with hot cache)

[1] https://phiresky.github.io/blog/2019/rga--ripgrep-for-zip-ta...

Re:WorldBrain's Memex: Bookmarking for the power users of th... by tomcooks on Tuesday May 19, 2020 @07:51AM (#23233809)
Really great tool, if there is a way to promote it to the main pacman archives, instead of having to use AUR, let me know where I can vote
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Wednesday May 20, 2020 @03:44AM (#23244340)
Thanks for that - yeah, silversearch-ag also does a pretty good job.. Its really not a big deal to search so many docs these days, either ..
Re:WorldBrain's Memex: Bookmarking for the power users of th... by pvg on Monday May 18, 2020 @05:33PM (#23228636)
nothing beats print-to-PDF

What's the advantage over browser's built-in 'save entire page' option? Print to PDF loses formatting and obscures the URL you got the thing from.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:37PM (#23228671)
$ pdftotext | grep sometext

^^ first advantage

Also: a) Formatting is not lost, it just changes to fit the default paper size I've got selected (A4) but doesn't really make much difference, since its a snapshot, and b) URL is right there in the Header of the PDF, and is clickable, so no - not really an issue. This archive also functions as a bookmark collection as well as an offline copy for future reference ..

(Disclaimer: may be that your browser is borking the PDF's. Not the case with Safari, anyway, but ymmv..)

Re:WorldBrain's Memex: Bookmarking for the power users of th... by pvg on Monday May 18, 2020 @05:49PM (#23228786)
You can grep the saved archives and they often save working copies of local interactive content in a way PDF doesn't. Internal structure and annotation is also preserved. I'm not sure I understand the formatting comment, you seem to be saying formatting is not lost and supporting that with an example of how formatting is lost. Don't get me wrong, it should definitely be easier to save, index and otherwise manipulate web pages. But out of the the trivial methods, 'print to PDF' is one of the poorer methods.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:55PM (#23228841)
It depends on the site - but I haven't found 'lost formatting' to be an issue at all - since, when I want to do a granular search I'm using 'pdftotext' to search on plaintext, and when I find a PDF of interest, I open it and can go directly back to the web page from which it was printed by way of the footer/header which contains a clickable URL.

Most of the time though, the formatting isn't an issue. It depends on the site though - some authors produce stuff that doesn't look good as PDF, even if the content is still there. That doesn't bug me much.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by pvg on Monday May 18, 2020 @06:04PM (#23228925)
Ok, so we seem to agree print-to-pdf loses formatting. I share your interest in and fascination with this (weirdly irksome and edgecasey) problem but just about any modern browser provides better facilities for saving web pages with higher fidelity than 'print to pdf'. Print to pdf is so easy to beat, you'd have to go out of your way to find a way to not-beat it - say, saving just 'page source'.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @12:52AM (#23231367)
PDF gives me an off-line readable version of the website, and is pretty compatible with pdftotext as a pipeline tool... I'm not sure that formatting is such a huge issue - I'm yet to find a web page I can't extract some meaningful info from, later on ..
Re:WorldBrain's Memex: Bookmarking for the power users of th... by pvg on Tuesday May 19, 2020 @01:08AM (#23231426)
an off-line readable version of the website

As does 'Save as: Web Archive' in Safari or, if you tell it to store offline, 'Add to Reading List'. In Chrome you can save pages to .mht. All of these are single-keystroke, better ways to locally archive a web page.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @01:56AM (#23231675)
Cool. Let me know when I can extract the full text contents from such files using common, built-in tools on your average fresh install of MacOS/Linux.

PDF works just fine. It presents a feasible view of the original data, and allows for data harvesting with ease.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by pvg on Tuesday May 19, 2020 @02:10AM (#23231751)
Let me know when I can extract the full text

You can extract the full text from these (with whatever tools you like) with better fidelity than you can from a pdf, which is a lossy conversion from the same source. This seems to barely merit debating, unless I'm missing something.

PDF works just fine.

I'm sure it works for you and I'm not harbouring any delusions I'm going to talk you out of your decades-established workflow. But for anyone looking for ways to keep track of web pages, thinking about building tools in this space, etc - no, PDF is not a good way to archive web pages, either manually or programmatically.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @02:32AM (#23231888)
>PDF is a lossy conversion

I am not finding this to be true. Pretty much every PDF I have has been usable for extracting the text content - unless the Web authors intentionally work to obfuscate/disable this functionality, i.e. using images to display text content.

>PDF is not a good way to archive web pages, either manually or programmatically.

I disagree, entirely, with your conclusion - you haven't made a strong argument. 20,000+ fully-searchable, indexable, accessible-in-offline PDF files vs. your opinion so far. I don't see any of the issues you've stated are insurmountable - in fact, I find the reality to be completely the opposite to your stated opinion. Please expand on this if you have the energy.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by pvg on Tuesday May 19, 2020 @02:46AM (#23231991)
fully-searchable, indexable, accessible-in-offline

Probably the shortest version of the point I'm trying to make is that every current browser does a much better job of providing you this than printing to PDF. If you rely on this as a personal web archiving system, you're going to lose data in the most irritating way - data you thought you collected but actually didn't.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @03:41AM (#23232308)
I don't understand your point at all. In what way is a browser going to give me information that is not available to me unless I'm online? PDF's of sites I've visited have all the data I need - the stuff I read that then prompted me to print to PDF. I've searched and I'm yet to find a single PDF in my collection that doesn't have the info that prompted me to save it in the first place. I understand you believe your point is strong - its still not being made in a way that I can relate.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fauigerzigerk on Tuesday May 19, 2020 @05:09AM (#23232858)
PDF conversion throws away almost all of the structure contained in HTML. Tools like pdf2text then try to reconstruct some of that structure (such as the correct sequence of letters and words) using complex heuristics that don't always work.

They often do that successfully enough, especially if all you want is to grep for words. pdf2text also has a table mode that attempts to reconstruct table structured content. This is far less successful.

So depending on how you want to process your stored data, saving as PDF may or may not preserve sufficient information.

If you were storing pages for the purpose of extracting specific properties of things you are researching (say product information or the tree structure of HN threads), then throwing away all that structure makes it a lot more difficult or even impossible to reconstruct the information you need.

If I were storing pages for unknown future purposes, I wouldn't want to throw away any information I might need, and therefore I would never use PDF as an archival format.

But I understand that you store PDF files for a very specific purpose for which lossy PDF conversion happens to be good enough. So that's fine of course.

The only question I have is where I can find the source URL of the stored pages.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @06:06AM (#23233172)
>structure contained in HTML.

As long as I can read the site, I have what I need. Why do I need to read the HTML?

>So depending on how you want to process your stored data, saving as PDF may or may not preserve sufficient information.

As long as I can read it, the PDF is sufficient for my needs.

For everything else, there's wget.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by pvg on Tuesday May 19, 2020 @04:46AM (#23232737)
In what way is a browser going to give me information that is not available to me unless I'm online?

The alternatives I'm talking about are absolutely available offline. I don't understand why you keep arguing against a position I've never taken.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by ben509 on Monday May 18, 2020 @05:55PM (#23228848)
Grep is not much of an advantage when Mac, Windows and Linux all have as-you-type full-text search of common formats like HTML and PDF.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by anonymoushn on Monday May 18, 2020 @07:25PM (#23229570)
Can you point me to the as-you-type full-text search on Mac for a directory transitively containing 20,000 pdfs?
Re:WorldBrain's Memex: Bookmarking for the power users of th... by ben509 on Wednesday May 27, 2020 @10:30PM (#23332767)
Sure, Spotlight has been around for at least a decade; it's the little magnifying glass at the right end of the main menubar. It definitely indexes PDFs with a text layer as well as other document formats; I've been running them through OCR for ages and have 28,000 in my records. You can also install extensions for other formats.

It indexes your whole disk; if there's a limit as to how many files it will index, I've yet to reach it. I checked Apple's developer documentation, and they don't mention one.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by salutis on Monday May 18, 2020 @08:54PM (#23230180)
I use Apple’s built-in Spotlight search to search in Markdown files and PDF documents, albeit I do not have 20,000 of them. Would it be a problem for Spotlight to index 20,000 PDF documents?
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @06:08AM (#23233187)
Pro's for grep/silversearcher/etc.: quite fast, quite efficient, redirect-able to other tools, maybe a little sqlite here, maybe a bit of xml/svg there and most important of all: private, under my control...

mdimporter: yeah, sure, just no .. mmkay?

Re:WorldBrain's Memex: Bookmarking for the power users of th... by alexmarkelenkov on Monday May 18, 2020 @08:05PM (#23229831)
Tip for a better use of browser's print to PDF feature: use an ad blocker (uBlock Origin in Chrome works fine) to remove noisy html elements, ads and clutter. I basically cut everything but text, even navigation elements. And this btw is where Chrome comes handy for (e.g.) Firefox users: you can browse and print separately. You always have a ready-to-print setup in Chrome (or else) while browsing somewhere else. I haven't yet looked into another promising feature though, which is (if I'm not mistaken) the availability of a CLI for this . Would be very interested to automate the process, but am concerned about whether the element blocking will work. Ideally I'd like to be able to save printed pages either automatically or via bulk selection (within my browser history) to Evernote or anything like (it seems to be the best solution for me, as it has a great indexing, fuzzy search and relevance, plus the fact that the storage is not limited unless I start to upload more than 10 GB per month which is unlikely). Anyway, would be glad to hear if anyone came up with a similar or a better solution.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by bharani_m on Tuesday May 19, 2020 @12:35AM (#23231300)
I am also a big fan of Print to PDF. I've actually built a simple bookmarking service [0] that does just this.

EmailThis extracts meaningful content from web pages and sends it to your email inbox. You can also tell it to save a PDF copy of each page, in which case the PDF is sent as an attachment.

Print-to-Pdf is done using Headless Chrome (so it works exactly like doing a Ctrl-P).

I find that the Print to PDF works best because it gives you a copy of the web page even if the original one disappears. Also, none of the content extraction services (mine included) work in 100% of the cases. Sometimes, they might incorrectly remove images and other meaningful content. So in such cases, having a full PDF snapshot is quite handy.

Let me know what you guys think.

[0] https://www.emailthis.me

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @06:03AM (#23233153)
Nice way to find out what everyone is reading while gathering addresses of smart people. ;)

> Sometimes, they might incorrectly remove images and other meaningful content. So in such cases, having a full PDF snapshot is quite handy.

Also interesting is that the context is preserved locally across visits to the site - over 10 years, I have gathered a pretty interesting view of some of the various A/B changes that have gone on, on my favourite 'daily visit' sites ..

And, it is often very revealing of my own habits. This highlights the privacy-factor of having a local-file based bookmark/ontology system a little more in my favour.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by aiilns on Tuesday May 19, 2020 @05:45AM (#23233066)
I think it all depends on what you are using bookmarks for. I bookmark sites I want to check out again in the near future, but searching in my bookmarks/tagging as memex does has never been an issue for me.

If it is something worth searching its text, then it is something worth saving offline, reading and annotating. I use Polar [1] for most and wallabag [2] for its .epub converting ability - especially if there is mainly text that interests me and a lot of it, so I can read it on my ereader. As soon as Polar manages .epubs I shall import all my .epub articles into it. :)

[1] https://getpolarized.io/ [2] https://wallabag.org/en

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @05:57AM (#23233125)
Print-to-PDF, put the important sites in a Folder on your Desktop ..

The URL for every single site is in the PDF.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by gregsadetsky on Monday May 18, 2020 @04:55PM (#23228249)
It sounds like a really good idea (in addition to images being part of this single file PDF "archive" and thus won't go missing), but the PDFs being searchable depend on how the PDF is made, no?

I printed to PDF this HN thread in Chrome (I assume that the PDF printing was done on the system level by OSX -- EDIT yes, from the file: "/Producer (macOS Version 10.15.2 \(Build 19C57\) Quartz PDFContext)"), and none of the page's strings appear as ascii or utf-8 in the document. grep is unable to find any string in that file.

Do you have a specific print to PDF setup? Or a PDF-aware grep..?

EDIT: Seeing the command-line you're using, the search you do is over the files' names, correct? The PDF/(original web page) text content is not indexed, right? Just to make sure I understand correctly.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:02PM (#23228336)
I just use the PDF defaults from whatever browser I'm using at the time. Nothing special involved, just the defaults.

I do use 'pdftotext' to do more fine-grained searching if I need to - but for the most part I find that a simple "ls -l | grep <search>" suffices, since this method preserves page title text too ..

I did the same thing for this thread and had no issues with this command, whatsoever:

    $ pdftotext WorldBrain\'s\ Memex:\ Bookmarking\ for\ the\ power\ users\ of\ the\ web\ \|\ Hacker\ News.pdf - | grep -i "Print-to-pdf"
Results:

".. nothing beats print-to-PDF. Its just awesome." "fancier laid out pages), I Print-to-PDF again after enabling Reader"

Re:WorldBrain's Memex: Bookmarking for the power users of th... by gregsadetsky on Monday May 18, 2020 @05:03PM (#23228344)
Got it, makes sense.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by snazz on Monday May 18, 2020 @05:12PM (#23228432)
> EDIT: Seeing the command-line you're using, the search you do is over the files' names, correct? The PDF/(original web page) text content is not indexed, right? Just to make sure I understand correctly.

pdftotext gets the actual text from the PDF. I don't do this, but I'm sure that you could automate the process of generating a text file for each PDF in a directory with pdftotext and then ripgrep the text files when it's time to search the contents. That would be doable with a makefile or a couple of shell scripts.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:16PM (#23228467)
Yeah, my computer is fast enough that I can just do "find . -name '*.pdf' -exec pdftotext {} \; | grep -i someSearchTerm" and come back later. Bonus points that it stays in my Terminal for reference later in the day as needed.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by wolfhumble on Monday May 18, 2020 @08:06PM (#23229836)
Is there a reason why you don't use mdfind instead (built-in spotlight search from the terminal)? That way you can search pdf files directly from the terminal without converting to text first, and the directory is already indexed.

E.g:

[$]mdfind -onlyin ~/MyDirectory someSearchTerm

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @12:50AM (#23231357)
1: Force of habit, since I use grep and silversearcher elsewhere a lot, but 2: I hate the mdfind indexer service putting garbage all over my disks, so I've turned it off and forgotten about it.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by burntsushi on Tuesday May 19, 2020 @07:02AM (#23233509)
ripgrep can actually do this seamlessly with its preprocessors: https://github.com/BurntSushi/ripgrep/blob/b72ad8f8aa897191c...
Re:WorldBrain's Memex: Bookmarking for the power users of th... by snazz on Tuesday May 19, 2020 @09:20AM (#23234548)
That's absolutely awesome! Much better than my theoretical solution.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by throwawaysea on Monday May 18, 2020 @06:09PM (#23228965)
Are you manually printing each page to PDF? I would love to have an automated way to do this but haven't figured out how to deal with logging into subscription based site and all that.

There is also some degree of messiness even with printing to PDF. For example let's say I want to save an HN or Reddit discussion along with the comments - I would need to make sure I capture all the comments that overflow to "More" on HN or are behind a "load more comments" link on Reddit. Is there any elegant way to traverse all that and capture it?

Re:WorldBrain's Memex: Bookmarking for the power users of th... by nikisweeting on Monday May 18, 2020 @09:01PM (#23230223)
ArchiveBox.io saves to PDF and to screenshot and WARC, and HTML to avoid issues that PDF alone has, but the feature that allows archiving sites behind a login isn't completely finished yet.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @12:58AM (#23231387)
Yes, manually, but as I stated elsewhere: its muscle memory and smooth as an operation for me locally anyway now.

I often go through the archive, find the HN comment PDF's I've created, and then automatically update them to get whatever new comments have occurred in the meantime. Haven't figured out how to navigate to the 'next' comment page automatically though - some pages detect they're being printed and use a print-friendly layout, though, which is nice .. would be cool to see more of that.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by gildas on Tuesday May 19, 2020 @06:10AM (#23233197)
> nothing beats print-to-PDF. Its just awesome.

HTML largely beats PDF for this use case. And if you want something that produces a file in which you can easily extract resources from the saved page, see [1]. There is an option to automatically save the pages you add to your bookmark. There's also an option to make the text of the files indexable without unzipping them.

[1] https://github.com/gildas-lormeau/SingleFileZ

Re:WorldBrain's Memex: Bookmarking for the power users of th... by jannes on Monday May 18, 2020 @05:18PM (#23228494)
Do you use a Chromium-based browser? Chrome/ium's Print-To-PDF uses quite a different (better) method for generating the PDF compared to the OS-level Print-To-PDF.

The OS-level PDF converter can lose a lot of information. Especially hyperlinks are not present in the PDF when it's generated through a print driver.

Unfortunately, this is one of the few times when it sucks to be a Firefox user, because it doesn't have a builtin Print-To-PDF.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:28PM (#23228582)
I use Safari and Firefox mostly, and haven't yet run into any of the issues you bring up - pdftotext gives me full text search with ease. All the links still work, PDF's are easy to read (assuming the page doesn't do weird layout tricks), and for the worst case, I at least can search my "bookmark" PDF archive and go back to the original live web page if needed.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by jannes on Monday May 18, 2020 @05:38PM (#23228673)
Looks like Apple's implementation is a bit better then. I just tried on Windows and I definitely don't get any clickable links when printed with the OS print-to-pdf driver. (I do get them with Chrome's save-to-pdf feature which circumvents "printing" and generates the PDF itself.)
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:43PM (#23228719)
Good to know for future discussions about this technique. I wonder if there is a way to make Chrome on Windows behave better in this regard .. seems quite shortsighted to me that they'd remove the links, although maybe a security boffin has made the case for it.

Either way, haven't used Windows in decades, so its a non-issue, but it is interesting to note that this isn't something I'd be doing if I did switch.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by Galaco on Tuesday May 19, 2020 @12:50AM (#23231358)
To be a little pedantic, while this is a fantastic idea, is it really bookmarking?

What you’ve done instead is compiled a personal digital library; akin to a Kindle

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @01:53AM (#23231654)
Inasmuch as every PDF still has the URL to the original page, for my uses - I'd say yes, it is bookmarking.

Its not like I'd cut the spine off every book in my library and create an index out of the covers ..

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fauigerzigerk on Tuesday May 19, 2020 @04:23AM (#23232588)
Apparently only Firefox saves the source URL. In PDFs saved from Safari or Chrome on macOS I can't find the URL anywhere. Maybe I'm missing something.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @06:11AM (#23233207)
Interesting. For me, its right there on the bottom-left of the footer, always.

/tmpᐅ pdftotext Add\ Comment\ -\ Hacker\ News.pdf - |grep http

https://news.ycombinator.com/reply?id=23232588&goto=threads%...

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fauigerzigerk on Tuesday May 19, 2020 @06:31AM (#23233329)
Weird. It's not in there when I store it.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by cilefen on Monday May 25, 2020 @12:14PM (#23302454)
Try checking "Print headers and footers" in the print dialog.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Wednesday May 20, 2020 @03:45AM (#23244349)
Lets compare versions just so I know this feature isn't going away any time soon.

Safari 13.1 here, MacOS 10.14.6...

Re:WorldBrain's Memex: Bookmarking for the power users of th... by andrepd on Monday May 18, 2020 @06:45PM (#23229264)
How is this "not as powerful"? What is this tool lacking that save to pdf provides? I can see at least one way it is vastly inferior, in that you break formatting by converting to a horrendous paper page-based format.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @12:56AM (#23231380)
Off-line mode, my data is my data, and I can process the data freely and easily using my own local tools without getting anyone else' CPU involved.

And the formatting issue isn't really that big of a deal, if I'm honest. The formatting did its work in the initial contact of the web page - beyond that, to me anyway, its superfluous to the later task of finding the reference again. pdftotext don't care about the formatting, either.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by andrepd on Tuesday May 19, 2020 @07:15AM (#23233592)
>Off-line mode, my data is my data, and I can process the data freely and easily using my own local tools without getting anyone else' CPU involved.

Open the page and you will probably realise that unless you want to pay for sync, this extention works offline.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Wednesday May 20, 2020 @03:46AM (#23244354)
I don't want to pay for sync, because print-to-pdf is my sync, and is free.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by nuka_coffee on Tuesday May 19, 2020 @09:17AM (#23234531)
Based on your comment I stumbled upon this tool: https://wkhtmltopdf.org/

It preserves hyperlinks and styling. Neat.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by dependenttypes on Tuesday May 19, 2020 @01:17AM (#23231481)
Wouldn't being able to print to epub be better? epubs are just zipped html files after all so the conversion is more direct and you don't lose any info.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @01:54AM (#23231665)
PDF just has better tooling for search, which supplants my need for proper formatting since by the point I'm searching for things in my history its the content that matters to me anyway, exclusive of the original formatting.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by validuser on Tuesday May 19, 2020 @05:23AM (#23232924)
Many sites have horribly broken/nonexistent print styling. Any tips on how to get good prints matching what you see in the browser?
Re:WorldBrain's Memex: Bookmarking for the power users of th... by ramraj07 on Monday May 18, 2020 @05:23PM (#23228532)
This is amazingly simple, but what about in mobile? There's pdf printing here too but it's not as simple as command P! Any ideas?
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:26PM (#23228563)
If I need to save a page I've read on mobile, I mail myself the link to my desktop and print it there, where the PDF Archive lives. Its muscle memory at this point.

Still, would be nice if the Browser vendors would cotton on to how powerful this is, and make the whole thing a bit more seamless for the mobile/desktop bridge, or just make Print-to-PDF work more smoothly for this case on mobile.

Either way, I also have a list of every mail I've ever sent myself containing a URL from mobile, which is handy in and of itself at times, hehe ..

Re:WorldBrain's Memex: Bookmarking for the power users of th... by rakoo on Monday May 18, 2020 @07:05PM (#23229416)
The advantage of doing it on the desktop is that you get to print the desktop version of the site.

There probably is an avenue to automate printing from your desktop as soon as it receives the email; who knows, maybe even

The inconvenient of your way is that your bookmarks are only available on the Desktop, from your mobile all you can have is the list of URLs you sent yourself. It's still probably better than having some service running all the time you want to query though.

Your system is surprisingly "low-tech" and sounds extremely interesting, I'm tempted to start doing it as well. Do you have any kind of organization or viewer for your stack of PDFs, or are they just files amassed on your hard drive ?

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @01:01AM (#23231396)
I print to the Desktop, then clean it up at the end of the day by moving the files into what is admittedly a massive collection of files in a single directory .. On one hand, it seems messy - but on the other hand, its incredibly useful to use shell tools to manipulate/harvest the data in that directory.

And as for the mobile/desktop issue: I just sync my PDF dir to my mobile phone, and carry it all with me, anyway. The mobile version is not as grep'able, but its pretty neat to have every interesting website I've ever cared enough about to print-to-PDF with me in my pocket, even if it is a nearly un-navigable list of 20,000+ files to scroll through, hehe ..

Re:WorldBrain's Memex: Bookmarking for the power users of th... by nl on Monday May 18, 2020 @11:56PM (#23231146)
You can do this from mobile (on Android, maybe Chrome on iOS?)

Go Share...-> Chrome (Print) --> (Brings up "Save to PDF" (!!)) --> Save to Drive (and then sync this drive to your computer).

You could also save to Dropbox or whatever other syncing service you choose.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by WanderPanda on Monday May 18, 2020 @05:33PM (#23228632)
On iOS you can easily create a shortcut for the share-sheet to creat pdf prints fyi
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:39PM (#23228679)
Yeah, I should probably set that up some time, but I've become reliant on my muscle memory for my forwarding-to-desktop flow ..
Re:WorldBrain's Memex: Bookmarking for the power users of th... by imperialdrive on Monday May 18, 2020 @04:44PM (#23228120)
Kudos - I'll be practicing this later today :)
Re:WorldBrain's Memex: Bookmarking for the power users of th... by cocktailpeanuts on Monday May 18, 2020 @04:52PM (#23228218)
you should productize this idea. I would use it.

It's a bit hassle to print to PDF every time, but if the barrier is low enough, it would be useful.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @04:56PM (#23228268)
There's nothing to productize. You just use CMD[,Control}-P, select "Print to PDF", save to a relevant folder, and off you go. If that's too many steps, use Automator or whatever the equivalent is on your OS to make a shorter hotkey. (I had a Hammerspoon script for this once, but reverted to just doing it manually, since my muscle memory on the keystrokes is sufficiently well trained that it supplants my desire to find the .lua files somewhere to pass to Hammerspoon..)

The entire point is that there is absolutely no need for a third party to get involved in organising your web browsing history or remembering your bookmarks. Use the shell. Very few third-party services will be able to match the power of this tooling, for the reasons I gave above. My history = my data, for my own private purposes.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by GuiA on Monday May 18, 2020 @06:03PM (#23228915)
That’s the software economy we’re in. Everyone’s thinking in terms of “productization” and “features” and “user journeys”. Only old grumpy hackers care about minimal, composable tools anymore. Sigh.
Re:WorldBrain's Memex: Bookmarking for the power users of th... by cocktailpeanuts on Monday May 18, 2020 @08:26PM (#23229979)
There are tons of people who would appreciate this feature and I only brought this up because these people will definitely appreciate something like this.

Reading through your comment i can already imagine you sitting there probably thinking all these inferior "normies" who don't deserve to enjoy convenience in their lives because they don't know tech.

Well, everybody on this site is a "hacker" yet not everybody has time and discipline to devote to doing this all the time. And I don't care for learning every single esoteric automation features on my computer. It's kind of weird giving a positive comment and getting all these negative snarky comments back.

Lastly it's stupid to think "Productization" is some evil thing. Productization simply means take some process that's useful and make it easily accessible for other people. It doesn't even mean you sell it for money. If you don't care about improving other people's lives, that's fine, but don't be so condescending about people who genuinely appreciate the idea and just wanted to provide some positive feedback.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by GuiA on Monday May 18, 2020 @09:14PM (#23230294)
I suspect you may have misunderstood the spirit of my comment. I believe that computing should be accessible to everyone, and can guarantee that the harsh thoughts you put in my head are far from my intent.

Let's say you want to enable someone to make coffee at home. One could imagine two different approaches:

a) you give that person a bean grinder, some equipment to match their taste (e.g. an espresso machine or a chemex), and teach them how to make a tasty cup of coffee in their kitchen.

b) you give that person a nespresso machine, and tell them to order capsules once a month from amazon.com

Computing used to be much more like the former approach, philosophically. The foundations that we rely on today were about small, composable, modular programs, operating using well documented open standards and protocols. This approach gave us things like UNIX/POSIX and the internet.

However, mainstream computing has shifted towards much more about the latter kind of approaches. You stay in the walled gardens, you have no way to directly manipulate your data, and you're reliant on _features_ to get anything done.

In our previous coffee example, "pulling a long shot" would have to be a "feature" on the Nespresso machine, that the designers at Nespresso decided to surface on their machine as a switch of some sort for the end user to access. For approach a) though, it's something you can naturally do as part of the process.

One could also argue that a) is also maybe more aligned with the hacker ethos.

That's where my frustration at overzealous productization in computing comes from.

That's not even getting into how approach b) tends to be consistently worse for the environment and society.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Tuesday May 19, 2020 @01:03AM (#23231407)
What I think is interesting is that this simple technique, which was so obvious to me having grown up with computers before there were filesystems, really - is now an interesting technique worth productising. To me, that indicates a bit of amnesia in the industry, specifically around how to be a productive user of file systems. If only there had been less intention to eradicate filesystem proficiency in generations of users by certain computer manufacturers, who wanted to productize things like that, away from the user ...
Re:WorldBrain's Memex: Bookmarking for the power users of th... by danielecook on Monday May 18, 2020 @04:48PM (#23228161)
What sorts of web pages do you do this for? What if the pdf version is difficult to read?
Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @04:54PM (#23228242)
Every web page I'll ever want to refer to, ever again. There are no good reasons for exceptions to this technique, imho.

If the PDF version is difficult to read - which it rarely is, by the way - all I need to do is open the PDF and use the links in the page header to go visit the site again - all the details about the page are still there in the PDF, links are still clickable, etc.

And if its really important, and I've taken the time, before moving to my PDF Archive, to verify that the site is not readable due to some layout inconsistency in the conversion to PDF (I do sometimes suspect this with the fancier laid out pages), I Print-to-PDF again after enabling Reader mode/view (Safari/Firefox): problem solved.

But really, there are very few web pages that don't survive the PDF conversion. And anyway, I mostly pipe the .PDF output through something like pdf2text for further grok/grep'ing...

Re:WorldBrain's Memex: Bookmarking for the power users of th... by cortesoft on Monday May 18, 2020 @05:48PM (#23228783)
> There are no good reasons for exceptions to this technique, imho

Dynamic web sites? A PDF of my bank website isn't going to help me much.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by fit2rule on Monday May 18, 2020 @05:51PM (#23228809)
If the intention is to save data from your bank website, you're probably going to have to jump through hoops anyway, assuming your bank is doing its job. (Or just remember to use Reader mode first..)

However, if the intention is to just save a link to the bank website for future reference, my technique still works since every page in the PDF produced contains a header with the URL - just like a normal bookmark.

Re:WorldBrain's Memex: Bookmarking for the power users of th... by nojito on Monday May 18, 2020 @06:52PM (#23229322)
Most if not all web browsers have a reader mode which trims away nonsense.