Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Remove extension on -o option #102

Closed
angrykoala opened this issue Oct 14, 2016 · 6 comments
Closed

Remove extension on -o option #102

angrykoala opened this issue Oct 14, 2016 · 6 comments
Labels
Milestone

Comments

@angrykoala
Copy link
Owner

e.g. yamp readme.md -o readme.pdf will generate readme.pdf.pdf

It should only be readme.pdf

This issue is related to #41

@angrykoala angrykoala added this to the 0.5 milestone Oct 14, 2016
@cosminlupu
Copy link
Contributor

I've added pull request #106 for this issue.

angrykoala added a commit that referenced this issue Oct 15, 2016
Remove extension on -o option #102
@angrykoala
Copy link
Owner Author

angrykoala commented Oct 15, 2016

@cosminlupu I see you removed extensions matching the output filename in #106
What do you think we should do if the given extension is different?
e.g.

yamp file.md -o newfile.html --pdf

I'm not sure if the expected behavior for the user will be to remove the extension (newfile.pdf) or get a file (newfile.html.pdf)

@cosminlupu
Copy link
Contributor

@angrykoala IMO if the output filename doesn't contain the given extension, then the extension should be appended, as what we perceive as an extension, might be wanted as part of the filename.

Example: yamp file.md -o newfile.v1 --pdf should result in newfile.v1.pdf

If there is no given extension, but the output filename contains one ( and the it is one used by renderers ), then that should be automatically detected. I guess that is what issue #41 is all about.

Example:

yamp file.md -o newfile.html should result in newfile.html
yamp file.md -o newfile.pdf should result in newfile.pdf

@angrykoala
Copy link
Owner Author

Makes sense. We could add the /i to the regular expression, so .HTML and .PDF are also replaced

@cosminlupu
Copy link
Contributor

I agree. Added in pull request #107

@angrykoala
Copy link
Owner Author

Nice, some tests may be updated, but for now, the issue is closed

angrykoala added a commit that referenced this issue Oct 15, 2016
Remove extension on -o option case insensitive #102
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Development

No branches or pull requests

2 participants