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

AsciiDoc include macro isn't working #86

Open
iansk opened this issue Jun 21, 2023 · 14 comments · Fixed by #88
Open

AsciiDoc include macro isn't working #86

iansk opened this issue Jun 21, 2023 · 14 comments · Fixed by #88
Assignees

Comments

@iansk
Copy link
Collaborator

iansk commented Jun 21, 2023

AsciiDoc has a macro that lets you pull in adoc content from other files. The include:: macro isn't working on our Franklin pages. See the official documentation for include:: here.

This page shows the issue (scroll to the bottom of the page):

Link: Onboard Accounts for Agentless Scanning

Relevant underlying doc source:

include::frag_start-agentless-scan.adoc[leveloffset=1]

Screenshot:

include-macro
@iansk
Copy link
Collaborator Author

iansk commented Jun 26, 2023

Re-opening this issue. I've found other instances where the include:: macro still isn't being processed properly.

See the following links. This isn't a comprehensive list, it's just what I spot checked:

@iansk iansk reopened this Jun 26, 2023
@maxakuru
Copy link
Contributor

since the HTML format changed on the worker to make the include fragments, those docs were broken until republish

just republished all, seems to be working now

@iansk iansk reopened this Aug 7, 2023
@iansk
Copy link
Collaborator Author

iansk commented Aug 7, 2023

@maxakuru This still isn't completely working. This page still has the issue:

@iansk
Copy link
Collaborator Author

iansk commented Aug 7, 2023

@maxakuru Also, quick question: What's the best way to force a republish on all content?

@maxakuru
Copy link
Contributor

maxakuru commented Aug 7, 2023

@iansk I republished all, seems to be working now.. could you take another look?

by design we don't have a convenient button to republish all docs, since we want to be selective for performance... however there is a script in the prisma-cloud-docs repo that can be used for batch publishing:

# publish one
npm run publish:batch docs/en/compute/pcee/admin-guide/waas/deploy-waas/deployment-hosts

# publish all in specific folder
npm run publish:batch docs/en/compute/pcee/admin-guide/waas/deploy-waas/fragments/**/*

# publish all (takes ~30 mins)
npm run publish:batch docs/**/*

@maxakuru maxakuru assigned iansk and unassigned maxakuru Aug 7, 2023
@iansk
Copy link
Collaborator Author

iansk commented Aug 8, 2023

@maxakuru Awesome, that's good stuff. Thanks for providing the script

@iansk
Copy link
Collaborator Author

iansk commented Aug 29, 2023

@maxakuru I'm still seeing issues with this. If I grep through the doc content for include::, and check each page, I'm finding issues with virtually every page.

As an example, these pages still show the issue. I'm not sure if was previously fixed, and now showing up again. But currently, the latest published content shows the issue:

@maxakuru
Copy link
Contributor

@iansk these are because we changed the rules for document naming to normalize paths, but didn't change the content of the documents to correctly reference those new names.

for each of these we just need to replace the _ with -.. does that help?

@iansk
Copy link
Collaborator Author

iansk commented Aug 30, 2023

@maxakuru Yes, that helps, thanks. I updated the underscore to a dash, but it's still not working completely working for me. Also, I now see some HTML code being rendered on the page.

Franklin preview:

https://main--prisma-cloud-docs-website--hlxsites.hlx.page/prisma/prisma-cloud/en/compute/pcee/admin-guide/agentless-scanning/onboard-accounts/onboard-azure?branch=ian/fix-include

GitHub pull request:

hlxsites/prisma-cloud-docs#69

BTW, our embedded Gdocs stopped working since you merged some recent fixes. I see the same weird HTML code on the page, so it may be related to this issue.

@maxakuru
Copy link
Contributor

@iansk yep my bad, I forgot to merge a fix for a typo yesterday, fix was merged in hlxsites/prisma-cloud-docs#70

@iansk
Copy link
Collaborator Author

iansk commented Aug 31, 2023

@maxakuru Thanks, the gdocs are loading again now. But the include:: macro still isn't working:

https://main--prisma-cloud-docs-website--hlxsites.hlx.page/prisma/prisma-cloud/en/compute/pcee/admin-guide/agentless-scanning/onboard-accounts/onboard-azure?branch=ian/fix-include

I tried republishing the page, but nothing changed.

When I inspect the element on the page, I see it's rendered (incorrectly) as a link:

<div>
<a href="https://main--prisma-cloud-docs-website--hlxsites.hlx.page/prisma/prisma-cloud/docs/en/compute/pcee/admin-guide/agentless-scanning/onboard-accounts/frag-start-agentless-scan?branch=ian%2Ffix-include" title="frag-start-agentless-scan.adoc">frag-start-agentless-scan.adoc</a>
</div>

@maxakuru
Copy link
Contributor

looks like this was an error during fragment loading that only occurred when the branch query param was set

should be fixed in #142, could you try again @iansk

@maxakuru maxakuru closed this as completed Oct 2, 2023
@iansk iansk reopened this Oct 15, 2023
@maxakuru
Copy link
Contributor

@iansk looking at logs and I see [worker] book is undefined, path resolution may fail for these

also on main I don't see a 30-xx folder: https://github.com/hlxsites/prisma-cloud-docs/tree/main/docs/en/compute-edition

remember that the book.yml needs to exist on main before the pages will work

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 a pull request may close this issue.

2 participants