Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,219
Community Members
 
Community Events
176
Community Groups

insert info/tip/note/warning via Markdown

Edited

Hi,

 

I want to add any of the above panels when pasting markdown to editor, is this possible?

e.g. I want to change this note to be a confluence panel note:

```

### I'm a Markdown file

Some more markdown text...

> NOTE: Hello, I'm a nice note :)

```

What should I paste to achieve this?

 

ref: https://support.atlassian.com/confluence-cloud/docs/insert-the-info-tip-note-and-warning-macros/#Wiki-markup-example

2 answers

1 accepted

0 votes
Answer accepted

It turns out that it's possible in the following implementation:

1. Script must look for some defined custom structure inside our markdown file, e.g.

!!! tip useful-tip
block of text that is in the tip macro

2. We change this to macro body written in html, e.g. (haven't tested)

<ac:structured-macro ac:name="tip">
<ac:parameter ac:name="title">useful tip</ac:parameter>
<ac:parameter ac:name="body">block of text that is in the tip macro</ac:parameter>
</ac:structured-macro>
 

And send to confluence space as a new page or update the existing one. 

 

If someone reads this, it also works (lack of documentation!!!) for fenced code blocks and other macros, just change:

``` Java
some code
```

to

<ac:structured-macro ac:name="code">

<ac:parameter ac:name="language">Java</ac:parameter>

<ac:plain-text-body><![CDATA[some code]]></ac:plain-text-body>

</ac:structured-macro>

 cheers

0 votes

Hi @Maciej Kopa 

What exactly do you want to achieve? The way you can add a panel is by either clicking on + on the header and choosing Info, or by typing / and then info.

Hi @Alex Koxaras _Relational_ 

I want to achieve what you have said, but via API, not Confluence page manually. 

You should be able to update content with this endpoint

PUT /wiki/rest/api/content/{id}

https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/#api-wiki-rest-api-content-id-put

yes, however, it wasn't the question. check my answer if interested :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Atlassian Community Events