neo4j-contrib / graphgist-portal-v3

GraphGist Portal v3 (JavaScript)
Apache License 2.0
5 stars 4 forks source link

Convert remote AsciiDoc files to browser guide #62

Open ggrossetie opened 2 years ago

ggrossetie commented 2 years ago

As requested by @jexp, it would be great to be able to convert any AsciiDoc files to browser guide. We could add a new route, for instance /browser-guide, that takes a source parameter:

GET https://portal.graphgist.org/browser-guide?source=https://raw.githubusercontent.com/neo4j-contrib/sandbox-code-updater/main/README.adoc

The above route will load the AsciiDoc file from the source parameter (in this case GitHub), convert it to a browser guide and return HTML.

If we want to get fancy, we could support other URL format for GitHub (or other well-know providers), for instance:

?source=https://github.com/neo4j-contrib/sandbox-code-updater/blob/main/README.adoc
?source=github:neo4j-contrib/sandbox-code-updater/main/README.adoc

Or even include the source in the route:

GET https://portal.graphgist.org/browser-guide/github/neo4j-contrib/sandbox-code-updater/main/README.adoc
GET /browser-guide/github/{org}/{repository}/{branch}/{path}

We could then use this URL in the Neo4j browser:

neo4j-desktop://graphapps/neo4j-browser?cmd=play&arg=https://portal.graphgist.org/browser-guide/github/neo4j-contrib/sandbox-code-updater/main/README.adoc