[
https://issues.apache.org/jira/browse/NIFI-725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14704820#comment-14704820
]
Dan Bress commented on NIFI-725:
--------------------------------
If anyone is interested in playing with what I am working on, here is some info:
The basic mechanics are as follows
1) Develop a new maven plugin
(https://github.com/apache/nifi/tree/NIFI-725-master/nifi-documentation-plugin)
that has a goal called "document" that can be run on a maven project to look
for processors/controllerservices/reportingtasks and generate HTML. This goes
in the docs/ folder in the jar, same place where additionalDetails.html goes
2) modified NiFi.java to remove DocGenerator call. Will use the existing
code to pull out html from the nar/jars just like it used to.
3) Somewhere (currently nifi-assembly we depend on all the nars. Invoke a
new maven plugin (nifi-documentation-plugin) that has a goal called "extract"
that will walk all the nar dependencies, then walk all the jars inside and
extract stuff into target/classes/docs. We could also depend on nifi-docs and
nifi-web-api, and use an assembly to unpack the HTML(AsciiDoc and REST Api)
into a place we can use later
4) Develop a new maven plugin(nifi-documentation-plugin) that has a goal
called "generate-index" that will look at all the extracted documentation we
have and generate the index.html (http://nifi.apache.org/docs.html).
5) use assembly plugin to pull this all together in a zip/directory
structure for easy uploading to the website
6) use the SCM plugin to push to website.
To see what this looks like on your box:
git checkout NIFI-725-master
cd nifi-documentation-plugin
mvn clean install
cd ..
mvn clean install
cd nifi-assembly/target
inspect "nifi-0.3.0-SNAPSHOT-site", that should be the directory structure we
want to upload to the site, yeah? Also you can check out the app and make sure
it still works the way you expect and the docs look as you expect.
> Refactor when documentation is generated
> ----------------------------------------
>
> Key: NIFI-725
> URL: https://issues.apache.org/jira/browse/NIFI-725
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Core Framework, Documentation & Website
> Affects Versions: 0.1.0
> Reporter: Dan Bress
> Assignee: Dan Bress
> Priority: Minor
>
> Currently the DocGenerator, which generates all of our
> Processor/ReportingTask/ControllerService documentation, is invoked directly
> from the
> [NiFi|https://github.com/apache/incubator-nifi/blob/develop/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-runtime/src/main/java/org/apache/nifi/NiFi.java#L123]
> class in the runtime project.
> Invoking the DocGenerator directly from the runtime hamstrings what libraries
> the DocGenerator can use, because the runtime project should have the least
> number of dependencies possible, and it currently depends on the
> documentation library.
> I'm proposing that we find a new way/place to invoke documentation generation
> such that it may bring in whatever dependencies it needs.
> The first dependency it needs is on nifi-framework-core
> [ReflectionUtils|https://github.com/apache/incubator-nifi/blob/develop/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/ReflectionUtils.java],
> which would let us [this
> copy|https://github.com/apache/incubator-nifi/blob/NIFI-632/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/util/ReflectionUtils.java]
> of that class.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)