antora-confluence icon indicating copy to clipboard operation
antora-confluence copied to clipboard

Mapping does not work possibly by misunderstanding

Open f4m8 opened this issue 1 year ago • 2 comments

site:
  title: Antora Docs
  start_page: component-b::index.adoc
  url: https://docs.domain.tld
content:
  sources:
  - url: https://gitlab.com/antora/demo/demo-component-a.git
    branches: HEAD
  - url: https://gitlab.com/antora/demo/demo-component-b.git
    branches: [v2.0, v1.0]
    start_path: docs
ui:
  bundle:
    url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
    snapshot: true
output:
  destinations:
    - provider: fs
    - provider: antora-confluence
      confluence-api: https://<redacted>.atlassian.net
      confluence-space: AD
      show-banner: true
      ancestor-id: 98329
      mapper:
        # 
        # Stuck here: both options wont work
        # - path: component-b/2.0/index.html
        - path: component-b/2.0/index
          target: ComponentB
antora:
  extensions:
  - '@antora/pdf-extension'

I got no "ComponentB" Page as base page.

The source for Component B.

I have set LOG_LEVEL=debug and get this output: antora-playbook.yml.log

extract "No mapper found for" from logfile:

$ grep "No mapper found for" antora-playbook.yml.log
debug:    No mapper found for component-a/1.5.6/admonition.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-a/1.5.6/inline-text-formatting.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-a/1.5.6/sidebar.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-a/1.5.6/special-characters.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-a/1.5.6/ui-macros.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-a/1.5.6/lists/ordered-list.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-a/1.5.6/lists/unordered-list.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-b/1.0/index.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-b/1.0/module-one/overview.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-b/2.0/index.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-b/2.0/module-one/overview.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for component-a/1.5.6/index.html, now checking if this page is a direct sibling of a mapper...
debug:    No mapper found for index.html, now checking if this page is a direct sibling of a mapper...

What i'm mssing or misunderstand in mapping pathes to pages?

Used versions:

{
  "devDependencies": {
    "@antora/pdf-extension": "1.0.0-alpha.9",
    "antora": "3.1.9",
    "antora-confluence": "0.3.2"
  }
}
$ nodejs --version; npm --version; antora --version; lsb_release -a
v18.19.0
9.2.0
@antora/cli: 3.1.9
@antora/site-generator: 3.1.9
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm

f4m8 avatar Aug 03 '24 12:08 f4m8

Hey @f4m8 thanks for this issue. The mapper is meant to map a path below a target rather than a specific file. As of now your mapper should be:

      mapper:
        - path: component-b/2.0
          target: ComponentB

That would map any content below component-b/2.0 to the anchor page ComponentB Does it make sense? The idea was that a user wants to map certain pages to an anchor, because mapping a specific page literally would mean "just rename" the page, aka. setting a different title. What do you think?

PacoVK avatar Aug 04 '24 18:08 PacoVK

Hi @PacoVK ,

using

        - path: component-b/2.0
          target: ComponentB

works fine.

My missed info was to use a source dir as path and not a file, as the config variable name stated.

I suggest to create an example based on the Antora - Install and Run Antora Quickstart - Create a playbook. That makes it easier to work along a running example.

First: This works.

The result now was a little bit unexpected especially the component-a mapping:

2024-08-04T230426+0200

The used mapping:

      mapper:
        - path: component-b/2.0
          target: ComponentB
        - path: component-a/1.5.6
          target: ComponentA

f4m8 avatar Aug 04 '24 21:08 f4m8