Skip to content

Commit a65221b

Browse files
authored
Include our Markdown documentation in the Doxygen site. (#8417)
A few quirks in the Markdown parser were worked around here. The most notable is that the sequence `]:` causes Doxygen to interpret a would-be link as a trailing reference even if it is not at the start of a line. Duplicating the single bracket reference is a portable workaround, i.e. [winget] ~> [winget][winget] It also doesn't stop interpreting `@` directives inside inline code, so it warns about our use of the `@` as a decorator symbol inside Python.md.
1 parent 3e6e7e0 commit a65221b

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -2560,15 +2560,17 @@ CLASS_DIAGRAMS = NO
25602560
DISTRIBUTE_GROUP_DOC = YES
25612561
EXAMPLE_PATH = "${Halide_SOURCE_DIR}/tutorial"
25622562
EXCLUDE = bin
2563+
EXCLUDE_PATTERNS = README.md
25632564
EXTRACT_ALL = YES
25642565
EXTRACT_LOCAL_CLASSES = NO
2565-
FILE_PATTERNS = *.h
2566+
FILE_PATTERNS = *.h *.md
25662567
GENERATE_TREEVIEW = YES
25672568
HIDE_FRIEND_COMPOUNDS = YES
25682569
HIDE_IN_BODY_DOCS = YES
25692570
HIDE_UNDOC_CLASSES = YES
25702571
HIDE_UNDOC_MEMBERS = YES
25712572
JAVADOC_AUTOBRIEF = YES
2573+
MARKDOWN_ID_STYLE = GITHUB
25722574
QT_AUTOBRIEF = YES
25732575
QUIET = YES
25742576
RECURSIVE = YES
@@ -2583,7 +2585,7 @@ STRIP_CODE_COMMENTS = NO
25832585
GENERATE_LATEX = NO
25842586
HAVE_DOT = NO
25852587
HTML_OUTPUT = .
2586-
INPUT = "${Halide_SOURCE_DIR}/src" "${Halide_SOURCE_DIR}/test"
2588+
INPUT = "${Halide_SOURCE_DIR}/doc" "${Halide_SOURCE_DIR}/src" "${Halide_SOURCE_DIR}/test"
25872589
OUTPUT_DIRECTORY = ${DOC_DIR}
25882590
PROJECT_NAME = Halide
25892591
endef

doc/BuildingHalideWithCMake.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ directions posted on [Kitware's website][cmake-from-source].
8282
On Windows, there are two primary methods for installing an up-to-date CMake:
8383

8484
1. You can get CMake through the Visual Studio 2022 installer.
85-
2. You can use Windows's built-in package manager, [winget]:
85+
2. You can use Windows's built-in package manager, [winget][winget]:
8686
```shell
8787
winget install Kitware.CMake
8888
```
@@ -105,8 +105,8 @@ There are a few good ways to install CMake on Ubuntu:
105105
1. If you're running 24.04 LTS, then simply running
106106
`sudo apt install cmake` will install CMake 3.28.
107107
2. If you're running an older LTS or would like to use the newest CMake, try
108-
installing via the [snap store]: `snap install cmake`. Note this will
109-
conflict with an APT-provided CMake.
108+
installing via the [snap store][snap store]: `snap install cmake`. Note this
109+
will conflict with an APT-provided CMake.
110110
3. Kitware also provides an [APT repository][cmake-apt] with up-to-date
111111
releases. Compatible with 20.04 LTS+ and is the best option for 32-bit ARM.
112112

@@ -215,7 +215,7 @@ appropriately per-platform. They are documented further below.
215215
On Windows, we recommend using `vcpkg` to install library dependencies.
216216

217217
To build the documentation, you will need to install [Doxygen]. This can be done
218-
either from the [Doxygen website][doxygen-download] or through [winget]:
218+
either from the [Doxygen website][doxygen-download] or through [winget][winget]:
219219

220220
```shell
221221
$ winget install DimitriVanHeesch.Doxygen
@@ -623,4 +623,4 @@ Python and C++ `find_package` workflows.
623623

624624
[wabt]: https://github.com/WebAssembly/wabt
625625

626-
[winget]: https://learn.microsoft.com/en-us/windows/package-manager/winget/
626+
[winget]: https://learn.microsoft.com/en-us/windows/package-manager/winget/

doc/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ set(DOXYGEN_CLASS_DIAGRAMS NO)
88
set(DOXYGEN_DISTRIBUTE_GROUP_DOC YES)
99
set(DOXYGEN_EXAMPLE_PATH "${Halide_SOURCE_DIR}/tutorial")
1010
set(DOXYGEN_EXCLUDE bin)
11+
set(DOXYGEN_EXCLUDE_PATTERNS README.md)
1112
set(DOXYGEN_EXTRACT_ALL YES)
1213
set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO)
13-
set(DOXYGEN_FILE_PATTERNS *.h)
14+
set(DOXYGEN_FILE_PATTERNS *.h *.md)
1415
set(DOXYGEN_GENERATE_TREEVIEW YES)
1516
set(DOXYGEN_HIDE_FRIEND_COMPOUNDS YES)
1617
set(DOXYGEN_HIDE_IN_BODY_DOCS YES)
1718
set(DOXYGEN_HIDE_UNDOC_CLASSES YES)
1819
set(DOXYGEN_HIDE_UNDOC_MEMBERS YES)
1920
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
21+
set(DOXYGEN_MARKDOWN_ID_STYLE GITHUB)
2022
set(DOXYGEN_QT_AUTOBRIEF YES)
2123
set(DOXYGEN_QUIET YES)
2224
set(DOXYGEN_RECURSIVE YES)
@@ -27,8 +29,6 @@ set(DOXYGEN_SORT_MEMBER_DOCS NO)
2729
set(DOXYGEN_SOURCE_BROWSER YES)
2830
set(DOXYGEN_STRIP_CODE_COMMENTS NO)
2931

30-
doxygen_add_docs(doc
31-
"${Halide_SOURCE_DIR}/src"
32-
"${Halide_SOURCE_DIR}/test"
33-
ALL
32+
doxygen_add_docs(doc "doc/" "src/" "test/" ALL
33+
WORKING_DIRECTORY "${Halide_SOURCE_DIR}"
3434
COMMENT "Generate HTML documentation")

doc/HalideCMakePackage.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,9 @@ will be added to the extension as a callable method of the module. Note that
532532
every library specified must be built with the `PYTHON_EXTENSION` keyword
533533
specified, and all libraries must use the same Halide runtime.
534534

535-
The result will be a shared library of the form
536-
`<target>.<soabi>.so`, where <soabi> describes the specific Python version and
537-
platform (e.g., `cpython-310-darwin` for Python 3.10 on macOS.)
535+
The result will be a shared library of the form `<target>.<soabi>.so`, where
536+
`<soabi>` describes the specific Python version and platform (e.g.,
537+
`cpython-310-darwin` for Python 3.10 on macOS.)
538538

539539
### `add_halide_runtime`
540540

doc/Python.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* [Example of Simple Usage](#example-of-simple-usage)
1212
* [Halide Generators In Python](#halide-generators-in-python)
1313
* [Writing a Generator in Python](#writing-a-generator-in-python)
14-
* [@hl.generator("name")](#hlgeneratorname)
14+
* [`hl.generator("name")`](#hlgeneratorname)
1515
* [hl.GeneratorParam](#hlgeneratorparam)
1616
* [hl.InputBuffer, hl.InputScalar](#hlinputbuffer-hlinputscalar)
1717
* [hl.OutputBuffer, hl.OutputScalar](#hloutputbuffer-hloutputscalar)
@@ -348,7 +348,7 @@ C++ Generators for the following to make sense.)
348348

349349
Let's take the details here one at a time.
350350

351-
#### @hl.generator("name")
351+
#### `hl.generator("name")`
352352

353353
This decorator adds appropriate "glue" machinery to the class to enforce various
354354
invariants. It also serves as the declares a "registered name" for the
@@ -523,9 +523,9 @@ add_halide_python_extension_library(my_extension
523523
This compiles the Generator code in `logical_op_generator.py` with the
524524
registered name `logical_op_generator` to produce the target `xor_filter`, and
525525
then wraps the compiled output with a Python extension. The result will be a
526-
shared library of the form
527-
`<target>.<soabi>.so`, where <soabi> describes the specific Python version and
528-
platform (e.g., `cpython-310-darwin` for Python 3.10 on OSX.)
526+
shared library of the form `<target>.<soabi>.so`, where `<soabi>` describes
527+
the specific Python version and platform (e.g., `cpython-310-darwin` for
528+
Python 3.10 on OSX.)
529529

530530
Note that you can combine multiple Halide libraries into a single Python module;
531531
this is convenient for packaging, but also because all the libraries in a single

0 commit comments

Comments
 (0)