Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion confluence-mdx/bin/confluence_xhtml_to_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,12 +861,42 @@ def convert_recursively(self, node):
lowercased_fragment = ''

href = '#'
ri_page = None
ri_space = None
for child in node.children:
if isinstance(child, Tag) and child.name == 'ac:link-body':
link_body = SingleLineParser(child).as_markdown
if isinstance(child, Tag) and child.name == 'ri:space':
# Handle space links: <ac:link><ri:space ri:space-key="QCP" /></ac:link>
ri_space = child
space_key = child.get('space-key', '')
if space_key:
href = f'https://querypie.atlassian.net/wiki/spaces/{space_key}/overview'
logging.info(f"Generated Confluence space overview link for space '{space_key}': {href}")
else:
href = '#link-error'
logging.warning(f"No space key found in ri:space tag, using error anchor: {href}")
if isinstance(child, Tag) and child.name == 'ri:page':
ri_page = child
target_title = child.get('content-title', '')
href = relative_path_to_titled_page(target_title)
space_key = child.get('space-key', '')

# Check if the target page is in pages.yaml
target_page = PAGES_BY_TITLE.get(target_title)

if target_page:
# Internal link - use relative path
href = relative_path_to_titled_page(target_title)
else:
# External link - generate Confluence URL
if space_key:
# Use space overview URL since we don't have page_id
href = f'https://querypie.atlassian.net/wiki/spaces/{space_key}/overview'
logging.info(f"Generated external Confluence space link for title '{target_title}' in space '{space_key}': {href}")
else:
# No space key - show simple error message
href = '#link-error'
logging.warning(f"No space key found for external link to '{target_title}', using error anchor: {href}")

self.markdown_lines.append(f'[{link_body}{decoded_anchor}]({href}{lowercased_fragment})')
elif node.name in ['ri:page']:
Expand Down
63 changes: 63 additions & 0 deletions confluence-mdx/tests/testcases/1844969501/ancestors.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"results":
- "id": "576585864"
"type": "page"
"ari": "ari:cloud:confluence:530d00f8-a0ee-42cf-8109-ec274eb5f47b:page/576585864"
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6NTMwZDAwZjgtYTBlZS00MmNmLTgxMDktZWMyNzRlYjVmNDdiOmNvbnRlbnQvNTc2NTg1ODY0"
"status": "current"
"title": "QueryPie v10 Manual"
"macroRenderedOutput": {}
"extensions":
"position": !!int "14426974"
"_expandable":
"container": "/rest/api/space/QM"
"metadata": ""
"restrictions": "/rest/api/content/576585864/restriction/byOperation"
"history": "/rest/api/content/576585864/history"
"body": ""
"version": ""
"descendants": "/rest/api/content/576585864/descendant"
"space": "/rest/api/space/QM"
"childTypes": ""
"schedulePublishInfo": ""
"operations": ""
"schedulePublishDate": ""
"children": "/rest/api/content/576585864/child"
"ancestors": ""
"draftVersion": ""
"_links":
"self": "https://querypie.atlassian.net/wiki/rest/api/content/576585864"
"tinyui": "/x/iABeIg"
"editui": "/pages/resumedraft.action?draftId=576585864"
"webui": "/spaces/QM/overview"
"edituiv2": "/spaces/QM/pages/edit-v2/576585864"
- "id": "608501837"
"type": "page"
"ari": "ari:cloud:confluence:530d00f8-a0ee-42cf-8109-ec274eb5f47b:page/608501837"
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6NTMwZDAwZjgtYTBlZS00MmNmLTgxMDktZWMyNzRlYjVmNDdiOmNvbnRlbnQvNjA4NTAxODM3"
"status": "current"
"title": "QueryPie Docs"
"macroRenderedOutput": {}
"extensions":
"position": !!int "9"
"_expandable":
"container": "/rest/api/space/QM"
"metadata": ""
"restrictions": "/rest/api/content/608501837/restriction/byOperation"
"history": "/rest/api/content/608501837/history"
"body": ""
"version": ""
"descendants": "/rest/api/content/608501837/descendant"
"space": "/rest/api/space/QM"
"childTypes": ""
"schedulePublishInfo": ""
"operations": ""
"schedulePublishDate": ""
"children": "/rest/api/content/608501837/child"
"ancestors": ""
"draftVersion": ""
"_links":
"self": "https://querypie.atlassian.net/wiki/rest/api/content/608501837"
"tinyui": "/x/TQBFJ"
"editui": "/pages/resumedraft.action?draftId=608501837"
"webui": "/spaces/QM/pages/608501837/QueryPie+Docs"
"edituiv2": "/spaces/QM/pages/edit-v2/608501837"
43 changes: 43 additions & 0 deletions confluence-mdx/tests/testcases/1844969501/attachments.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"results":
- "id": "att1847558157"
"type": "attachment"
"ari": "ari:cloud:confluence:530d00f8-a0ee-42cf-8109-ec274eb5f47b:attachment/1847558157"
"base64EncodedAri": "YXJpOmNsb3VkOmNvbmZsdWVuY2U6NTMwZDAwZjgtYTBlZS00MmNmLTgxMDktZWMyNzRlYjVmNDdiOmF0dGFjaG1lbnQvMTg0NzU1ODE1Nw=="
"status": "current"
"title": "image-20240801-023748.png"
"macroRenderedOutput": {}
"metadata":
"mediaType": "image/png"
"extensions":
"mediaType": "image/png"
"fileSize": !!int "234445"
"comment": ""
"mediaTypeDescription": "PNG Image"
"fileId": "87fa2007-bb7d-468e-a598-fd42236649ff"
"collectionName": "contentId-1844969501"
"_expandable":
"container": "/rest/api/content/1844969501"
"restrictions": "/rest/api/content/att1847558157/restriction/byOperation"
"history": "/rest/api/content/att1847558157/history"
"body": ""
"version": ""
"descendants": "/rest/api/content/att1847558157/descendant"
"space": "/rest/api/space/QM"
"childTypes": ""
"schedulePublishInfo": ""
"operations": ""
"schedulePublishDate": ""
"children": "/rest/api/content/att1847558157/child"
"ancestors": ""
"draftVersion": ""
"_links":
"webui": "/pages/viewpageattachments.action?pageId=1844969501&preview=%2F1844969501%2F1847558157%2Fimage-20240801-023748.png"
"self": "https://querypie.atlassian.net/wiki/rest/api/content/att1847558157"
"download": "/download/attachments/1844969501/image-20240801-023748.png?version=1&modificationDate=1768914457813&cacheVersion=1&api=v2"
"start": !!int "0"
"limit": !!int "50"
"size": !!int "1"
"_links":
"base": "https://querypie.atlassian.net/wiki"
"context": "/wiki"
"self": "https://querypie.atlassian.net/wiki/rest/api/content/1844969501/child/attachment"
8 changes: 8 additions & 0 deletions confluence-mdx/tests/testcases/1844969501/children.v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"results":
- "id": "1853358081"
"status": "current"
"title": "프리미엄 지원"
"spaceId": "539099246"
"childPosition": !!int "402"
"_links":
"base": "https://querypie.atlassian.net/wiki"
45 changes: 45 additions & 0 deletions confluence-mdx/tests/testcases/1844969501/expected.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: '지원'
---

