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 way to convert files #16

Closed
evanthegrayt opened this issue Apr 18, 2020 · 2 comments
Closed

Add way to convert files #16

evanthegrayt opened this issue Apr 18, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@evanthegrayt
Copy link
Owner

Add way to change configurations for the whole pre-existing file. For example, if a file currently uses - (dash) for bullet_character, but they want to change it to *, call a method called #convert:

def convert(attribute, from, to)
  # rewrite the file with the attribute change from`from` to `to`
end

s = Standup.new
s.convert(:bullet_header, '-', '*')
@evanthegrayt evanthegrayt added the enhancement New feature or request label Apr 18, 2020
@evanthegrayt
Copy link
Owner Author

evanthegrayt commented Apr 18, 2020

On second thought, I'm already making it so when a file is read in, the leading character is removed and then re-added when the file is written. Since I know what the header should be, when I read it in, I can make sure the current settings match what's already in the file. For example, if entry_header_depth == 2, but the entry header starts with ###, we can pretty easily determine that. Ask the user if they'd like to change this setting for the whole file; if they don't, it can cause issues reading it.

@evanthegrayt evanthegrayt added this to the Version 1.0.0 release milestone Apr 18, 2020
@evanthegrayt
Copy link
Owner Author

After my major refactor, files should now be able to be reformatted as such:

file = StandupMD::File.find('2020_06.md').load
StandupMD.config.file.bullet_character = '-'
file.write

Just make sure to change that value in your ~/.standuprc after you update the file

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