Friday, 15 May 2015

ruby - Pretty print html output from Jekyll -



ruby - Pretty print html output from Jekyll -

is there way pretty print html output jekyll?

for example, below snippet of html jekyll generates. notice how <p> tags have no indentation , have unnecessary line breaks after them.

... <div id="content"> <p class="flush">post 1</p> <p class="flush">post 2</p> <p class="flush">post 3</p> </div> ...

i'm imagining alternative or plugin pretty print instead:

... <div id="content"> <p class="flush">post 1</p> <p class="flush">post 2</p> <p class="flush">post 3</p> </div> ...

i suggest take 1 of tidy-makers , write own :tidy task in end of jekyll-specific task chain. or, easier:

desc "tidy jekyll output" task :tidy `find _site -name "*.html" -exec tidy {} \;` end

please note, neither newly created task nor plugin may found on net not applied on github pages, since have restricted policies run jekyll.

ruby jekyll pretty-print

No comments:

Post a Comment