@@ -70,14 +70,14 @@ you can replace ``babelapi`` with ``python -m babelapi.cli`` as follows::
7070Simple Example
7171--------------
7272
73- You can compile an example spec describing the Dropbox API and apply it to a
74- Python code generator ::
73+ You can compile an example spec, `` users.babel `` describing the Dropbox API and
74+ generate Python code using `` base_namespace.babelg.py `` ::
7575
76- $ babelapi example/api/dbx-core/users.babel example/generator/dropbox-python-sdk /
76+ $ babelapi example/generator/dropbox-python-sdk/dbx_python_json.babelg.py example/ api/dbx-core/users.babel output /
7777
7878You can view the generated code at::
7979
80- $ example/generator/dropbox-python-sdk /base_users.py
80+ $ output /base_users.py
8181
8282File Types
8383==========
@@ -95,7 +95,7 @@ Header (.babelh extension)
9595Headers define only data types available in an API. Headers can be included
9696in spec files so that common data types can be re-used.
9797
98- Code Generator (.babelt .py extension)
98+ Code Generator (.babelg .py extension)
9999--------------------------------------
100100
101101Code generators are Python modules that implement the abstract
@@ -455,8 +455,8 @@ Defining a Code Generator
455455A code generator is a Python class which will generate code for a target language
456456given an API description. A code generator must satisfy the following conditions:
457457
458- 1. The filename must have ``.babelt .py `` as its extension. For example,
459- ``example.babelt .py ``
458+ 1. The filename must have ``.babelg .py `` as its extension. For example,
459+ ``example.babelg .py ``
460460
4614612. A class must exist in the file that extends the
462462 ``babelapi.generator.generator.CodeGenerator `` class and implements the
@@ -480,7 +480,7 @@ folder.
480480Example 1: List All Namespaces
481481^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
482482
483- We'll create a generator ``ex1.babelt .py `` that generates a file called
483+ We'll create a generator ``ex1.babelg .py `` that generates a file called
484484``ex1.out ``. Each line in the file will be the name of a defined namespace::
485485
486486 from babelapi.generator.generator import CodeGenerator
@@ -499,6 +499,7 @@ Run the generator from the root of the BabelAPI folder using the example specs
499499we've provided::
500500
501501 $ babelapi example/api/dbx-core*.babel example/generator/ex1
502+ $ babelapi example/generator/ex1/ex1.babelg.py example/api/dbx-core/*.babel output/ex1
502503
503504Now examine the contents of the output::
504505
@@ -566,14 +567,14 @@ class to ``True``.
566567Run the generator from the root of the BabelAPI folder using the example specs
567568we've provided::
568569
569- $ babelapi example/api/dbx-core*.babel example/generator /ex2
570+ $ babelapi example/generator/ex2/ex2.babelg.py example/ api/dbx-core/ *.babel output /ex2
570571
571572Now examine the contents of the output::
572573
573- $ cat example/generator /ex2/files.py
574+ $ cat output /ex2/files.py
574575 def noop():
575576 pass
576- $ cat example/generator /ex2/users.py
577+ $ cat output /ex2/users.py
577578 def noop():
578579 pass
579580
0 commit comments