neo4j-contrib / graphgist-cms

http://graphgist.neo4j.com/
67 stars 24 forks source link

"Page Source" button #37

Closed cheerfulstoic closed 9 years ago

cheerfulstoic commented 9 years ago

This is done, though I'm not really sure how to link to the original original source when the URL is gist.neo4j.org...

jexp commented 9 years ago

We can determine the original source by the same mechanism we find the page to load the asciidoc page from?

cheerfulstoic commented 9 years ago

Ah, right, good point. I'll look into that first thing tomorrow

cheerfulstoic commented 9 years ago

I have this working for gist.neo4j.org URLs which link to github gists, but it still persists for other links to gist.neo4j.org. We could change all the URLs in the database to point to their original source, but that wouldn't fix any new URLs coming in.

The reason it's only working for github gists right now is because in order to get it to work I would need to implement functions which would parse the custom IDs that we use and generate the public browser-friendly page URLs. Right now in the background we generate URLs, but they are the raw/APIs URLs.

I'm feeling more and more like the custom ID approach is flawed. It requires a lot of work to support these various sites and could easily be broken if those sites decide to change their URL structures.

Another approach that I like better is that when we're given URLs that we don't recognize, we could simply create a new node in the graph with an auto-generated ID and store the URL there. Then we could then use that ID to refer to the gist in the graphgist site URLs. Heck, the ID could even be the github- / dropbox- / riseup- IDs that we have now, but it would so much easier to be able to just look them up in the DB

Either that or building functions for generating public URLs for the friendly IDs would take some time