Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping does not work possibly by misunderstanding #42

Open
f4m8 opened this issue Aug 3, 2024 · 2 comments
Open

Mapping does not work possibly by misunderstanding #42

f4m8 opened this issue Aug 3, 2024 · 2 comments

Comments

@f4m8
Copy link

f4m8 commented Aug 3, 2024

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 f4m8 changed the title Mapping does not work possibly by misunderstandnig Mapping does not work possibly by misunderstanding Aug 3, 2024
@PacoVK
Copy link
Owner

PacoVK commented Aug 4, 2024

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?

@f4m8
Copy link
Author

f4m8 commented Aug 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants