Skip to content

sql-bi/SyntaxHighlighterBrushDax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

SyntaxHighlighterBrushDax

Custom SyntaxHighlighter brush for DAX.

To use the DAX brush with SyntaxHighlighter WordPress plugin, add the following code to your functions.php:

/*
 * Tell WordPress to load the brush file with SyntaxHighlighter plugin
 * Replace YOUR_BRUSH_DIRECTORY_URI with the URL path that contains the brush js file
 * E.g.: get_template_directory_uri() .'/js/shbrushdax.js'
*/
function my_syntaxhighlighter_regscript() {
    wp_register_script( 'syntaxhighlighter-brush-dax', 'YOUR_BRUSH_DIRECTORY_URI/shbrushdax.js', array('syntaxhighlighter-core'), '1.0' );
}
add_action( 'init', 'my_syntaxhighlighter_regscript' );

/*
 * Define a brush shortcode
 */
function my_syntaxhighlighter_addlang( $brushes ) {
   $brushes['dax'] = 'dax';
   return $brushes;
}
add_filter( 'syntaxhighlighter_brushes', 'my_syntaxhighlighter_addlang' );

Use the brush in your posts with the following syntax:

[dax]your code here[/dax]

For more information, read this article by Alex Mills.

About

Custom SyntaxHighlighter brush for DAX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published