Skip to content

Commit 54eca1d

Browse files
authored
correct import of HydraClass and fix apidoc to api_doc in the docs
* chore: wrong import docs HydraClass HydraDoc was imported instead of HydraClass * fix: apidoc to api_doc
1 parent 50463c5 commit 54eca1d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/source/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ The API Documentation has been created, but it is not yet complete. Classes, pro
121121
.. code-block:: python
122122
:linenos:
123123
124-
from hydra_python_core.doc_writer import HydraDoc
124+
from hydra_python_core.doc_writer import HydraClass
125125
# Creating classes for the API
126126
class_title = "dummyClass" # Title of the Class
127127
class_description = "A dummyClass for demo" # Description of the class
@@ -216,22 +216,22 @@ Other than this, an API Documentation also needs to have the Resource and the Co
216216
:linenos:
217217
218218
# Other operations
219-
apidoc.add_baseResource() # Creates the base Resource Class and adds it to the API Documentation
220-
apidoc.add_baseCollection() # Creates the base Collection Class and adds it to the API Documentation
219+
api_doc.add_baseResource() # Creates the base Resource Class and adds it to the API Documentation
220+
api_doc.add_baseCollection() # Creates the base Collection Class and adds it to the API Documentation
221221
222222
Finally, create the EntryPoint object for the API Documentation. All Collections are automatically assigned endpoints in the EntryPoint object. Classes that had their endpoint variables set to True are also assigned endpoints in the EntryPoint object. This object is created automatically by the HydraDoc object and can be created using the gen_EntryPoint method.
223223

224224
.. code-block:: python
225225
:linenos:
226226
227-
apidoc.gen_EntryPoint() # Generates the EntryPoint object for the Doc using the Classes and Collections
227+
api_doc.gen_EntryPoint() # Generates the EntryPoint object for the Doc using the Classes and Collections
228228
229229
The final API Documentation can be viewed by calling the generate method which returns a Python dictionary containing the entire API Documentation. The generate method can be called for every class defined in the doc_writer module to generate its own Python dictionary.
230230

231231
.. code-block:: python
232232
:linenos:
233233
234-
doc = apidoc.generate()
234+
doc = api_doc.generate()
235235
236236
The complete script for this API Documentation can be found in ``samples/doc_writer_sample.py``, and the generated ApiDocumentation can be found in ``samples/doc_writer_sample_output.py``.
237237

0 commit comments

Comments
 (0)