Giter Site home page Giter Site logo

tldr-planck's Introduction

tldr-planck

A TLDR pages client written in Planck (Stand-alone ClojureScript REPL)

tldr screenshot

Getting Started

Prerequisites

Planck, a stand-alone ClojureScript REPL for macOS and Linux based on JavaScriptCore.

On macOS:

brew install planck

Installation

Copy this command tldr.cljs to a directory in your path. (~/bin, /usr/local/bin or somewhere)

chmod 755 tldr.cljs
cp tldr.cljs /usr/local/bin
tldr.cljs

Usage

usage: tldr.cljs [OPTION]... PAGE

available commands:
  -h, --help                 print this help and exit
  -C, --color                force color display
  -p, --platform PLATFORM    select platform, supported are linux / osx / sunos / windows / common
  -r, --render PATH          render a local page for testing purposes
  -u, --update               update local database
  -v, --version              print version and exit
  -c, --clear-cache          clear local database
  -V, --verbose              display verbose output
  -l, --list                 list all entries in the local database
      --random               show a random command

Examples:

tldr.cljs tar
tldr.cljs du --platform=osx
tldr.cljs --list
tldr.cljs --random

To display pages in the specified language (such as ja, pt_BR, or fr):

LANG=ja tldr.cljs less
LANG=fr tldr.cljs --random -p osx

To control the cache:

tldr.cljs --update
tldr.cljs --clear-cache

To render a local file (for testing):

tldr.cljs --render /path/to/file.md

Use REPL

Start Planck REPL in a terminal window.

plk

Load tldr.cljs and change ns to tldr.core.

cljs.user=> (load-file "tldr.cljs")
nil
cljs.user=> (ns tldr.core)
nil
tldr.core=>

Call display function as follows:

;; display page from the osx platform at random
tldr.core=> (display (rand-page "osx"))

;; display specified page (requires .md extension for the page name)
tldr.core=> (display "linux" "tar.md")

;; to change the display language (this may occur warning message)
tldr.core=> (binding [lang-priority-list ["ja" "en"]] (display "linux" "tar.md"))

NOTE: Don't call -main. Otherwise, REPL will terminate.

Configuration

If the local database is older than two weeks, attempting to update it. To prevent automatic updates, set the environment variable TLDR_AUTO_UPDATE_DISABLED

TLDR_AUTO_UPDATE_DISABLED=1 tldr.cljs tar

Referenced projects

License

Copyright (c) 2024 hisaitami

Distributed under the terms of the MIT License

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.