Skip to content

Commit e53ee7e

Browse files
committed
Update README.me
1 parent bc2ee38 commit e53ee7e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,42 @@
77
[![codecov.io](http://codecov.io/github/JuliaString/APITools.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaString/APITools.jl?branch=master)
88

99
The `APITools` package is now working on both the release version (v0.6.2) and the latest master (v0.7.0-DEV).
10+
11+
This provides a way of having different lists of names that you want to be part of a public API,
12+
as well as being part of a development API (i.e. functions that are not normally needed by users of a package, but *are* needed by a developer writing a package that depends on it).
13+
It also separates lists of names of functions, that can be extended, from names of types, modules, constants that cannot be extended, and functions that are not intended to be extended.
14+
15+
This is a bit of a work-in-progress, I heartily welcome any suggestions for better syntax, better implementation, and extra functionality.
16+
17+
```julia
18+
@api <cmd> [<symbols>...]
19+
20+
* @api init # set up module/package for adding names
21+
* @api freeze # use at end of module, to "freeze" API
22+
23+
* @api use <modules>... # for normal use, i.e. `using`
24+
* @api test <modules>... # using public and develop symbols, for testing purposes
25+
* @api extend <modules>... # for development, imports `base`, `public`, and `develop` lists,
26+
* # uses `define_public`and `define_develop` lists
27+
* @api export <modules>... # export api symbols
28+
29+
* @api base <names...> # Add functions from Base that are part of the API
30+
* @api public <names...> # Add functions that are part of the public API
31+
* @api develop <names...> # Add functions that are part of the development API
32+
* @api define_public <names...> # Add other symbols that are part of the public API (structs, consts)
33+
* @api define_develop <names...> # Add other symbols that are part of the development API
34+
* @api define_module <names...> # Add submodule names that are part of the API
35+
* @api maybe_public <names...> # Conditionally import functions from Base, or define them
36+
```
37+
38+
This also includes the `@def` macro, which I've found very useful!
39+
40+
I would also like to add commands that add the functionality of `@reexport`,
41+
but instead of exporting the symbols found in the module(s), add them to either the public
42+
or develop list. (I had a thought that it could automatically add names that do not start with `_`,
43+
have a docstring, and are not exported, to the develop list, and all exported names would be added to the public list).
44+
45+
Another thing I'd like to add is a way of using/importing a module, but having pairs of names, for renaming purposes, i.e. something like `@api use Foobar: icantreadthisname => i_cant_read_this_name`
46+
which would import the variable from Foobar, but with the name after the `=>`.
47+
48+
Finally, I'd like to add a few interactive commands, such as `@api list public`, or `@api list develop Foobar`, to display what the API is of the current module, or of the given module(s).

0 commit comments

Comments
 (0)