Skip to content

Conversation

@maxkfranz
Copy link
Member

Cross-references to related issues. If there is no existing issue that describes your bug or feature request, then create an issue before making your pull request.

Associated issues:

  • N/A -- just a tweak to the docs

Notes re. the content of the pull request. Give context to reviewers or serve as a general record of the changes made. Add a screenshot or video to demonstrate your new feature, if possible.

  • Disable the runnable JS button on JS blocks that aren't suitable for running inline.

Checklist

Author:

  • The proper base branch has been selected. New features go on unstable. Bug-fix patches can go on either unstable or master.
  • Automated tests have been included in this pull request, if possible, for the new feature(s) or bug fix. Check this box if tests are not pragmatically possible (e.g. rendering features could include screenshots or videos instead of automated tests).
  • The associated GitHub issues are included (above).
  • Notes have been included (above).
  • For new or updated API, the index.d.ts Typescript definition file has been appropriately updated.

Reviewers:

  • All automated checks are passing (green check next to latest commit).
  • At least one reviewer has signed off on the pull request.
  • For bug fixes: Just after this pull request is merged, it should be applied to both the master branch and the unstable branch. Normally, this just requires cherry-picking the corresponding merge commit from master to unstable -- or vice versa.

Disable the runnable JS button on JS blocks that aren't suitable for running inline.
@maxkfranz maxkfranz added this to the 3.33.1 milestone Aug 7, 2025
@maxkfranz maxkfranz requested a review from Copilot August 7, 2025 13:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the ability to selectively disable the runnable JavaScript button on certain documentation sections that aren't suitable for inline code execution.

  • Introduces a configuration option to specify which markdown files should have the run button disabled
  • Modifies the markdown rendering logic to conditionally apply the custom renderer based on the file being processed
  • Adds four specific documentation files to the blocked list (intro, notation, getting-started, and core/init)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
documentation/docmaker.mjs Implements conditional renderer selection based on blocked file configuration
documentation/docmaker.json Adds configuration array listing files where run buttons should be disabled

Comment on lines +93 to +95
let mdBtnAllowed = !mdBtnBlocked;

if( mdBtnAllowed ){
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

The variable 'mdBtnAllowed' is redundant since it's just the negation of 'mdBtnBlocked'. Consider using '!mdBtnBlocked' directly in the conditional check to reduce unnecessary variables.

Suggested change
let mdBtnAllowed = !mdBtnBlocked;
if( mdBtnAllowed ){
if( !mdBtnBlocked ){

Copilot uses AI. Check for mistakes.
@maxkfranz maxkfranz merged commit 42aced8 into unstable Aug 12, 2025
2 checks passed
maxkfranz added a commit that referenced this pull request Aug 12, 2025
…cs-run-btn-excl

Exclude sections from run button in docs
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