The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

bcrow
July 21, 2016

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
bcrow
July 22, 2016

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.

Caitlin Cecic
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2016

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

0 votes
Caitlin Cecic
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2016

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.

TAGS
AUG Leaders

Atlassian Community Events