WordPress.org

Ready to get started?Download WordPress

Forums

Better WordPress Syntax Highlighter
[resolved] PowerShell syntax highlighting (6 posts)

  1. Captain.Nemo
    Member
    Posted 2 years ago #

    Hi

    How can I configure BWP Syntax to support PowerShell syntaxes?

    Thanks
    Norbert

    http://wordpress.org/extend/plugins/better-wordpress-syntax-based-on-geshi/

  2. Khang Minh
    Member
    Plugin Author

    Posted 2 years ago #

    Hi again Captain :),

    To add more languages, you can try this: http://betterwp.net/wordpress-plugins/bwp-syntax/#customization.

    This will be your filter:

    add_filter('bwp_syntax_languages', 'bwp_add_custom_langs');
    
    function bwp_add_custom_langs()
    {
    	$custom_lang = array(
    		'ps' => 'powershell'
    	);
    	return $custom_lang;
    }

    You will have to generate CSS too if you are using Language-based styling.

    Hope that helps!

  3. Captain.Nemo
    Member
    Posted 2 years ago #

    Hi OddOneOut

    Thanks again for the feedback :) Will give it a try. Do you plan to add it in an upcoming version, like wp-syntax has? ;)

    Cheers
    Norbert

  4. Khang Minh
    Member
    Plugin Author

    Posted 2 years ago #

    PowerShell as an official language? Consider it done ;).

  5. David Pi
    Member
    Posted 2 years ago #

    Hi. How should I write the filter if I need to add two languages? For example, nsis and ini. Please help me.

    Thanks!

  6. David Pi
    Member
    Posted 2 years ago #

    I have found out.

    add_filter('bwp_syntax_languages', 'bwp_add_custom_langs');
    
    function bwp_add_custom_langs()
    {
    	$custom_lang = array(
    		'nsis' => 'nsis',
    		'ini' => 'ini',
    		'reg' => 'reg',
    	);
    	return $custom_lang;
    }

    Love this beautiful plugin!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic