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

Python/jinja template rendering and Confluence API

Nahi September 28, 2023

I'm working with the Confluence API using Python. Here's my workflow:

  1. Fetch the content of a page using get_page_by_id().
  2. Transform the content.
  3. Present the transformed content to the user via a web app using Jinja for them to approve or disapprove.

I'd like the content displayed in the web app to match the style it will have when uploaded back to Confluence. The challenge I'm facing is in rendering the content in the HTML template to ensure it looks consistent with the Confluence style.

When the user approves the content, I will be uploading it back to Confluence using the Python API. It's important that what the user views in the web app mostly matches what they will see in their Confluence space.

How can I render the transformed content in my web app to match the Confluence style, ensuring consistency between the preview and the uploaded content?

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 2, 2023

Welcome to the Atlassian Community!

Your python code will need to replicate all the stuff Confluence does to render its pages - this is quite a lot of coding for you to do.

I would question the desire to do this as well.  Why are your users not approving the pages in Confluence directly?  What's the point in using yet another application to doit? Why are you not just using something like Comala workflows?

Nahi December 14, 2023

thanks for replying!

We're creating a page programmatically, we then want to present this to the user and ask if they approve or reject of the created page.

We want the user to have an accurate representation of how the page will actually look in confluence.

Any ideas will help

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events