Search code examples
apiary.ioapiary

How to write code snippet in apiary.io?


I am using apiary.io and added all restful endpoints. It looks great, there are code snippets in many languages how to make GET request and get the results.

Now, I want to add a code snippet to the documentation, which is not related to any endpoints (example for the authentication process). I want this code to be shown on the right, without clicking on any link. Can I somehow achieve this? I would like to have the code highlighted and indented as in my IDE. I am using Python, if that is relevant.

Thank you in advance!


Solution

  • I assume by "code to be shown on the right" you mean in the machine column (the rightest one) with another code examples. If I am correct, I have to disappoint you - unfortunately it's not possible as machine column is generated from HTTP resources only.

    You can put your code example into documentation using standard Markdown syntax, e.g.:

    ```python

    s = "Python syntax highlighting"
    print s  
    

    ```