Skip to content

Allow exclusions when extracting example code #296

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

Closed
wants to merge 4 commits into from

Conversation

mingxwa
Copy link
Collaborator

@mingxwa mingxwa commented May 12, 2025

Allow passing more arguments to extract_example_code_from_docs.py to exclude specific files in case some features, like modules, are only available in the most recent compiler versions. This change also supports multiple code blocks in one .md file. No functional changes. Tested manually.

@SidneyCogdill
Copy link
Contributor

SidneyCogdill commented May 12, 2025

I'm working on a much more advanced solution:

  • Allow custom CMake template for each example targets (per doc target). The usecase can be easily addressed using a template like this:
if(PROXY_BUILDING_WITH_MODULE)
  add_executable($NAME$ code_2.cpp)
  
  target_link_libraries($NAME$ msft_proxy::module)
  target_compile_features($NAME$ PRIVATE cxx_std_20)

  target_sources($NAME$ PRIVATE
    FILE_SET CXX_MODULES
    FILES code_1.cpp
    )
endif()
  • Multiple codeblocks are supported and added to per doc target, unlike current script which rejects more than 1. This is useful to showcase the module support (importing and exporting)

you can close this and wait for my implementation (I'm still testing it).

@mingxwa mingxwa closed this May 12, 2025
@mingxwa mingxwa reopened this May 12, 2025
@mingxwa mingxwa closed this May 15, 2025
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