-
Notifications
You must be signed in to change notification settings - Fork 29
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
This looks awesome, but how do I use it? #10
Comments
...and now I see there's a note about invocation at the very bottom of the README; if I've taken the trouble to read through the whole implementation I might find it. Would you be open to a PR that fixes this? |
Thanks for the feedback! It might be worth re-factoring the way the "code" is structured in the repo to have a more traditional README with usage instructions, and start the implementation in a different file, rather than diving straight into implementation. But the summary of usage is: run For installing, I just had a look at your test file and it looks good, it looks like there's a bug in a regex in lmt where it's getting confused by the |
Need to read your comment, but I created this which I thought you might find useful as a getting started guide: https://gist.github.com/dabrahams/d8d44126a6472e5c3308ffa778c55ddd |
I just pushed a commit which should fix the regex so that "c++" passes the part of the regex used for recognizing the language, it should work with c++ code blocks now. |
Ah, well thanks, but I think I was just wrong to use "c++"; as the list I
referenced shows, it's "cpp". Point is, using that will not produce the
intended syntax highlighting anywhere. On the bright side, you may now have
written the only tool in the world that recognizes ```c++... blocks ;-).
Thanks for the feedback! It might be worth re-factoring the way the "code"
is structured in the repo to have a more traditional README with usage
instructions, and start the implementation in a different file, rather than
diving straight into implementation.
I think that would have been easier for me, yes.
But the summary of usage is: run lmt with a list of markdown files as
arguments. Markdown code blocks are either named by having a double quote
enclosed string after the markdown language tag of the code block, or
filenames by having a non-quoted filename (where filename is defined as
"meets the regex in the README"). If any code block has a <<< ... >>> enclosed
line, it's replaced by the last code block with that name in any files
passed as arguments. You can use this to start with a naïve implementation
of something then progressively overwrite it as your thought
process/narrative/implementation evolves.
That's great!
For installing, go get github.com/driusan/lmt should be enough to install
it in the $GOBIN directory (or at least, that was the case when it was
initially written.. I'm not sure if Go automatically installing things has
changed since go modules were added.) The go code is extracted alongside
the markdown in the README for bootstrapping purposes. The lmt command in
the README should just need is just if you've changed the code of lmt
itself.
Yeah, see, I don't have a $GOBIN variable set in my shell and can't figure
out what that might be (I installed go using homebrew).
…On Fri, Feb 19, 2021 at 5:11 PM Dave MacFarlane ***@***.***> wrote:
I just pushed a commit which should fix the regex so that "c++" passes the
part of the regex used for recognizing the language, it should work with
c++ code blocks now.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKYIK4BPP7WAOGNMUQ6ILS74D4PANCNFSM4X5CWGBA>
.
--
-Dave
|
Latest updates to https://gist.github.com/dabrahams/d8d44126a6472e5c3308ffa778c55ddd might make a good foundation for a new README, if you make it less language-centric. Cheers! |
I reread the existing README and your gist and I think you're right, your version is much better and more user-friendly than diving into the implementation. (I also noticed the existing implementation could use some editing... I don't know if I've really read it since I wrote it and got it working.) Could you send a PR that:
I'll still modify your content before merging and it might take me a while before I get a chance, but that way the authorship information in the git history will be correct. |
To add my own input, I’d say that a few usage and error messages would go a long way. Invoking it without arguments should probably print a help message, I'll see about adding that in a PR. |
This project looks extremely promising to me; I'm so excited!
But I'm not fluent in the idioms of go, so it's not obvious how to build, install, and invoke it. Just a little help in the readme for users of other languages would make a big difference.
Here's my intro experience:
go get
do anythinggo help build
outputgo build -o ~/bin/lmt
, which left an executable in ~/bin. Great.lmt --help
seemed to be trying to open--help
as a filelmt test.txt
had no effect.lmt *.md
in the source dir to make sure it worked; it seemed to, but it generated different contents for main.go, which didn't actually compile.```c++
blockslmt README.md WhitespacePreservation.md SubdirectoryFiles.md LineNumbers.md
, in that order, to reproducemain.go
The text was updated successfully, but these errors were encountered: