Roger-luo / Configurations.jl

Options & Configurations made easy.
https://configurations.rogerluo.dev/stable
MIT License
80 stars 12 forks source link

Some typos #19

Closed fonsp closed 3 years ago

fonsp commented 3 years ago

Hey @Roger-luo !

I am going to use Configurations.jl for another project today, really cool!

fonsp commented 3 years ago

For the readme, I felt like it is still missing a basic example. Here's one, but I wasn't quite sure where to put it. Feel free to use it how you want!

julia> using Configurations

julia> @option struct Settings
           enable_thing::Bool=true
           number::Integer=5
           name::String="Cool!"
       end

julia> x = Settings(number=20)
Settings(
    number = 20,
)

julia> write("my_settings.toml", to_toml(x)); 

julia> read("my_settings.toml", String) # let's look at the file
"number = 20\n"

julia> y = from_toml(Settings, "my_settings.toml")
Settings(
    number = 20,
)

julia> y == x
true
codecov[bot] commented 3 years ago

Codecov Report

Merging #19 (4d0b9da) into master (6f44e3e) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #19   +/-   ##
=======================================
  Coverage   90.12%   90.12%           
=======================================
  Files           1        1           
  Lines         466      466           
=======================================
  Hits          420      420           
  Misses         46       46           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6f44e3e...4d0b9da. Read the comment docs.

Roger-luo commented 3 years ago

I am going to use Configurations.jl for another project today, really cool!

thanks, it's basically the same thing as implemented in Pluto a while ago, but more automatic and generic.

Roger-luo commented 3 years ago

For the readme, I felt like it is still missing a basic example. Here's one, but I wasn't quite sure where to put it. Feel free to use it how you want!

Thanks, I'll probably include it in the quick start doc, I'm trying to simplify the README, so for the simple case, people can know how to use it without scrolling the page.