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

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:


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 vote

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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

710 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot