You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
Activity
ekalinin commentedon Mar 12, 2015
Thanks for idea. Seems, it make sense.
shrayasr commentedon Mar 21, 2015
👍 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:
--urlsfollowed by a list of urls and--filesfollowed by a list of files.logicminds commentedon Mar 21, 2015
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 commentedon Mar 21, 2015
Which means that one can process a combination of both URLs and File Paths. 🆒
logicminds commentedon Mar 21, 2015
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 commentedon Mar 22, 2015
Agree. I too see more value in doing this one by one than all together. I just pipe it to
pbcopyand 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 commentedon Mar 22, 2015
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 commentedon Mar 22, 2015
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 commentedon Mar 23, 2015
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
.mdto.html👍 😄
ekalinin commentedon Mar 23, 2015
Thank you :)
added ability to read markdown from STDIN, fixes #4