Skip to content

Commit

Permalink
clean doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Oct 16, 2023
1 parent a4ce530 commit 7470f6e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
9 changes: 0 additions & 9 deletions README.src.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

Expand Down Expand Up @@ -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:
Expand Down
13 changes: 13 additions & 0 deletions tools/doc/process_md_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<span id="TOC"/></span>\n\n'
for header_line in header_lines:
Expand Down

0 comments on commit 7470f6e

Please sign in to comment.