# 지원

### 공통 리소스

모든 QueryPie 고객이 이용할 수 있는 자료입니다.

#### Documentation

이 웹사이트, [docs.querypie.com](http://docs.querypie.com) 에서 다음 자료를 확인할 수 있습니다:

* 이용자 매뉴얼
* 관리자 매뉴얼
* API Reference
* 릴리스 노트

기술지원을 위한 [Confluence Space](https://querypie.atlassian.net/wiki/spaces/QCP/overview) 에서 상세한 기술지원 자료를 확인할 수 있습니다.

* [QueryPie Architecture](https://querypie.atlassian.net/wiki/spaces/QCP/overview)
* [Advanced Environment Setup](https://querypie.atlassian.net/wiki/spaces/QCP/overview)
* [Advanced Integration Guide](https://querypie.atlassian.net/wiki/spaces/QCP/overview)
* [릴리스 버전 별 문서](https://querypie.atlassian.net/wiki/spaces/QCP/overview)
* [Troubleshooting](https://querypie.atlassian.net/wiki/spaces/QCP/overview)

#### Product Demo - YouTube

[Product Demo - YouTube](https://www.youtube.com/playlist?list=PLB6l6itD4YrpMXRtprvUdR3hIHVbT8IhZ) 채널에서 QueryPie ACP 제품의 여러 기능을 영상으로 살펴볼 수 있습니다.

* DAC: 데이터베이스 접근 제어 기능 튜토리얼
* SAC: 서버 접근 제어 기능 튜토리얼
* KAC: Kubernetes 접근 제어 기능 튜토리얼
* General: SSO 통합, 감사 로그, BI 도구 연동 (Tableau, Redash)

### 커뮤니티 지원

대상: Community Edition, Standard Edition 을 이용하는 고객

#### GitHub Discussion

설치 및 사용 중 궁금한 점을 [GitHub Discussion](https://github.com/querypie/querypie-community/discussions) 에서 문의하거나, 다른 사용자들과 경험을 공유할 수 있습니다.


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions confluence-mdx/tests/testcases/1844969501/page.adf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"doc","content":[{"type":"extension","attrs":{"layout":"default","extensionType":"com.atlassian.confluence.macro.core","extensionKey":"toc","parameters":{"macroParams":{"style":{"value":"none"}},"macroMetadata":{"macroId":{"value":"7bdc2ece-abbc-4741-a900-a08feb04a9a2"},"schemaVersion":{"value":"1"},"title":"목차"}},"localId":"e73631cc-f0eb-448b-9354-c7ec94a27e77"}},{"type":"heading","attrs":{"level":2,"localId":"da628dd2-12f3-4651-ab59-c77494309797"},"content":[{"text":"공통 리소스","type":"text"}]},{"type":"paragraph","attrs":{"localId":"7aeaf0a8-a18a-4de2-9abf-78d440337552"},"content":[{"text":"모든 QueryPie 고객이 이용할 수 있는 자료입니다.","type":"text"}]},{"type":"heading","attrs":{"level":3,"localId":"edf077b3-5199-49e6-8392-6fd115decf62"},"content":[{"text":"Documentation","type":"text"}]},{"type":"paragraph","attrs":{"localId":"1405d1f5-07b4-4058-a676-97f9b3a66479"},"content":[{"text":"이 웹사이트, ","type":"text"},{"text":"docs.querypie.com","type":"text","marks":[{"type":"link","attrs":{"href":"http://docs.querypie.com"}}]},{"text":" 에서 다음 자료를 확인할 수 있습니다:","type":"text"}]},{"type":"bulletList","attrs":{"localId":"9ef82e17-4026-4cbe-9696-e3226a7357b1"},"content":[{"type":"listItem","attrs":{"localId":"a4dae406-dcd8-40dc-95ec-424085d2a50c"},"content":[{"type":"paragraph","attrs":{"localId":"07de2fcc-6c47-4e84-a213-bc5e28bea2b8"},"content":[{"text":"이용자 매뉴얼","type":"text"}]}]},{"type":"listItem","attrs":{"localId":"56c6e2fe-e0df-4f66-986e-684355eb9dbd"},"content":[{"type":"paragraph","attrs":{"localId":"27a26caa-20d9-47ff-85d8-97deba0d7593"},"content":[{"text":"관리자 매뉴얼","type":"text"}]}]},{"type":"listItem","attrs":{"localId":"f877543f-6756-4036-9150-4c61e8fe1a7d"},"content":[{"type":"paragraph","attrs":{"localId":"bea6b957-601b-44fe-baa8-a8e4aaa3b2c0"},"content":[{"text":"API Reference","type":"text"}]}]},{"type":"listItem","attrs":{"localId":"8b26ca51-0984-47fa-ada6-8b6467c18b9e"},"content":[{"type":"paragraph","attrs":{"localId":"fbe95a8b-88ee-4f0d-97ca-4f4bb4de47e9"},"content":[{"text":"릴리스 노트","type":"text"}]}]}]},{"type":"paragraph","attrs":{"localId":"711c3c85-02f2-422b-b768-5296b59156b5"},"content":[{"text":"기술지원을 위한 ","type":"text"},{"text":"Confluence Space","type":"text","marks":[{"type":"link","attrs":{"href":"https://querypie.atlassian.net/wiki/spaces/QCP"}}]},{"text":" 에서 상세한 기술지원 자료를 확인할 수 있습니다.","type":"text"}]},{"type":"bulletList","attrs":{"localId":"1dc6fa88-2805-4e4e-a0de-3bb29c246c62"},"content":[{"type":"listItem","attrs":{"localId":"30c1a3a7-8ebb-4c88-ae8d-31b94e59a68b"},"content":[{"type":"paragraph","attrs":{"localId":"dec58e05-5910-4e21-985b-560b5f70e229"},"content":[{"text":"QueryPie Architecture","type":"text","marks":[{"type":"link","attrs":{"href":"https://querypie.atlassian.net/wiki/spaces/QCP/pages/400064797"}}]}]}]},{"type":"listItem","attrs":{"localId":"9f7893d4-abad-4a93-b9bf-14e5cedbd44c"},"content":[{"type":"paragraph","attrs":{"localId":"37c3db5a-5873-466c-808a-68a83e62f57a"},"content":[{"text":"Advanced Environment Setup","type":"text","marks":[{"type":"link","attrs":{"href":"https://querypie.atlassian.net/wiki/spaces/QCP/pages/887947577"}}]}]}]},{"type":"listItem","attrs":{"localId":"6b8334f2-b334-487b-9539-f19ae402bf96"},"content":[{"type":"paragraph","attrs":{"localId":"9e849d92-d344-4ec4-9478-f0bb3c64867e"},"content":[{"text":"Advanced Integration Guide","type":"text","marks":[{"type":"link","attrs":{"href":"https://querypie.atlassian.net/wiki/spaces/QCP/pages/841449834"}}]}]}]},{"type":"listItem","attrs":{"localId":"92aa4792-7e4f-4522-8fba-a66e26afbc58"},"content":[{"type":"paragraph","attrs":{"localId":"994e1893-08ee-4242-ba5b-0b803ef22dac"},"content":[{"type":"inlineCard","attrs":{"localId":"2c6f6eb0-6fc2-4900-aa7f-6ecc3fd87d57","url":"https://querypie.atlassian.net/wiki/spaces/QCP/pages/841351486"}}]}]},{"type":"listItem","attrs":{"localId":"4cb99bfb-1f32-4ed2-a2d0-a7c61ae9fc17"},"content":[{"type":"paragraph","attrs":{"localId":"683eb18e-d18b-418e-83cf-3fe165846630"},"content":[{"text":"Troubleshooting","type":"text","marks":[{"type":"link","attrs":{"href":"https://querypie.atlassian.net/wiki/spaces/QCP/pages/920486841"}}]}]}]}]},{"type":"heading","attrs":{"level":3,"localId":"44974faa-fab5-416c-87d5-664d7219f126"},"content":[{"text":"Product Demo - YouTube","type":"text"}]},{"type":"paragraph","attrs":{"localId":"ff1d3c6f-ff30-4a5e-85c3-b78ee962bf03"},"content":[{"text":"Product Demo - YouTube","type":"text","marks":[{"type":"link","attrs":{"href":"https://www.youtube.com/playlist?list=PLB6l6itD4YrpMXRtprvUdR3hIHVbT8IhZ"}}]},{"text":" 채널에서 QueryPie ACP 제품의 여러 기능을 영상으로 살펴볼 수 있습니다.","type":"text"}]},{"type":"bulletList","attrs":{"localId":"44e8c253-aceb-45f0-bd97-f18771246887"},"content":[{"type":"listItem","attrs":{"localId":"6cc45ec1-65d8-4bd3-ace9-0924e0b5fc9c"},"content":[{"type":"paragraph","attrs":{"localId":"2d3aeeb4-6426-40cf-992c-17f8b59bafe8"},"content":[{"text":"DAC: 데이터베이스 접근 제어 기능 튜토리얼","type":"text"}]}]},{"type":"listItem","attrs":{"localId":"6cc45ec1-65d8-4bd3-ace9-0924e0b5fc9c"},"content":[{"type":"paragraph","attrs":{"localId":"2d3aeeb4-6426-40cf-992c-17f8b59bafe8"},"content":[{"text":"SAC: 서버 접근 제어 기능 튜토리얼","type":"text"}]}]},{"type":"listItem","attrs":{"localId":"de0dde4b-8ae2-4b41-b6ce-557f972db058"},"content":[{"type":"paragraph","attrs":{"localId":"52268ffc-bc5a-47f0-b1f0-3cd5ae6aa123"},"content":[{"text":"KAC: Kubernetes 접근 제어 기능 튜토리얼","type":"text"}]}]},{"type":"listItem","attrs":{"localId":"ae112e65-e714-4dbf-b7a4-6013a99e2311"},"content":[{"type":"paragraph","attrs":{"localId":"27e21136-ba15-465f-b039-26163ddaa103"},"content":[{"text":"General: SSO 통합, 감사 로그, BI 도구 연동 (Tableau, Redash)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2,"localId":"4561f9b5-2678-4159-8991-7ffbff223048"},"content":[{"text":"커뮤니티 지원","type":"text"}]},{"type":"paragraph","attrs":{"localId":"6fe65f82-af0d-4894-b0ac-5508285bc762"},"content":[{"text":"대상: Community Edition, Standard Edition 을 이용하는 고객","type":"text"}]},{"type":"heading","attrs":{"level":3,"localId":"68d99482-0c37-450d-892e-2143a15addba"},"content":[{"text":"GitHub Discussion","type":"text"}]},{"type":"paragraph","attrs":{"localId":"328c698b-d652-484a-9a2b-21addf7e26fc"},"content":[{"text":"설치 및 사용 중 궁금한 점을 ","type":"text"},{"text":"GitHub Discussion","type":"text","marks":[{"type":"link","attrs":{"href":"https://github.com/querypie/querypie-community/discussions"}}]},{"text":" 에서 문의하거나, 다른 사용자들과 경험을 공유할 수 있습니다.","type":"text"}]},{"type":"paragraph","attrs":{"localId":"bd55c917-a378-4083-8710-9e8b75b3a7b3"}}],"version":1}
Loading