GithubHelp home page GithubHelp logo

How to indent with tabs? about pup HOT 1 OPEN

hellishvictor avatar hellishvictor commented on August 13, 2024
How to indent with tabs?

from pup.

Comments (1)

gromgit avatar gromgit commented on August 13, 2024

Yes:

$ pup -h
Usage
    pup [flags] [selectors] [optional display function]
Version
    0.4.0
Flags
    -c --color         print result with color
    -f --file          file to read from
    -h --help          display this help
    -i --indent        number of spaces to use for indent or character
    -n --number        print number of elements selected
    -l --limit         restrict number of levels printed
    -p --plain         don't escape html
    -s --strict        ignore non-standard HTML tags
    --pre              preserve preformatted text
    --charset          specify the charset for pup to use
    --version          display version

Note the explanatory note for the -i option (which could be a bit clearer). If the argument to -i is not a number, pup assumes it's the character you want to use for indenting, so...

$ cat t.html
<div class="c1" id="id1">
 content 1
</div>
<div class="c1 c2" id="id2">
 content 2
</div>

$ pup -i 2 < t.html
<html>
  <head>
  </head>
  <body>
    <div class="c1" id="id1">
      content 1
    </div>
    <div class="c1 c2" id="id2">
      content 2
    </div>
  </body>
</html>

$ pup -i $'\t' < t.html
<html>
	<head>
	</head>
	<body>
		<div class="c1" id="id1">
			content 1
		</div>
		<div class="c1 c2" id="id2">
			content 2
		</div>
	</body>
</html>

from pup.

Related Issues (20)

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.