Page says to show source to see how highlighting done but highlighted section is really an image

This question is in reference to Atlassian Documentation: Use syntax highlighting in a wiki

I am trying to figure out how to insert XML code with proper highlighting.

The referenced documentation page shows an example of Python highlighting and suggests that one look at the page source to see how it is done.

Unfortunately, the Python example is actually inside an image block!

Consequently, I CANNOT see the code showing how it was done.

Where CAN I see the code?

2 answers

1 accepted

This widget could not be displayed.

When I look at page source, as suggested in the Wiki instructions, for that highlighted Python code, I see

<p>Here's an example of some Python code:</p>
 <div class="codehilite"><pre><span></span><span class="k">def</span> <span class="nf">wiki_rocks</span><span class="p">(</span><span class="n">text</span><span class="p">):</span>
 <span class="n">formatter</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">t</span><span class="p">:</span> <span class="s2">&quot;funky&quot;</span><span class="o">+</span><span class="n">t</span>
 

<span class="k">


This is not helpful.  What the instructions should say is to look at the Wiki in Edit Mode.  In which case, you see

Here's an example of some Python code:

```
#!python

def wiki_rocks(text):
formatter = lambda t: "funky"+t
return formatter(text)
```

Which is EXTREMELY easy to implement (with the right Help instructions).

I have used the example shown in Edit Mode to properly insert XML code example into the Wiki.

I see what you're saying. I'll update that to make it clearer. Thanks!

This widget could not be displayed.

The screenshot with that example actually comes from the default page that you get when you add a Wiki to your repository. That Wiki page was originally called Home. If you already deleted the page, you can create a test repo and add the Wiki to see the default page again.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 10, 2018 in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

269 views 14 2
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you