tomtom-international / asciidoxy

AsciiDoxy generates API documentation from Doxygen XML output to AsciiDoc.
Apache License 2.0
31 stars 10 forks source link

doxygen insert error #122

Open redboltz opened 3 months ago

redboltz commented 3 months ago

Overview

I'm trying to use asciidoxy. Getting started works as I expected. https://asciidoxy.org/getting-started.html

When I try to include API reference, I got an error. https://asciidoxy.org/getting-started/api-reference.html

Is my setting something wrong ?

NOTE: If I remove ${insert("my_test_func", lang="c++")} line, no error is reported.

Here are the information:

Tree (after doxygen executed)

.
├── code
│   ├── Doxyfile
│   └── my_test_func.hpp
├── my-package
│   ├── contents.toml
│   ├── src
│   │   └── index.adoc
│   └── xml
│       ├── Doxyfile.xml
│       ├── combine.xslt
│       ├── compound.xsd
│       ├── doxyfile.xsd
│       ├── index.xml
│       ├── index.xsd
│       ├── my__test__func_8hpp.xml
│       └── xml.xsd
└── packages.toml

./packages.toml

[packages]

[packages.my-package]
type = "local"
package_dir = "my-package"
xml_subdir = "xml"

./my-package/contents.toml

[package]
name = "my-package"

[asciidoc]
src_dir = "src"

./my-package/src/indx.adoc

= My

${insert("my_test_func", lang="c++")}

./code/my_test_func.hpp

/**
 * @brief My test function
 *
 *
 */
void my_test_func() {
}

Command

asciidoxy --spec-file packages.toml my-package/src/index.adoc         

Error


    ___              _ _ ____             0.8.7
   /   |  __________(_|_) __ \____  _  ____  __
  / /| | / ___/ ___/ / / / / / __ \| |/_/ / / /
 / ___ |(__  ) /__/ / / /_/ / /_/ />  </ /_/ /
/_/  |_/____/\___/_/_/_____/\____/_/|_|\__, /
                                      /____/

Collecting packages     : 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1079.89pkg/s]
Loading API reference   : 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 30840.47pkg/s]
Resolving references    : 0ref [00:00, ?ref/s]
Checking references     : 0ref [00:00, ?ref/s]
Preparing work directory: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 1852.61pkg/s]
Processing asciidoc     :   0%|                                                                                                                             | 0/2 [00:00<?, ?file/s]
ERROR: Error while processing AsciiDoc files:
Cannot find any my_test_func for cpp
Traceback:
  File index.adoc, line 3, in AsciiDoc
    ${insert("my_test_func", lang="c++")}
  File /home/kondo/local_python/lib/python3.12/site-packages/asciidoxy/generator/asciidoc.py, line 140, in _wrapper
    ret = f(*args, **kwargs)
  File /home/kondo/local_python/lib/python3.12/site-packages/asciidoxy/generator/asciidoc.py, line 281, in insert
    return self.insert_fragment(self.find_element(name,
  File /home/kondo/local_python/lib/python3.12/site-packages/asciidoxy/generator/asciidoc.py, line 606, in find_element
    raise ReferenceNotFoundError(name, lang=lang, kind=kind)

Doxyfine

Modify points:

OUTPUT_DIRECTORY       = ../my-package
GENERATE_LATEX         = NO
GENERATE_XML           = YES

Environment