Skip to content

Conversation

@mingxwa
Copy link
Member

@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
@mingxwa mingxwa deleted the user/mingxwa/allow-exclusions branch July 5, 2025 07:16
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