From 21e9720190dd134cc0ab59caefd26d6284fcfd7d Mon Sep 17 00:00:00 2001 From: toctien0904 Date: Fri, 11 Apr 2014 13:19:27 +0700 Subject: [PATCH 1/4] Update and rename HowTo.adoc to phuongtest.adoc --- meta/HowTo.adoc | 217 ------------------------------------------- meta/phuongtest.adoc | 2 + 2 files changed, 2 insertions(+), 217 deletions(-) delete mode 100644 meta/HowTo.adoc create mode 100644 meta/phuongtest.adoc diff --git a/meta/HowTo.adoc b/meta/HowTo.adoc deleted file mode 100644 index df7b8ff..0000000 --- a/meta/HowTo.adoc +++ /dev/null @@ -1,217 +0,0 @@ -= How to create a GraphGist - -:neo4j-version: 2.0.0 -:author: Anders Nawroth -:twitter: @nawroth - -You create a GraphGist by creating a https://gist.github.com/[GitHub Gist] in http://asciidoctor.org/docs/asciidoc-quick-reference/[AsciiDoc] and enter the URL to it in the form on this page. -Alternatively, you can put an AsciiDoc document in https://www.dropbox.com/[Dropbox] and enter the public URL in the form. - -This GraphGist shows the basics of using AsciiDoc syntax and a few additions for GraphGists. -The additions are entered as comments on their own line. -They are: +//console+ for a query console; +//hide+, +//setup+ and +//output+ to configure a query; +//graph+ and +//table+ to visualize queries and show a result table. - -Click on the Page Source button in the menu to see the source for this GraphGist. -Read below to get the full details. - -== Include a query console - -+//console+ - -becomes: - -//console - -== Define a http://docs.neo4j.org/chunked/snapshot/cypher-query-lang.html[Cypher] query - - [source,cypher] - ---- - CREATE (n{name:'cypher'})-[r:LIKES]->({name:'icecream'}) - RETURN n.name, r - ---- - -becomes: - -[source,cypher] ----- -CREATE (n{name:'cypher'})-[r:LIKES]->({name:'icecream'}) -RETURN n.name, r ----- - -_Queries are executed in the order they appear on the page during rendering, so make sure they can be performed in that order._ -If you have a _setup query,_ it normally makes most sense to define it as the first query on the page. -If it takes up too much space, hide it (see below for information on this). -Each query has a green or red button to indicate if the query was successful or not. -The console is set up after the executions, with an empty database, for the reader to play around with the queries. - -There's three additional settings you can use for queries. -They all go as comments, on their own lines, before the query. -The settings are: - -[width="50%",cols="1m,5"] -|=== -| hide | Hide the query. The reader can still expand it to see it. - Useful for long queries like setting up initial data. -| setup | Initialize the console with this query. -| output | Show the output from the query. - The output is always there, but this option makes it visible at page load for this query. -|=== - -Let's try all the settings together, which means this query will be used to initialize the console, it will be hidden, and the raw output will be shown: - - //hide - //setup - //output - [source,cypher] - ---- - CREATE (n{name:'neo4j'})-[:LIKES]->({name:'complex data'}) - RETURN n.name - ---- - -which becomes: - -//hide -//setup -//output -[source,cypher] ----- -CREATE (n{name:'neo4j'})-[:LIKES]->({name:'complex data'}) -RETURN n.name ----- - -[NOTE] -The test run will always run the queries from top to bottom, so it usually makes sense to have the setup query as the first query. - -== Show a graph visualization - -The visualization is based on the database contents after the preceding query in the page. - -+//graph+ - -becomes: - -//graph - -== Show a result table for a query - -This will show a result table for the preceding query. - -+//table+ - -becomes: - -//table - -== Basic AsciiDoc formatting - -[width="50%",cols="1m,1a"] -|=== -| \_Italic_ | _Italic_ -| \*Bold* | *Bold* -| \`Monospace` | `Monospace` -| `http://www.neo4j.org/` | http://www.neo4j.org/ -| `http://www.neo4j.org/[neo4j.org]` | http://www.neo4j.org/[neo4j.org] -| `link:./?5956246[Link to a GraphGist]` | link:./?5956246[Link to a GraphGist] -|=== - -=== Headings: - - = Heading 1 - == Heading 2 - === Heading 3 - -=== Images: - -Static images: - - image::http://assets.neo4j.org/img/still/cineasts.gif[] - -becomes - -image::http://assets.neo4j.org/img/still/cineasts.gif[] - -Dynamically generated image (using http://yuml.me/[yUML]): - - image::http://yuml.me/diagram/scruffy/class/[Order]-billing%20%3E[Address%7Cname=hej],%20[Order]-shipping%20%3E[Address],[Order]-has%3E[Item][test] - -becomes - -image::http://yuml.me/diagram/scruffy/class/[Order]-billing%20%3E[Address%7Cname=hej],%20[Order]-shipping%20%3E[Address],[Order]-has%3E[Item][test] - -=== Lists: - ----- -* Item 1 -** Item 1.1 -* Item 2 ----- - -* Item 1 -** Item 1.1 -* Item 2 - ----- -. First -. Second ----- - -. First -. Second - -Monospaced block: indent lines with one space. - -Tables are well supported. -See http://asciidoctor.org/docs/asciidoc-quick-reference/[AsciiDoc Quick Reference] for information on that and more. - - -== Mathematical formulas - -When using Math formulas, put them into a source block using LaTex syntax with `\(` as a start delimiter. - -The end delimiter is `\)`. -The delimiters and the content between them should be placed in a AsciiDoc passthrough block without attribute substitution. -The formulas are rendered through http://www.mathjax.org/demos/tex-samples/[MathJAX], supported commands are http://docs.mathjax.org/en/latest/tex.html#supported-latex-commands[here]. - - [subs=none] - ++++ - \(ax^2 + bx + c \ne 0\) - ++++ - -becomes - -++++ -\(ax^2 + bx + c \ne 0\) -++++ - -Below are some more examples. - -[subs=none] -++++ -1. -\( -\begin{equation} -\left[ -{\bf X} + {\rm a} \ \geq\ -\underline{\hat a} \sum_i^N \lim_{x \rightarrow k} \delta C -\right] -\end{equation} -\) -
-2. \(ax^2 + bx + c \ne 0\) - -
-4. \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\) -
- -5. \(\sin^{-1} \theta\) -
- -6. \(\int_a^b f(x)~dx\) -
- -7.\(\sum\limits_{i=1}^n X_i\) -
-++++ - -for more examples, see http://gist.neo4j.org/?6725918[Some GraphGist Latex Examples] - diff --git a/meta/phuongtest.adoc b/meta/phuongtest.adoc new file mode 100644 index 0000000..07630ed --- /dev/null +++ b/meta/phuongtest.adoc @@ -0,0 +1,2 @@ +CREATE (n{name:'Que Phuong'})-[r:LIKES]->({name:'Amaryllis'}) +RETURN n.name, r From c4366e55c591e55824bb2ebc7b4d144e49f44f00 Mon Sep 17 00:00:00 2001 From: toctien0904 Date: Fri, 11 Apr 2014 13:22:29 +0700 Subject: [PATCH 2/4] Update phuongtest.adoc --- meta/phuongtest.adoc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/meta/phuongtest.adoc b/meta/phuongtest.adoc index 07630ed..5fbbe1f 100644 --- a/meta/phuongtest.adoc +++ b/meta/phuongtest.adoc @@ -1,2 +1,8 @@ -CREATE (n{name:'Que Phuong'})-[r:LIKES]->({name:'Amaryllis'}) -RETURN n.name, r +//hide +//setup +//output +[source,cypher] +---- +CREATE (n{name:'neo4j'})-[:LIKES]->({name:'complex data'}) +RETURN n.name +---- From f177eaf4256fdfe25b22077b34aa8f8123dd62bc Mon Sep 17 00:00:00 2001 From: toctien0904 Date: Fri, 11 Apr 2014 15:58:25 +0700 Subject: [PATCH 3/4] Update phuongtest.adoc --- meta/phuongtest.adoc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/meta/phuongtest.adoc b/meta/phuongtest.adoc index 5fbbe1f..b27037d 100644 --- a/meta/phuongtest.adoc +++ b/meta/phuongtest.adoc @@ -1,8 +1,9 @@ -//hide -//setup -//output +//console [source,cypher] ----- +==== CREATE (n{name:'neo4j'})-[:LIKES]->({name:'complex data'}) -RETURN n.name ----- +RETURN n as node +==== +== This cool +//table +//graph From 17ef39031a95593c3df84de051d54c1623a79a26 Mon Sep 17 00:00:00 2001 From: toctien0904 Date: Fri, 11 Apr 2014 16:06:56 +0700 Subject: [PATCH 4/4] Update phuongtest.adoc --- meta/phuongtest.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/phuongtest.adoc b/meta/phuongtest.adoc index b27037d..ed92d1e 100644 --- a/meta/phuongtest.adoc +++ b/meta/phuongtest.adoc @@ -1,7 +1,7 @@ //console [source,cypher] ==== -CREATE (n{name:'neo4j'})-[:LIKES]->({name:'complex data'}) +CREATE (n{name:'Phuong'})-[:LIKES]->({name:'Neo4J'}) RETURN n as node ==== == This cool