[ 
https://issues.apache.org/jira/browse/TINKERPOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

stephen mallette updated TINKERPOP-1114:
----------------------------------------
    Affects Version/s:     (was: 3.0.2-incubating)
                       3.1.0-incubating
               Labels:   (was: documentation newbie)

If you'd like to offer a pull request for this change, that would be cool.  
Note that you can't change the formatting of the number marker too much (i 
don't think) as it is something specific to asciidoc syntax. 

Also note that you don't need to introduce the "//" everywhere. For segments 
that use "gremlin-groovy" code formatting, the "//" are automatically added 
when docs are generated:

{code}
[gremlin-groovy,modern]
----
g.V()    <1>
g.V(1)    <2>
g.V(1).values('name')    <3>
g.V(1).outE('knows')    <4>
g.V(1).outE('knows').inV().values('name')    <5>
g.V(1).out('knows').values('name')    <6>
g.V(1).out('knows').has('age', gt(30)).values('name')    <7>
----
{code}

You only need to add the "//" to code sections that are static (with "groovy" 
or "java" formatting):

{code}
[source,java]
Graph graph = TinkerGraph.open(); <1>
Vertex marko = graph.addVertex(T.label, "person", T.id, 1, "name", "marko", 
"age", 29); <2>
Vertex vadas = graph.addVertex(T.label, "person", T.id, 2, "name", "vadas", 
"age", 27);
Vertex lop = graph.addVertex(T.label, "software", T.id, 3, "name", "lop", 
"lang", "java");
Vertex josh = graph.addVertex(T.label, "person", T.id, 4, "name", "josh", 
"age", 32);
Vertex ripple = graph.addVertex(T.label, "software", T.id, 5, "name", "ripple", 
"lang", "java");
Vertex peter = graph.addVertex(T.label, "person", T.id, 6, "name", "peter", 
"age", 35);
marko.addEdge("knows", vadas, T.id, 7, "weight", 0.5f); <3>
marko.addEdge("knows", josh, T.id, 8, "weight", 1.0f);
marko.addEdge("created", lop, T.id, 9, "weight", 0.4f);
josh.addEdge("created", ripple, T.id, 10, "weight", 1.0f);
josh.addEdge("created", lop, T.id, 11, "weight", 0.4f);
peter.addEdge("created", lop, T.id, 12, "weight", 0.2f);
{code}

Please be sure to do a full doc generation to be sure everything works after 
your changes.  You can do that with {{bin/process-docs.sh}}. Be sure that you 
have hadoop running when you do this.



> Documentation examples friendly for REPL/copy-paste
> ---------------------------------------------------
>
>                 Key: TINKERPOP-1114
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1114
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: documentation
>    Affects Versions: 3.1.0-incubating
>            Reporter: Adam
>            Priority: Minor
>
> All code examples in existing documentation sometimes have "anchors" - 
> numbers at the end of line which are explained later or create a kind of 
> mapping between text and picture, e.g.
> gremlin> marko.out('knows').values('name') (2)
> The problem with them is that:
> 1) you need to edit such text if you want to paste it. You can't just paste a 
> whole block to see what is the result in your console
> 2) at the first glance, it may look like additional list of parameters for 
> whose who write in languages like Scala (curried function)
> The simple way would be to separate them as comments
> gremlin> marko.out('knows').values('name') // (2)
> perhaps with any other more-specific visual way:
> gremlin> marko.out('knows').values('name')  //  **2
> Such change would make documentation more REPL - friendly and as everything 
> that lowers entry barrier to such great project like this, may be worth your 
> consideration.
> I am happy to help with conversion / scripting that change if there will be 
> go ahead for it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to