Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

allow parser to inject hooks #27

Closed
wants to merge 4 commits into from
Closed

allow parser to inject hooks #27

wants to merge 4 commits into from

Conversation

willfarrell
Copy link

@willfarrell willfarrell commented Apr 15, 2016

#26

Naming convention:

npm package.json

"apidoc-plugin-schema":"0.0.1"

converted to apischema that will lookup apiSchema from the docs

@willfarrell
Copy link
Author

I'll publish my plugin to npm once this is merged. From there we can document some scaffolding and naming conventions others can use.

@willfarrell
Copy link
Author

willfarrell commented Apr 17, 2016

npm apidoc-plugin-example and apidoc-plugin-schema are ready to go once this PR gets merged.

https://github.com/willfarrell/apidoc-plugin-example
https://github.com/willfarrell/apidoc-plugin-schema

@bpaz
Copy link

bpaz commented Apr 21, 2016

I am also looking for this. Hope in can be merged soon. Another nice plugin would be to allow the apiDescription to be loaded from an external markdown file.

@willfarrell
Copy link
Author

@bpaz should be pretty easy to do, it should also fallback to the default function if no file is specified (the way the auto-loader is written, will will work). I would suggest the syntax @apiDescription {markdown=./path/to/file}

Lets post plugin request at https://github.com/willfarrell/apidoc-plugins for now.

@rottmann
Copy link
Member

@willfarrell Published the new version.
Please watch https://github.com/apidoc/apidoc-plugin-test for an example.

For your usecase use the hook parser-find-elements, then you can inject the annotations.

You can use app.parser.findElements (i renamed the function from _findElements and made it global accessible with app.parser).
Your plugin will be called with init(app) so you can access app.parser within your plugin.

@rottmann rottmann closed this Apr 21, 2016
@rottmann
Copy link
Member

Will add more hooks on demand and change every part of the project in the future to support plugins.
So not every functionality must be in the core... saves me a lot of time ;-)

@willfarrell
Copy link
Author

plugins have been updated to work with the latest update to apidoc-core.

Thanks @rottmann for this.

@rottmann
Copy link
Member

rottmann commented Jun 7, 2016

👍 add a link to your project in readme.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants