Skip to content

Conversation

@mojavelinux
Copy link
Contributor

This PR only sets up the UI. Once this is merged, the docs build will also need to upgrade to Asciidoctor Tabs 1.0.0-beta.2 in order to full enable this behavior.

@mojavelinux mojavelinux force-pushed the persist-tab-selections branch from 0cf3e22 to 03212fa Compare February 1, 2023 01:09
@rwinch rwinch merged commit 418d9ba into spring-io:main Feb 7, 2023
@rwinch
Copy link
Collaborator

rwinch commented Feb 7, 2023

@mojavelinux Thanks for the PR! I went ahead and merged, but I'm wondering if you have any advice how to get gulp preview to show the asciidoctor tabs?

@mojavelinux mojavelinux deleted the persist-tab-selections branch February 7, 2023 07:52
@mojavelinux
Copy link
Contributor Author

That should already be the case. It is controlled here:

https://github.com/spring-io/antora-ui-spring/blob/main/preview-src/ui-model.yml#L4-L6

@mojavelinux
Copy link
Contributor Author

Make sure you run npm ci first as you need to have the dependency installed in the UI project.

@rwinch
Copy link
Collaborator

rwinch commented Feb 8, 2023

@mojavelinux Thank you for the pointers. That does not seem to work.

It appears that the asciidoctor tabs are installed:

$ pwd
/home/rwinch/code/spring-io/antora-ui-spring
$ tree node_modules/@asciidoctor/tabs
node_modules/@asciidoctor/tabs
├── dist
│   ├── css
│   │   └── tabs.css
│   ├── index.js
│   └── js
│       └── tabs.js
├── lib
│   ├── extensions.js
│   └── index.js
├── package.json
└── README.md

The paths that are being searched do not appear to include the path that the tabs are installed on. The following log statement:

    console.log(JSON.stringify(require.main.paths))

outputs

["/home/rwinch/.nvm/versions/node/v18.13.0/lib/node_modules/gulp-cli/bin/node_modules","/home/rwinch/.nvm/versions/node/v18.13.0/lib/node_modules/gulp-cli/node_modules","/home/rwinch/.nvm/versions/node/v18.13.0/lib/node_modules","/home/rwinch/.nvm/versions/node/v18.13.0/node_modules","/home/rwinch/.nvm/versions/node/node_modules","/home/rwinch/.nvm/versions/node_modules","/home/rwinch/.nvm/node_modules","/home/rwinch/node_modules","/home/node_modules","/node_modules"]

If I change

extension = require.cache[require.resolve(requireRequest, { paths: require.main.paths })]

to no longer include any options (the paths)

extension = require.cache[require.resolve(requireRequest)]

then asciidoctor tabs are used properly for me.

@mojavelinux
Copy link
Contributor Author

I see the issue. The problem is that you have gulp-cli installed globally. That is no longer required. What I would recommend is creating a fresh nvm install of Node.js 18, then only use npx gulp preview to run the preview.

It's very possible that the code as written does not support a globally-installed Gulp CLI. If you still want to make the change, I would just be careful to verify that it works with and without a fresh Node.js installation so you are sure it won't break what is already working.

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

Successfully merging this pull request may close these issues.

2 participants