Closed erauner12 closed 4 weeks ago
Interesting:
https://<redacted>/pages/viewpage.action?pageId=223753291#arbitrary-order-change
vs:
https://<redacted>/display/PROVNG/express_deployment_scenarios#express_deployment_scenarios-arbitrary-order-change
It seems when I change it to advanced, this is what changes if you copy the link address
edit: nevermind I was wrong on that.
Makes me wonder what actually changes when I changed that advanced link? I'm not sure how to look.
As nice as as github links are I think just regular old table of contents macro would do the trick too. hmm might try this
From what I saw in Confluence Storage Format (CSF), simple links are HTML anchor elements (<a href="...">
), whereas advanced links are so-called structured-macro
instances. md2conf already uses the structured-macro
variant for generating anchor targets for headings. This is enabled with the command-line option --heading-anchors
. This allows us to assign lowercase anchor names to headings (as in GitHub) as opposed to mixed-case anchor names (as in Confluence). Specifically, this has helped users with their Markdown table of contents. Perhaps you are missing --heading-anchors
too?
Well actually I was using the --heading-anchors
so it ws not making since to me why it was not properly re-directing when I clicked it?
if grep -q "confluence-page-id:" "$file"; then
echo "Updating existing page: $file"
$PYTHON_PATH -m md2conf "$file" \
--heading-anchors \
-s "${CONFLUENCE_SPACE_KEY}" \
-d "${CONFLUENCE_DOMAIN}" \
-p "${CONFLUENCE_PATH}" \
-a "${CONFLUENCE_API_KEY}" \
--generated-by "This page was automatically generated" \
--ignore-invalid-url \
--render-mermaid \
--loglevel debug
Local references within a Markdown document (i.e. URLs that consist of a fragment part only) are now expanded into Confluence advanced links:
<ac:link ac:anchor="anchor">
<ac:link-body>
...
</ac:link-body>
</ac:link>
This is activated with --heading-anchors
. Links must use standard Markdown conversion rules to reference section headings (all lowercase).
Changes have been pushed to master
with the commit text Expand references within document to Confluence advanced links.
When converting Markdown documents with local anchor links to Confluence pages using md2conf, the generated links are not functioning as expected. The links are being created as web links instead of Confluence's advanced links, causing navigation issues within the page I think?
Steps to reproduce:
[Section Title](#section-title)
).Expected behavior: Clicking on a local anchor link in the table of contents should navigate to the corresponding section within the same Confluence page.
Actual behavior: Clicking on a local anchor link either refreshes the page or does not navigate to the intended section. The links are being created as "web links" instead of Confluence's advanced links
ex:
Workaround: After publishing the page to Confluence, manually editing each link and changing it to an "Advanced" link in the Confluence editor fixes the issue. This suggests that the problem lies in how md2conf is generating the links.
arbitrary-order-change