Open i8degrees opened 1 year ago
Wow, I cannot believe that I managed to knock out a basic proof of concept so quickly! I have only tested a tiny subset of the port, and already have I found a very scary bug in how I deal with copying the resulting HTML to the clipboard -- I must sanitize incoming backtick characters before feeding it through the shell. Surely, my poor mind is missing a few other escape characters as well.
Anyhow, nothing that can't wait until another day. :-) Good night.
This sounds awesome. I'll have to figure out how to create multiple build targets with Swift in order to make a single distro work for multiple platforms, but that can't be impossible, right? It might make sense to just keep your fork and link Linux users there from the README and from my site...
By the way, there should be a Swift library for shell escaping, similar to Ruby's Shellwords library, but I didn't find it on a quick search.
Hi there, @ttscoff
We spoke ever so briefly the other week via email. You introduced me to this wonderful piece of software after I asked about https://fuckyeahmarkdown.com. So, it took me a few days to get around to installing Swift on my Linux workstation and seeing what would happen, and I am very happy to say that I was able to get it up and running with very little work.
I have forked this repository at https://github.com/syn-net/gather-cli and once I feel satisfied with a proper solution to replacing the missing bits of code, I will make a pull request and see if you are interested in merging my work upstream.
In short,
NSWorkspace
andNSPasteboard
are the only two missing classes that I need to come up with a solution for. Being a complete newbie to the Swift language, it may take me some time to figure out how best to implement copy and paste in a cross-platform manner. Honestly, I was shocked as hell to see the software in action after simply commenting out the usage of the two classes. I did not realize yet thatNSWorkspace
is a class that must be used for obtaining access to the clipboard of other programs. (If I even understand that correctly?)I have found a snippet of code for how to execute shell commands in Swift. I am thinking that maybe I can use ~
xclip
~xsel
on Linux to serve the same functionality thatNSPasteboard
offers. More challenging perhaps will be how to architect a Swift class out of it, as Objective-C was never my thing. I am sure willing to try, though! I cannot stress just how invaluable your Markdown tools have been to my life.Thanks, Jeff