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 different file formats #47

Open
evanthegrayt opened this issue Jun 8, 2020 · 0 comments
Open

Add different file formats #47

evanthegrayt opened this issue Jun 8, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@evanthegrayt
Copy link
Owner

evanthegrayt commented Jun 8, 2020

It'd be cool if this gem knew how to read/write yaml files. The only thing that would need to be added is new load/write methods.

This will actually help with another design problem I'm having. I want to add a to_md method at the entry level that will return the entry as an array of markdown lines. We already have to_json and to_h, at the entry level, so to_md would be nice. Then, when writing a file, we could just do

File.open(file, 'w') do |f|
  entry_list.each { |e| f.puts(e.to_md) }
end

The only thing I don't like about this, is I don't feel like the config for markdown should be in the Entry class. In other words, this feels wrong:

StandupMD.configure do |s|
  s.entry.header_depth = 2
  s.entry.bullet_character = '*'
end

BUT, if we have different parsers for YAML, Markdown, etc, then the config can live in those classes.

@evanthegrayt evanthegrayt added the enhancement New feature or request label Jun 8, 2020
@evanthegrayt evanthegrayt added this to the Version 1.0.0 release milestone Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant