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

read from STDIN or file argument #4

Closed
logicminds opened this issue Mar 12, 2015 · 10 comments
Closed

read from STDIN or file argument #4

logicminds opened this issue Mar 12, 2015 · 10 comments

Comments

@logicminds
Copy link

Awesome utility. It would be nice to be able to have this read from STDIN or from a --file attribute.

@ekalinin
Copy link
Owner

Thanks for idea. Seems, it make sense.

@shrayasr
Copy link

👍 from me.

If we consider implementing this, multiple files might be a requirement like multiple URLs. Does it makes sense then for a new flag to be introduced to indicate the source?

Eg: --urls followed by a list of urls and --files followed by a list of files.

@logicminds
Copy link
Author

I would just read the arguments given on the command line and write a function to determine if its a url or file path, then process each.

@shrayasr
Copy link

Which means that one can process a combination of both URLs and File Paths. 🆒

@logicminds
Copy link
Author

Personally, I think processing one file at a time would be easier since the output goes to stdout. I am not sure when I would process multiple files at once because the output would be hard to distinguish between each file.

@shrayasr
Copy link

Agree. I too see more value in doing this one by one than all together. I just pipe it to pbcopy and voila, i'm good to go.

But since the tool already supports multiple URL conversion, I brought this up. Not a good idea to break compatibility.

@shrayasr
Copy link

Took some time out since last night to understand the core logic of how this works. It generates the TOC based on the HTML and not on the markdown. Making it work with local files would mean quite a lot of change because of this.

Please correct me if I'm wrong @ekalinin

@ekalinin
Copy link
Owner

Guys,

Thanks for discussion.
Just added an ability to proccess local markdown files (but not only remote html).
Seems, works. Check out new README

@shrayasr
Copy link

Just noticed how you did it (https://github.com/ekalinin/github-markdown-toc/blob/master/gh-md-toc#L42-L53). That's pretty darned epic. Didn't know GH had an api to convert .md to .html

👍 😄

@ekalinin
Copy link
Owner

Thank you :)

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

No branches or pull requests

3 participants