docs/_test.md
Some examples of things you can do in docs.
Code blocks now support:
import strawberry
@strawberry.type
class X:
name: str
import strawberry
@strawberry.type
class X:
name: str
This is probably not implemented in the best way, but for now it works:
import strawberry
# ^^^^^^^^^^
# This is a note about this line
# this is a standard comment
@strawberry.type
class X:
name: str
<CodeNotes id="info">Strawberry is a cool library</CodeNotes>
You can show two different code blocks next to each other (useful when comparing the GraphQL schema against the Python definition):
<CodeGrid>import strawberry
@strawberry.type
class Query:
@strawberry.field
def ping(self) -> str:
return "pong"
type Query {
ping: String!
}
or when showing the request and response to a query:
{
ping
}
---
{
"data": {
"ping": "pong"
}
}
This is a tip. Useful information is contained here.
</Tip> <Note>This is a note. Something that you should know about.
</Note> <Warning>This is a warning. Something that you should be careful about.
</Warning>This is a quote
sequenceDiagram
Alice ->> Bob: Hello Bob, how are you?
Bob-->>John: How about you John?
Bob--x Alice: I am good thanks!
Bob-x John: I am good thanks!
Note right of John: Bob thinks a long
long time, so long
that the text does
not fit on a row.
Bob-->Alice: Checking with John...
Alice->John: Yes... John, how are you?