neo4j-documentation / asciidoctor-jupyter

A Jupyter converter for Asciidoctor.js. Write your Notebook in AsciiDoc!
16 stars 1 forks source link

6 non python listing #7

Closed thomas-saigre closed 1 year ago

thomas-saigre commented 1 year ago

In the adoc file, when the following lines are entered :

[source, py]
----
def f(x):
    return x + 1
----

or

[source, py]
----
def f(x):
    return x + 1
----

this will result in a code cell in the jupyter notebook exported,

while

[source, c++]
----
int main(int argc, char *argv[]{
   return 0;
}
----

will result in a mardown cell where the code is entered as mardown code (for every language except python or py).

Some tests were broken, see 33f362dc2585209631abc57588eaf1b14f4e4825 for the corrections I made, please review and tell me if they are correct or I should change anything.

ggrossetie commented 1 year ago

I think it's correct. For reference, w are converting Cypher blocks into Python blocks (using an Asciidoctor TreeProcessor) in the Neo4j documentation. For example: https://neo4j.com/graphgists/cypher-introduction-social-movie-database/

We now need to update the language from cypher to python (in the extension) but that's actually more accurate.