-
Notifications
You must be signed in to change notification settings - Fork 2
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
added docs for Yamel.decode and Yamel.decode! #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@udududu despite the RCs, this is a great job! Thank you very much!
lib/yamel.ex
Outdated
...>name: Jane Doe | ||
...>job: Developer | ||
...>skill: Elite | ||
...>employed: True") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@udududu could you remove all those ...>
so the output can match? If you copy and past this as is (which most of the times is the purpose of this example), it will yield another output than the one below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When i try to do it without the ...>
the doctest throws an error of missing terminator "
, and when i paste the YAML in the iex it turns like the example, that why i put like this, can you please give a example of how is suppose to be? (Also i fixed the number of the issue in the PR, didnt see that referenced the wrong one, sorry)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@udududu if you copy the following snippet from the documentation and paste it on the repl iex -S mix
:
Yamel.decode!("
...>name: Jane Doe
...>job: Developer
...>skill: Elite
...>employed: True")
=> %{
"...>employed" => true,
"...>job" => "Developer",
"...>name" => "Jane Doe",
"...>skill" => "Elite"
}
which is correct, but it's kinda odd.
Try to use ~S"""..."""
instead of "..."
as the argument of the Yamel.decode!/1
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GPrimola im still having some errors, maybe i will change the examples to one line just to be more simple, if i dont find a way to solve it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@udududu I've cloned your repo to see what's going on. Thing is:
If instead you have an `iex>` expression that spans over multiple lines, please make sure that each line after the first one begins with `...>`.
This is one of the errors that appear when testing with this doctest. I don't know if you could understand it, but what it says is that ...>
continues the iex>
. So, with that in mind, my suggestion is:
iex> Yamel.decode!("
...> name: Jane Doe
...> job: Developer
...> skill: Elite
...> employed: True")
This is way more readable than it was before. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GPrimola Yeah i did it, much better to read
lib/yamel.ex
Outdated
...>- Orange | ||
...>- Strawberry | ||
...>- Mango | ||
...> ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@udududu same comment as above here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect @udududu! Thank you very much for your contribution! I really appreciate! :)
Added docs as issue #4 asked