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

added docs for Yamel.decode and Yamel.decode! #9

Merged
merged 2 commits into from
Oct 7, 2020

Conversation

joseemds
Copy link
Contributor

@joseemds joseemds commented Oct 6, 2020

Added docs as issue #4 asked

Copy link
Owner

@GPrimola GPrimola left a 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")
Copy link
Owner

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.

Copy link
Contributor Author

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)

Copy link
Owner

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.

Copy link
Contributor Author

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

Copy link
Owner

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?

Copy link
Contributor Author

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
...> ")
Copy link
Owner

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.

@GPrimola GPrimola added documentation Improvements or additions to documentation Hacktoberfest https://hacktoberfest.digitalocean.com/ labels Oct 6, 2020
Copy link
Owner

@GPrimola GPrimola left a 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! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Hacktoberfest https://hacktoberfest.digitalocean.com/ hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants