Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I add a custom theme to the code block macro?

I'm trying to extend the Code Block macro in Confluence to support a few new languages typically used on the mainframe (e.g., s/390 Assembler).  I have successfully added the new language following the instructions in Confluence and SyntaxHighlighter.  However, none of the existing color schemes are compatible with how I want the highlighting to look.  I see that SyntaxHighlighter also provides for developing custom color schemes.  How do I extend the available color scheme choices for Code Block sections in Confluence?

2 answers

1 vote

Hello Jim,

Welcome to Atlassian Community. It's nice to meet you!

It's not possible to customize the theme of the code block macro, but I've raised a feature request below for this:

In the meantime, you'll be able to use Marketplace add-ons to customize the theme of your code blocks:

Let me know if you have any questions about that.

Regards,

Shannon

Thanks for the reply.  Unfortunately, none of the plugins in the marketplace do what I need.  They don't support the languages I need.  

Hi Jim,

Thank you for letting me know. One of the add-ons for Cloud supports Assembly languages but not the ones for Server.

The custom brush syntax that you use has to adhere to Custom Brush Syntax, but it looks like you can include colors that way. Have you already tried calling the colors you need with CSS and that doesn't work?

Regards,

Shannon

Yes, after adding the custom brushes I've been playing around with the colors and available themes.  My goal is to make the code look like it does in the native z/OS terminal window since the code snippets we are documenting will be viewed by this set of developers.  None of the color choices get it right 100%.  

The SyntaxHighlighter on which the Code Block macro is based supports adding custom themes as well as custom brushes.  My suggestion (and what I believe you are saying in the ticket you opened) is to also expose this interface to anyone wishing to customize the macro.  I've added myself to the watch list for any future updates.  In the mean time I'm exploring writing my own macro for this purpose.

Thanks,

Jim

Hi Jim,

Yes, I'm sorry, I did mean via the UI, so I've updated the feature request to state this.

Good luck on working using the brush syntax. If you end up with anything you'd like to share, please feel free to share it here!

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

402 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you