Skip to content

Conversation

patrikbraborec
Copy link
Contributor

@patrikbraborec patrikbraborec commented Aug 15, 2025

A draft for "LLM buttons" in our docs.

It allows you to:

  • Copy for LLM - button that copies the whole page as markdown to your clipboard
  • View as Markdown - button that opens a new tab with the current page as a markdown

I call it a draft because it needs to be tested more properly as I edited layout files, and it would be also good to add to ALL docs pages (so far it works only on the academy and platform pages).

@apify-service-account
Copy link

Preview for this PR was built for commit 24ce362f and is ready at https://pr-1803.preview.docs.apify.com!

@TC-MO
Copy link
Contributor

TC-MO commented Aug 16, 2025

Do we need those button on /legal?

@patrikbraborec
Copy link
Contributor Author

I think we can remove it from /legal

@patrikbraborec
Copy link
Contributor Author

In the last update, I added:

  • Support for dark mode
  • Analytics
  • Change position of buttons

@apify-service-account
Copy link

Preview for this PR was built for commit c366bc06 and is ready at https://pr-1803.preview.docs.apify.com!

Copy link

cursor bot commented Aug 18, 2025

Bugbot found 1 bug

To see it, have a team admin activate your membership in the Cursor dashboard.

@apify-service-account
Copy link

Preview for this PR was built for commit dd76b66 and is ready at https://pr-1803.preview.docs.apify.com!

Copy link
Contributor

@TC-MO TC-MO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching redundant H1!

Regarding the buttons:

  • they look good but on API docs they seem to float above the whole text instead of being under the title
image * Also we have those pages that aggregate all endpoints within a section like [this page here](https://docs.apify.com/api/v2/actors), and I'm not sure if they are needed here image Interestingly enough, they are placed correctly here

@apify-service-account
Copy link

Preview for this PR was built for commit 1427dd9 and is ready at https://pr-1803.preview.docs.apify.com!

@patrikbraborec
Copy link
Contributor Author

I fixed the /api page. The solution is little bit hacky, tho. Will be probably good, if someone from tooling team will take a look. (cc. @B4nan).

@mnmkng
Copy link
Member

mnmkng commented Aug 19, 2025

Would be cool to have some description in the PR. Hard to do a review when I don't know what I'm looking at 😅

@patrikbraborec
Copy link
Contributor Author

patrikbraborec commented Aug 19, 2025

Sorry @mnmkng, Github added you automatically as a reviewer, but I discussed this thing mainly with @TC-MO (I should have edited the reviewers). Anyway, you are right that it should have proper description, and I added it. :)

Copy link
Member

@B4nan B4nan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess we can leave it like this. i'd personally just patch the plugin (which we already do) to add the buttons directly (you can modify the files directly in node_modules and use patch-package to apply the changes on postinstall). there is one trick you can use so the imports are not necessary:

https://docusaurus.io/docs/markdown-features/react#mdx-component-scope

given a lot of those changes are about the imports, maybe using the global scope for that would make sense, to reduce the length of this

Copy link
Member

@fnesveda fnesveda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, good job with hacking the markdown generators 👏 I had just some small ideas for improvement, nothing major.

Copy link
Member

@fnesveda fnesveda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, one more thing - I noticed that now the markdown files contain some weird characters that they didn't have before, e.g. here:
https://pr-1803.preview.docs.apify.com/platform/actors.md

Screenshot 2025-08-20 at 16 40 34

@apify-service-account
Copy link

Preview for this PR was built for commit 77f05d18 and is ready at https://pr-1803.preview.docs.apify.com!

Copy link

cursor bot commented Aug 21, 2025

Bugbot found 2 bugs

To see them, have a team admin activate your membership in the Cursor dashboard.

@apify-service-account
Copy link

Preview for this PR was built for commit 16b441ec and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 276d06c6 and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 99ec6fc0 and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit c143d170 and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 696fd490 and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 90c462fd and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit a475915f and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit c60a725c and is ready at https://pr-1803.preview.docs.apify.com!

Copy link

cursor bot commented Aug 21, 2025

Bugbot found 1 bug

To see it, have a team admin activate your membership in the Cursor dashboard.

@apify-service-account
Copy link

Preview for this PR was built for commit 86f42b6 and is ready at https://pr-1803.preview.docs.apify.com!

Fix issues with content template
@apify-service-account
Copy link

Preview for this PR was built for commit f162354 and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 0e597aa and is ready at https://pr-1803.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 1946455 and is ready at https://pr-1803.preview.docs.apify.com!

@patrikbraborec
Copy link
Contributor Author

Hi @fnesveda, thanks for the review and suggestions.

I fixed all your comments, but unfortunately I wasn't able to fix the one with weird characters (see the image). In the end, I found that the issue is caused by something else because I tried to create an empty PR #1819, and you can see the issue there as well.

Interestingly enough, if you check production, it works correctly. So maybe it's something with the preview environment?

Anyway, if it's OK with you, I would merge this PR and tackle the issue in a separate PR.

cc. @HonzaTuron, you can check the function that removes LLM buttons from .md files, if you want.

image

@HonzaTuron
Copy link
Contributor

@patrikbraborec @fnesveda Regarding weird characters, when you download markdown file and open it in normal editor, it shows zero width space.

Screenshot 2025-08-21 at 14 36 17

So I believe this is an issue of browser rendering which trying to render some HTML element instead.

@fnesveda
Copy link
Member

Hi @fnesveda, thanks for the review and suggestions.

I fixed all your comments, but unfortunately I wasn't able to fix the one with weird characters (see the image). In the end, I found that the issue is caused by something else because I tried to create an empty PR #1819, and you can see the issue there as well.

Interestingly enough, if you check production, it works correctly. So maybe it's something with the preview environment?

Oh wow, interesting. I've looked into it quickly, and it looks like the weird characters are zero-width spaces, and Docusaurus is adding them into the links so that they would display at all: facebook/docusaurus#5990.

They're present in both the production and preview docs, but on production, the .md files are served with text/markdown; charset=utf-8, which makes them render correctly. In the preview PRs, the .md files are served with just text/markdown, so they're not rendered as Unicode characters, just ASCII ones. This is because the production docs are served from GitHub Pages, but the preview docs are served from S3.

Anyway, if it's OK with you, I would merge this PR and tackle the issue in a separate PR.

Yep, agreed. IMHO easiest would be to have some post-processing step which runs a search&replace on the built .md files, but if you're feeling generous with your time, you could try to fix it in the plugin which generates those markdown files (https://github.com/signalwire/docusaurus-plugins).

Copy link
Contributor

@TC-MO TC-MO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All engines go from me

@patrikbraborec
Copy link
Contributor Author

Thanks for the findings @fnesveda! I created the issue: #1821.

I will keep this issue for "dlouhé zimní večery" :)

@patrikbraborec patrikbraborec merged commit 7f625b6 into master Aug 21, 2025
10 checks passed
@patrikbraborec patrikbraborec deleted the docs/llms-buttons branch August 21, 2025 13:29
daveomri pushed a commit to daveomri/apify-docs that referenced this pull request Sep 3, 2025
Co-authored-by: František Nesveda <fnesveda@users.noreply.github.com>
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.

7 participants