-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
- Loading branch information
Showing
6 changed files
with
238 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Generate API page for documentation | ||
import os | ||
|
||
def gen_pages(): | ||
header = os.path.join( | ||
os.path.dirname(__file__), "..", "bindings", "c", "include", "cgenalyzer.h" | ||
) | ||
|
||
if not os.path.exists(header): | ||
print("Header file not found") | ||
exit() | ||
|
||
with open(header, "r") as f: | ||
lines = f.readlines() | ||
|
||
functions = [] | ||
|
||
for line in lines: | ||
if "__api" in line: | ||
line = line.split(" ") | ||
for l in line: | ||
if "gn_" in l: | ||
# Remove everything after ( | ||
l = l.split("(")[0] | ||
functions.append(l) | ||
|
||
# print(line.strip()) | ||
# functions.append(line.strip()) | ||
|
||
count = len(functions) | ||
|
||
# Organize | ||
|
||
set_functions = [] | ||
get_functions = [] | ||
config_functions = [] | ||
generate_functions = [] | ||
operation_functions = [] | ||
missed = [] | ||
for function in functions: | ||
if "set" in function: | ||
set_functions.append(function) | ||
continue | ||
if "get" in function: | ||
get_functions.append(function) | ||
continue | ||
if "config" in function: | ||
config_functions.append(function) | ||
continue | ||
if "gen" in function: | ||
generate_functions.append(function) | ||
continue | ||
operation_functions.append(function) | ||
|
||
set_count = len(set_functions) | ||
config_count = len(config_functions) | ||
|
||
print(f"Total functions: {count}") | ||
print(f"Set functions: {set_count}") | ||
print(f"Config functions: {config_count}") | ||
print(f"Get functions: {len(get_functions)}") | ||
print(f"Generate functions: {len(generate_functions)}") | ||
|
||
# Generate md file for breathe | ||
page = "<!--- This file is auto-generated. Do not edit -->\n\n" | ||
|
||
page += "# API Reference\n\n" | ||
page += "This page contains the API reference for the Genalyzer library.\n\n" | ||
|
||
# Table of contents | ||
|
||
page += "## Function Groups\n\n" | ||
page += "- [Set Functions](#set-functions)\n" | ||
page += "- [Get Functions](#get-functions)\n" | ||
page += "- [Config Functions](#config-functions)\n" | ||
page += "- [Generate Functions](#generate-functions)\n" | ||
page += "- [Operation Functions](#operation-functions)\n\n" | ||
|
||
page += "## Structs\n\n" | ||
|
||
|
||
def gen_functions(functions): | ||
page = "" | ||
for function in functions: | ||
page += "```{eval-rst}\n" | ||
page += f".. doxygenfunction:: {function}\n\n" | ||
page += "```\n\n" | ||
return page | ||
|
||
page += "---\n\n" | ||
page += "## Set Functions\n\n" | ||
page += gen_functions(set_functions) | ||
|
||
page += "---\n\n" | ||
page += "## Get Functions\n\n" | ||
page += gen_functions(get_functions) | ||
|
||
page += "---\n\n" | ||
page += "## Config Functions\n\n" | ||
page += gen_functions(config_functions) | ||
|
||
page += "---\n\n" | ||
page += "## Generate Functions\n\n" | ||
page += gen_functions(generate_functions) | ||
|
||
page += "---\n\n" | ||
page += "## Operation Functions\n\n" | ||
page += gen_functions(operation_functions) | ||
|
||
with open("reference.md", "w") as f: | ||
f.write(page) | ||
print("API page generated") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ Reference | |
.. 02_using_genalyzer | ||
03_examples | ||
reference | ||
reference_advanced | ||
|
||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# Advanced API Reference | ||
|
||
Advanced API Reference for Genalyzer library. This API is meant for advanced users who want to use the library functions for more complex tasks. | ||
|
||
## Table of Contents | ||
|
||
```{contents} | ||
:class: this-will-duplicate-information-and-it-is-still-useful-here | ||
``` | ||
|
||
## Enumerations | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: Enumerations | ||
``` | ||
|
||
## API Utilities | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: APIUtilities | ||
``` | ||
|
||
## Array Operations | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: ArrayOperations | ||
``` | ||
|
||
## Code Density | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: CodeDensity | ||
``` | ||
|
||
|
||
## Code Density Helpers | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: CodeDensityHelpers | ||
``` | ||
|
||
## Fourier Analysis | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: FourierAnalysis | ||
``` | ||
|
||
## Fourier Analysis Configuration | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: FourierAnalysisConfiguration | ||
``` | ||
|
||
## Fourier Analysis Results | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: FourierAnalysisResults | ||
``` | ||
|
||
## Fourier Analysis Helpers | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: FourierAnalysisHelpers | ||
``` | ||
|
||
## Fourier Transforms | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: FourierTransforms | ||
``` | ||
|
||
## Fourier Transform Helpers | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: FourierTransformHelpers | ||
``` | ||
|
||
## Fourier Utilities | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: FourierUtilities | ||
``` | ||
|
||
## Fourier Utility Helpers | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: FourierUtilityHelpers | ||
``` | ||
|
||
## Manager | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: Manager | ||
``` | ||
|
||
## Manager Helpers | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: ManagerHelpers | ||
``` | ||
|
||
## Signal Processing | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: SignalProcessing | ||
``` | ||
|
||
## Signal Processing Helpers | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: SignalProcessingHelpers | ||
``` | ||
|
||
## Waveforms | ||
|
||
```{eval-rst} | ||
.. doxygengroup:: Waveforms | ||
``` |