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?
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">"funky"</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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.