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

Accepted Answer
0 votes

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!

0 votes

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
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

2,340 views 9 12
Read article

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