Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Omit boilerplate #795

Closed
brennanyoung opened this issue Jan 22, 2019 · 2 comments
Closed

Feature Request: Omit boilerplate #795

brennanyoung opened this issue Jan 22, 2019 · 2 comments

Comments

@brennanyoung
Copy link

Very nice plugin.

I have searched the config options looking for a way to disable entirely the adding of boilerplate code (doctype, head, title, meta, body, and their closing tags)

Use case 1:

I have several snippets of markup from different sources, which I want tidied so that the syntax is consistent. This code will be concatenated at a later time into a larger piece of markup, with its own doctype, head and body, so I don't want doctype, head, body etc. around my snippets, I just want them to be tidied.

Use case 2:

I have a snippet of markup which derives from a call from outerHTML. It's been minified, and I want to pretty print it so that it may be inspected more easily by a human. I want the snippet to contain the exact same markup, only prettier. When tidy inserts additional boilerplate code, it creates more work for me, because I then have to delete those in order to achieve the actual goal of focusing-in.

AFAICT there is no such feature as omit-boilerplate (or equivalent - correct me if I am wrong). So this is a formal request for a config option which allows this.

The closest appears to be

doctype:omit
tidy-mark:no
omit-optional-tags:yes

but that will also remove optional tags from the input markup, which is not what I am looking for. There's no setting which will omit the title!

I just want tidy/pretty markup without any additional boilerplate. I hope this is possible.

@geoffmcl
Copy link
Contributor

@brennanyoung just a quick read... but have you tried show-body-only in your config?... will try to read again later...

@brennanyoung
Copy link
Author

@geoffmcl Thank you! That's exactly the behavior I wanted.
OK, then I will dial down my feature request to request that show-body-only is easier to find in the docs :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants