Badge Examples

Automatic

Badges are added to code blocks according to the highlighting class.


                    {
                      languages : true
                    }
                
echo "Hello World!";
puts 'Hello, world!'

Reconfigure


                    languages: {
                      php: {
                        label: 'PHP 7',
                        fg: 'white',
                        bg: 'black',
                        position: 'tr'
                      },
                      plainttext: false
                    }
                

Manual

                    echo "Hello World!";

data-badge* attributes take priority

  • data-badge - text
  • data-badge-fg - text color
  • data-badge-bg - background color
  • data-badge-position - tl, tr, bl, br
  • data-badge-class - additional css classes

You can add them to any block...


... at different corners ...


... with individual css classes