Coder Social home page Coder Social logo

termidash's Introduction

Termidash

1 What

Termidash is an attempt to get a dash docsets browser from the terminal using fzf to pick from the options.

This repo contains a few tests and trials about how to achieve a neat experience without coding for the corner cases, but in a stream oriented way, using pipes, and maybe using the help of some temporary file.

The whole story starts when developing https://www.github.com/areina/helm-dash, that the application itself seems like it should be just a pipe of:

list -> chose(fzf) -> open-doc

The fact that unix pipes do not allow to pass any other datatype than strings, and the separator is \n, makes it difficult to “hide” information in the middle steps that would be recovered afterwards.

I thought I’d need something like a shwartzian transform but for pipes.

I also got to something semi useful with just 5 lines of bash, but the experience is not really smooth, so I wanted to try some other approaches to the same problem

Here are the 5 lines that kinda solve the problem.

function search() {
   ds=$(ls ~/.docsets/**/*dsidx | fzf)
   sqlite3 $ds 'select * from searchIndex' |
   cut -d\| -f 2 |
   fzf --preview "lynx $(dirname $ds)/Documents/{}" |
   xargs -I{} sqlite3 $ds "select path from searchIndex where name = '{}'" XA -I{} google-chrome "$(dirname $ds)/Documents/{}" }

So this repo contains:

  • a racket app that mimics helm-dash user experience.
  • a bash directory with another app that mimics the helm-dash experience.
  • https://github.com/flonatel/pipexec trial and error.

termidash's People

Contributors

kidd avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

examinedliving

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.