Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolves #62 convert remote AsciiDoc to browser guide #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ggrossetie
Copy link
Collaborator

@ggrossetie ggrossetie commented Jun 13, 2022

This pull request introduces a new endpoint to fetch a remote (i.e, web accessible) AsciiDoc file and convert it to a browser guide.

Usage

Convert https://raw.githubusercontent.com/neo4j-graph-examples/cybersecurity/main/README.adoc to a browser guide:

GET /browser_guide?source=https://raw.githubusercontent.com/neo4j-graph-examples/cybersecurity/main/README.adoc

Please note that this endpoint also supports the following URL: https://github.com/neo4j-graph-examples/cybersecurity/blob/main/README.adoc. It will convert the URL to https://raw.githubusercontent.com/neo4j-graph-examples/cybersecurity/main/README.adoc in order to get the get the raw content (i.e., plain text).

In other words, the following query is equivalent to the first one:

GET /browser_guide?source=https://github.com/neo4j-graph-examples/cybersecurity/blob/main/README.adoc

Using a query parameter is not always very practical, mostly because the URL needs to be escaped. To workaround potential issue you can use this special endpoint if your content if available on GitHub:

GET /browser_guide/github/:org/:repo/:branch/:path

For instance:

GET /browser_guide/github/neo4j-graph-examples/cybersecurity/main/README.adoc

resolves #62

@ggrossetie ggrossetie force-pushed the issue-62-convert-remote-adoc-to-browser-guide branch from d2618c5 to 298fbce Compare June 24, 2022 13:47
@ggrossetie ggrossetie marked this pull request as ready for review June 24, 2022 13:48
Copy link
Member

@jexp jexp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks so much !!

@jexp
Copy link
Member

jexp commented Jun 27, 2022

@Mogztter would there be a way to render it like we do with the graphgists:

https://guides.neo4j.com/graph-examples/exploring-the-star-wars-social-network/graph_guide

or would we just append the query-parameter/path after graph-examples ?

this https://guides.neo4j.com/graph-examples/* currently rewrites to: https://graphgist-v3-api.herokuapp.com/graph_gists/*

@ggrossetie
Copy link
Collaborator Author

ggrossetie commented Jun 28, 2022

I guess I can use /graph_gists instead of /browser_guide (new)?

@jexp
Copy link
Member

jexp commented Jun 28, 2022

Yeah or we need to add another rewrite rule to the bucket. I guess otherwise they will conflict with the regular graph_gists routes?

@ggrossetie
Copy link
Collaborator Author

ggrossetie commented Jun 28, 2022

I guess otherwise they will conflict with the regular graph_gists routes?

Yes they could conflict, probably better to keep them separated.

https://guides.neo4j.com/browser/* -> https://graphgist-v3-api.herokuapp.com/browser_guide/*

https://guides.neo4j.com/ serves only browser guides?

Alternative name:

  • https://guides.neo4j.com/browser-guides
  • https://guides.neo4j.com/get
  • https://guides.neo4j.com/convert

Do query parameters work with the bucket rewrite rule?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert remote AsciiDoc files to browser guide
2 participants