Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an Elixir encode example #1352

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/modules/setup/examples/encode.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:zlib.compress(graph)
|> Base.url_encode64()
11 changes: 10 additions & 1 deletion docs/modules/setup/pages/encode-diagram.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ On this page you will learn how to encode a diagram using:
- xref:go[]
- xref:php[]
- xref:tcl[]
- xref:elixir[]

[#nodejs]
== Node.js
Expand Down Expand Up @@ -151,4 +152,12 @@ include::example$encode.php[]
puts [string map {+ - / _} [binary encode base64 [zlib compress $diagramSource]]]
----

Also, see the Tcl package {uri-dia2kroki}[dia2kroki] which has procedures to both decode and encode the diagram source code and a GUI to create diagrams with a live preview.
Also, see the Tcl package {uri-dia2kroki}[dia2kroki] which has procedures to both decode and encode the diagram source code and a GUI to create diagrams with a live preview.

[#elixir]
== Elixir

[source,elixir]
----
include::example$encode.ex[]
----