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

optional indentChar implementation #1231

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@zsitro

zsitro commented Oct 7, 2013

Select your most beloved indent char to be used in pretty output.
Indentation defaults to two spaces.

If you want to indent your code with a tab just add

app.locals.pretty = true;
app.locals.indentChar = "\t";
@ForbesLindesay

This comment has been minimized.

Show comment
Hide comment
@ForbesLindesay

ForbesLindesay Oct 7, 2013

Member

Pretty printing is going to be removed from jade at some point, to be replaced by a generic HTML prettifier. In the mean time I am not going to be adding any complexity to jade's html pretty printing.

Member

ForbesLindesay commented Oct 7, 2013

Pretty printing is going to be removed from jade at some point, to be replaced by a generic HTML prettifier. In the mean time I am not going to be adding any complexity to jade's html pretty printing.

@zsitro

This comment has been minimized.

Show comment
Hide comment
@zsitro

zsitro commented Oct 7, 2013

:)

@StreetStrider

This comment has been minimized.

Show comment
Hide comment
@StreetStrider

StreetStrider Jan 18, 2014

So where is prettifyer?

StreetStrider commented Jan 18, 2014

So where is prettifyer?

@ForbesLindesay

This comment has been minimized.

Show comment
Hide comment
@ForbesLindesay

ForbesLindesay Jan 18, 2014

Member

I still haven't got as far as writing it, it's a fair bit of work and I don't need it so it's low priority for me. If you want features like this you'll need to create an HTML prettifier (an effort I will do my best to help with). What I'm not going to do is accept pull requests to add features to jade's built in prettifier which is the source of a great many bugs that cannot be fixed in any sane way.

Member

ForbesLindesay commented Jan 18, 2014

I still haven't got as far as writing it, it's a fair bit of work and I don't need it so it's low priority for me. If you want features like this you'll need to create an HTML prettifier (an effort I will do my best to help with). What I'm not going to do is accept pull requests to add features to jade's built in prettifier which is the source of a great many bugs that cannot be fixed in any sane way.

@StreetStrider

This comment has been minimized.

Show comment
Hide comment
@StreetStrider

StreetStrider Jan 19, 2014

Ok.
Sorry for offence.

StreetStrider commented Jan 19, 2014

Ok.
Sorry for offence.

@ForbesLindesay

This comment has been minimized.

Show comment
Hide comment
@ForbesLindesay

ForbesLindesay Jan 19, 2014

Member

Sorry, didn't mean to get so ratty, I was pretty tired when I wrote that. No offence taken.

Member

ForbesLindesay commented Jan 19, 2014

Sorry, didn't mean to get so ratty, I was pretty tired when I wrote that. No offence taken.

@zsitro

This comment has been minimized.

Show comment
Hide comment
@zsitro

zsitro Jan 19, 2014

My solution is to use grunt-prettify with the following parameters:

        prettify: {
            options: {
                indent: 1,
                indent_char: '  ',
                wrap_line_length: 0,
                preserve_newlines: true,
                padcomments: true,
                brace_style: 'expand',
                max_preserve_newlines: 2,
                unformatted: ['pre']
            },
            // Prettify a directory of files
            all: {
                expand: true,
                cwd: 'build/',
                ext: '.html',
                src: ['*.html'],
                dest: 'build/'
            }
        },

This is perfect for me when I do sitebuilds.

zsitro commented Jan 19, 2014

My solution is to use grunt-prettify with the following parameters:

        prettify: {
            options: {
                indent: 1,
                indent_char: '  ',
                wrap_line_length: 0,
                preserve_newlines: true,
                padcomments: true,
                brace_style: 'expand',
                max_preserve_newlines: 2,
                unformatted: ['pre']
            },
            // Prettify a directory of files
            all: {
                expand: true,
                cwd: 'build/',
                ext: '.html',
                src: ['*.html'],
                dest: 'build/'
            }
        },

This is perfect for me when I do sitebuilds.

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