Git Product home page Git Product logo

filterpipes's People

Contributors

tylerl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mckern strogo

filterpipes's Issues

Parsing file from stdin?

I try formatting via xmllint --format but to no avail. xmllint accepts input either via filename (last position on command-line) or via stdin. Then the typical "-" must be added. I tried with and without "-". I also tried setting shell to true and put all into a single string ("xmllint --format" with and without "-") but that tries to parse the whole string as the command's path/name, which, of course, breaks.
If I leave out the "-", then I get the usage message of the xmllint command in return (but nothing else). If I add the "-" then nothing happens and FitlerPipes signals: Nothing changed. So, currently I have this:

{
  "caption": "FilterPipes: Format XML (xmllint)",
  "command": "filter_pipes_process",
  "args": { "command": ["xmllint", "--format", "-"] }
}

but that does not work out as I would have expected. As a sidenote: I am on Win10 with Cygwin installed (that's the verision of xmllint I use). Thanks.

Problems running HTMLTidy

Hi,
I am using Sublime3 on Windows7 and Python 2.7 as default Python. The external command I try to run identifies as: "HTML Tidy for Cygwin released on 1st September 2004". There is no newer version for Cygwin.

If no output filepath is given to Tidy, it returns the tidied document on STDOUT. However, it also may dump a lot of errors and warnings (even if an output file name has been set). This, however, can be switched off by setting an error file. Thus my configuration for this FilterPipe is:

{
    "caption": "FilterPipes: Tidy up (XHTML)",
    "command": "filter_pipes_process",
    "args": {
        "command": ["tidy", "-config", "C:\\Users\\bmix\\tidy-xhtmlize.cfg", "-f", "tidy-errs.txt"],
        "shell": false
    }
},

SublimeText 3's console reports:

Error 2 executing command [tidy -config C:\Users\bmix\tidy-xhtmlize.cfg -f tidy-errs.txt]:
b''

I can confirm, that FilterPipes passes the editor's text to Tidy (I saw parts of Tidy's error-report on the document when I left out the errs.txt re-routing). What I do not understand, however, is, that there is no result back, the text within the editor stays the same, rather than being replaced with Tidy's output. I also do not understand the letter "b" with the two single-quote characters.

Can't pipe result of shell command to another command

I've tried several ways to do it, but haven't been able to get it to work yet. Basically, I'm trying to pipe the output from the figlet command processing the selected text through sed to add comment characters at the start of the 'bannerized' text, and then want to pipe that through tr (yes, I'm one of those nerds who use it) to replace some characters. e. g.:
figlet -f banner | sed '/^/--/' | tr '# ' 'โ–ˆโ–‘'

Hopefully someone will see this and can help me figure out how to get the syntax right to make this work.

And thank you @tylerl for a great package/plugin!!!

EDIT: I just googled a bit more on this & found something that might work.

"The $(...) shell operator executes the command within parentheses and substitutes its output into the command line."

Going to try using this method to send the other commands/arguments as strings. Hopefully that'll work & I can close this report.

EDIT2: doesn't seem to work for tr as it won't take the text selection as an argument, and only seems to operate on files passed to it's stdin, or text passed from output of another function.

I could really use some help with this one. I'm all googled out on it.

EDIT 3: Finally figured out out! By using another ST package called multicommand (which will receive & parse other Sublime Text commands & the arguments to them, & execute them in sequence from a single command), I was able to set the primary command in the default .sublime-commands file for FilterPipes to the multicommand, then used that to execute the various other shell & FilterPipes commands I needed to turn a basic text string into either a commented banner in the source script, an assigned variable for a target app's tooltip, or whatever else I might need to do with it.

Returning errors to Sublime

Related to my previous issue #1, where I had to run an external command, whose output may result in two different files, one being an error-report, I would like to propose a switch, that would tell FilterPipes to open a named file after a filter-run (in this case the error-report).

When a program 'Tidy' gets run with an option '-f filespec', then all errors and warnings, that may result from this run will end up in a file designated under 'filespec'. This is in addition to the actual result of the command, which, in this case, would be a modified version of the input-document.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.