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 option for file extension #18

Open
kamalsacranie opened this issue May 10, 2022 · 3 comments
Open

Add option for file extension #18

kamalsacranie opened this issue May 10, 2022 · 3 comments

Comments

@kamalsacranie
Copy link

Would be useful for file extension specific shortcuts like syntax for \\[...\\] in vim etc.

Edited the cli.py and it worked for me by adding:

@app.command("convert")
def convertMarkdown(
    ...,
    file_extension: str = typer.Option(
        ".md",
        "--extension",
        help="Extension of the text files containing your markdown, e.g. '.md'",
        ),
    ,...
)

And the altering is_correct_filetype():

def is_correct_file_type(file, file_extension: str):
    """Check if a file is a markdown file."""
    # TODO(lukemurray): parameterize markdown extensions?
    if file_extension != ".md":
        return file.endswith(file_extension)
    return file.endswith(".md")

I would go and make a pull request but am in the middle of exams :(

@lukesmurray
Copy link
Owner

seems completely reasonable. I am also a bit busy at the moment but am open to pull requests and will try to add this functionality once I have some spare time. Glad you are enjoying the project and good luck with exams!

@lukesmurray
Copy link
Owner

Reopening and will close once the PR is approved and merged.

@lukesmurray lukesmurray reopened this May 26, 2022
@lukesmurray lukesmurray mentioned this issue May 26, 2022
@lukesmurray
Copy link
Owner

Now fixed by #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants