Skip to content

Conversation

@mguludag
Copy link
Member

@mguludag mguludag commented May 3, 2025

Issue: #55

PR to how to embed godbolt links into pages, the newly added page content, path may change.

Usage of Godbolt embedding:

```cpp { "compilers": ["compiler compiler_flags",...], "libs": ["lib@version",...], "filters": {"execute":true} }
// some cpp code

then build process of website automatically creates godbolt link on top of code block like this:

Screenshot 2025-07-20 170934

@mguludag mguludag linked an issue May 3, 2025 that may be closed by this pull request
1 task
@netlify
Copy link

netlify bot commented May 3, 2025

Deploy Preview for bemanproject ready!

Name Link
🔨 Latest commit 72b3e8d
🔍 Latest deploy log https://app.netlify.com/projects/bemanproject/deploys/68c54375a777f800085684b4
😎 Deploy Preview https://deploy-preview-56--bemanproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mguludag mguludag force-pushed the 55-research-how-we-can-use-embedded-godbolt-support-for-beman-website branch 3 times, most recently from 18d739f to 36f9a6c Compare May 3, 2025 20:31
@mguludag mguludag force-pushed the 55-research-how-we-can-use-embedded-godbolt-support-for-beman-website branch from 36f9a6c to 7f4f8d7 Compare June 14, 2025 22:49
@JeffGarland
Copy link
Member

So @mguludag I think I see what you're trying to do here -- but I don't see that optional page in the preview site. Is that because it's not linked from anywhere?

@mguludag
Copy link
Member Author

So @mguludag I think I see what you're trying to do here -- but I don't see that optional page in the preview site. Is that because it's not linked from anywhere?

It's under Docs > Beman Libraries (experimental page copy of the Libraries page) > beman.optional:
https://deploy-preview-56--bemanproject.netlify.app/docs/libs/beman.optional/

@JeffGarland
Copy link
Member

So @mguludag I think I see what you're trying to do here -- but I don't see that optional page in the preview site. Is that because it's not linked from anywhere?

It's under Docs > Beman Libraries (experimental page copy of the Libraries page) > beman.optional: https://deploy-preview-56--bemanproject.netlify.app/docs/libs/beman.optional/

oh cool. That looks like a resonable start. Have a look at cppreference though to see what they're doing (recently I noted they starting using godbolt). For example:

https://www.cppreference.com/w/cpp/utility/basic_stacktrace.html

The nice thing about theirs is you don't get the godbolt terms of service in your face. The downside I can see here is that the 'link to edit on godbolt' is less clear.

Side note -- I like how docusarus is generating a right side quick link for the .md. That's a good omen for when we start generating library docs.

Copy link
Member

@neatudarius neatudarius left a comment

Choose a reason for hiding this comment

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

LGTM for POC phase. Looks like a good lead.

@mguludag
Copy link
Member Author

So @mguludag I think I see what you're trying to do here -- but I don't see that optional page in the preview site. Is that because it's not linked from anywhere?

It's under Docs > Beman Libraries (experimental page copy of the Libraries page) > beman.optional: https://deploy-preview-56--bemanproject.netlify.app/docs/libs/beman.optional/

oh cool. That looks like a resonable start. Have a look at cppreference though to see what they're doing (recently I noted they starting using godbolt). For example:

https://www.cppreference.com/w/cpp/utility/basic_stacktrace.html

The nice thing about theirs is you don't get the godbolt terms of service in your face. The downside I can see here is that the 'link to edit on godbolt' is less clear.

Side note -- I like how docusarus is generating a right side quick link for the .md. That's a good omen for when we start generating library docs.

I found an example for hugo that using Compiler Explorer API also nice idea to generate godbolt links from the code snippet in the md page.

@mguludag mguludag force-pushed the 55-research-how-we-can-use-embedded-godbolt-support-for-beman-website branch 3 times, most recently from 73b1187 to 1463012 Compare June 18, 2025 17:24
@mguludag mguludag requested a review from JeffGarland as a code owner July 20, 2025 09:25
@mguludag mguludag changed the title [experimental] research how we can use embedded godbolt support for beman website research how we can use embedded godbolt support for beman website Jul 20, 2025
@mguludag mguludag self-assigned this Jul 20, 2025
@mguludag mguludag force-pushed the 55-research-how-we-can-use-embedded-godbolt-support-for-beman-website branch 6 times, most recently from be8d720 to df2308f Compare July 21, 2025 10:50
@mguludag
Copy link
Member Author

Hi @JeffGarland I think this feature is finalized from my side and now we have flexible options for embedding godbolt links/generating godbolt links from the markdown codeblock. I also checked the markdown rendering on github and there is no problem (link generation only works for website).

@JeffGarland
Copy link
Member

Ok, thanks for all the effort on this. I wonder what to do next -- put this into some sort of guidance?

@mguludag
Copy link
Member Author

Yes, I need to update the README.md to how to embed the code or godbolt links in the pages.

@mguludag mguludag force-pushed the 55-research-how-we-can-use-embedded-godbolt-support-for-beman-website branch from b1faf3c to 72b3e8d Compare September 13, 2025 10:12
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.

Research how we can use embedded godbolt support for Beman website

4 participants