From 7470f6e2be034edeed2d58f25c08f2152ac972eb Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Mon, 16 Oct 2023 12:28:04 +0200 Subject: [PATCH] clean doc --- README.md | 18 ------------------ README.src.md | 9 --------- tools/doc/process_md_docs.py | 13 +++++++++++++ 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 2f2a1ee0..7016d3b2 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,7 @@ FetchContent_MakeAvailable(hello_imgui) # 2/ Option 2: if hello_imgui is available as a submodule for example # add_subdirectory(path/to/hello_imgui) -# # Build your app -# hello_imgui_add_app(hello_world hello_world.main.cpp) ``` @@ -160,13 +158,6 @@ int main(int , char *[]) } ``` -The CMakeLists fits in two lines, and will work on Linux, Mac, Windows, iOS and Emscripten_ -> CMakeLists.txt: -```cmake -include(hello_imgui_add_app) -hello_imgui_add_app(hello_globe hello_globe.main.cpp) -``` - ## Complete demo - advanced layout, FPS, theme, etc: @@ -191,15 +182,6 @@ __Table of contents__ * [Hello ImGui](#hello-imgui) * [Features](#features) * [Get started in 5 minutes](#get-started-in-5-minutes) -* [Build hello_imgui](#build-hello_imgui) -* [1/ Option 1: if you do not wish to include hello_imgui in your project folders, fetch it at build time](#1/--option-1-if-you-do-not-wish-to-include-hello_imgui-in-your-project-folders-fetch-it-at-build-time) -* [2/ Option 2: if hello_imgui is available as a submodule for example](#2/--option-2-if-hello_imgui-is-available-as-a-submodule-for-example) -* [add_subdirectory(path/to/hello_imgui)](#add_subdirectorypath/to/hello_imgui) -* [](#) -* [Build your app](#build-your-app) -* [](#) -* [Build](#build) -* [Run the build hello_world app](#run-the-build-hello_world-app) * [Do you need more widgets, or do you want to use ImGui with python?](#do-you-need-more-widgets-or-do-you-want-to-use-imgui-with-python?) * [Full usage instructions and API](#full-usage-instructions-and-api) * [Online interactive example applications](#online-interactive-example-applications) diff --git a/README.src.md b/README.src.md index 03100bac..b935a0ed 100644 --- a/README.src.md +++ b/README.src.md @@ -50,9 +50,7 @@ FetchContent_MakeAvailable(hello_imgui) # 2/ Option 2: if hello_imgui is available as a submodule for example # add_subdirectory(path/to/hello_imgui) -# # Build your app -# hello_imgui_add_app(hello_world hello_world.main.cpp) ``` @@ -140,13 +138,6 @@ int main(int , char *[]) } ``` -The CMakeLists fits in two lines, and will work on Linux, Mac, Windows, iOS and Emscripten_ -> CMakeLists.txt: -```cmake -include(hello_imgui_add_app) -hello_imgui_add_app(hello_globe hello_globe.main.cpp) -``` - ## Complete demo - advanced layout, FPS, theme, etc: diff --git a/tools/doc/process_md_docs.py b/tools/doc/process_md_docs.py index deeae0d9..d0371894 100755 --- a/tools/doc/process_md_docs.py +++ b/tools/doc/process_md_docs.py @@ -33,9 +33,22 @@ def is_header_line(line): return line.startswith("#") and not (line.startswith("#include")) +def remove_code_blocks(lines): + filtered_lines = [] + in_code_block = False + for line in lines: + if line.strip().startswith("```"): + in_code_block = not in_code_block + if not in_code_block: + filtered_lines.append(line) + return filtered_lines + + def make_toc(file): with open(file, "r") as f: lines = f.readlines() + lines = remove_code_blocks(lines) + header_lines = [line[:-1] for line in lines if is_header_line(line)] toc = '\n\n' for header_line in header_lines: