Commit Graph

29 Commits

Author SHA1 Message Date
Eric Putnam 5e3bb61adf
fix travis failure 2018-06-10 19:53:58 -07:00
Eric Putnam adbf887246
(PDOC-212, PDOC-213) add support for @note and @todo 2018-06-08 14:59:59 -07:00
Eric Putnam 03b36bcb9f
(PDOC-255) markdown table of contents update
Markdown output does not currently distinguish between the group headings for the table of contents and group headings in the actual content. This change adds a 'Table of Contents' heading and changes group headings to bold text to make it much more clear that you're looking at the table of contents.
2018-06-03 20:27:05 -07:00
Eric Putnam 2d59213b34
(PDOC-238) add generated message to markdown
Currently there is no evidence in REFERENCE.md itself that it was generated and should not be edited. This adds a comment in the markdown, so as not to disrupt its rendered appearance but still communicate to the user when editing that the file is generated.
2018-04-20 16:25:40 +01:00
Eric Putnam d4ca490d1b
(maint) display Plans in markdown table of contents
Currently, Plans are not being included in the table of contents in the
markdown output. This is because Plans were not being passed to the
table of contents renderer. This adds Plans to the renderer and updates
tests accordingly.
2018-04-03 13:37:47 +01:00
John Lyman ca26677cad (PDOC-233) Make markdown white space formatting consistent
Replace arbitrary double blank lines with a single blank lines.
2018-03-30 13:02:59 +00:00
John Lyman d9065e6f2e (PDOC-233) Increase chances of markdown rendering correctly
Some variants of markdown do not convert atx-style headers correctly
unless they are surrounded by blank lines.  This commit adds blank lines
to increase chances of rendering when using those variants while still
maintaining compatibly with variants that do not require the surrounding
blank lines.  Also increases readability when viewing the raw markdown
file.
2018-03-30 13:02:35 +00:00
Eric Putnam da5cad7cb1
(PDOC-228) puppet plans support
Currently, Puppet Strings only supports Puppet Tasks. Since Plans are
sort of connected to Tasks, it seemed right that Strings should also
support Plans. That and Plans are a thing that needs to be documented.

First, the Puppet[:tasks] setting needs to be set to add the 'plan' keyword to the Puppet Parser's lexicon, so this sets it in the Strings parser if the setting exists. If it does not exist and Puppet.version is less than 5.0.0, Strings will error out.

Second, processing for the Plans themselves is set up. Plans are very
similar to other Puppet objects like defined types and classes, so this
involved some serious copy-pasta.

Third, all the template/to_hash scaffolding for the different outputs is in place (HTML,
JSON, Markdown).

Yey.
2018-03-27 09:59:20 -07:00
Eric Putnam 738275b9e7
(PDOC-206) support for Puppet Tasks
Currently, puppet-strings does not know how to generate documentation
for Puppet Tasks. This does all the work to add support for Tasks
including a new JSON parser, a task handler, task statement, and task code
object. Basically, Strings reads the JSON using the native ruby json
parser and sends values through in a way it understands. It is only
passing json key/value pairs through, nothing is happening with tags at
this time. You can now document Tasks and generate HTML, Markdown, or
JSON output.
2018-03-19 11:37:00 -07:00
Eric Putnam 6923d9e18c
(maint) update table of contents
The table_of_contents template was already too bulky and redundant and recognizing public and private components was only going to make it worse. This refactors the toc template and the toc class to use a generic outline for all components.
2018-02-26 13:10:30 -08:00
Eric Putnam 09a5d3e4ff
(maint) change template logic and add test 2018-02-22 16:07:39 -08:00
Eric Putnam 5a283c2212
(maint) do not display name if there is nothing to display
If there is a class, type, or function with no information documented but is pulled in by some fluke or tag we don't support, do not give it its own section
2018-02-22 11:21:06 -08:00
Eric Putnam cc7ffae3a5
(maint) add new resource api output for json_spec 2018-02-20 14:49:45 -08:00
Eric Putnam 4ea43e03aa
re-add test for Puppet 3 function 2018-02-16 10:57:12 -08:00
Eric Putnam 176d6d4d8c
(PDOC-184) refactoring because naming is hard 2018-02-12 16:11:52 -08:00
Eric Putnam f6cd3ff4a8
(PDOC-184) implemented option and raises tags
This implements the two remaining tags and removes the author tag. Had to do some deeper plumbing because options per function signature were not being passed along from YARD
2018-02-09 15:08:18 -08:00
Eric Putnam 56c24cc362
(PDOC-184) implement author tag
This implements the author tag. We also claim to support the 'raise' and 'option' tags, but I don't know that we need to. This also consolidates some code in base.rb and adds docs
2018-02-08 12:12:56 -08:00
Eric Putnam 1374b67da0
(PDOC-184) generate markdown
This change does a few things:
1. Fixes up new api handler to return the stuff we want
2. Adds all the logic to parse YARD registries into markdown
3. Adds templates for markdown
4. Changes Face cli to use a --format option that can be used for either
markdown or json
2018-02-07 14:04:19 -08:00
Will Hopper f8c5628b66 (PDOC-125) Update JSON schema to reflect addition of `signatures` 2016-11-14 13:22:42 -08:00
Will Hopper e4df165489 (PDOC-125) Update JSON tests for `signatures` key 2016-11-14 13:05:07 -08:00
Will Hopper c56d9c60a4 (PDOC-129) Include tags in overload objects when serialized as JSON
Previously, overload objects were not displaying their tags when
they had no docstring text. This was due to an issue in the overload
`to_hash` method, which prevented the tags from being serialized when
the dispatch had no top-level text. This commit updates that logic
so that the tags will always be included in the hash if they exist.
2016-11-14 11:45:45 -08:00
Will Hopper 36bc0dd98c (PDOC-135) Detect `return_type` calls in 4.x function dispatches
Previously, Strings ignored calls to `return_type` in Puppet 4.x API
function dispatches, preventing the return types of overloads from
being automatically determined. This commit adds a check for a node
with a `return_type` call and handles it properly.
2016-11-14 11:04:41 -08:00
Will Hopper be0e93e3d6 (maint) Update line number in fixture to fix specs 2016-10-11 16:49:36 -07:00
Will Hopper a5a3d6b48c (PDOC-95) Properly group and display multiple provider `defaultfor`s
Prior to this commit, strings did not properly handle providers
which had multiple related `defaultfor`s. In code, these are written
as comma-separated constraints. This commit updates strings' puppet
provider handler, as well as the template which generates HTML for
`defaultfor` statements.

Note that it was necessary to make a breaking change to the JSON
schema to accomodate multiple AND'ed defaults. Previously, provider
defaults were contained in a single key-value map. Now, they are
contained in an array of key-value lists, which allows multiple
constraints to be associated with each other.
2016-10-11 13:57:00 -07:00
Will Hopper 3af15ce4f1 (PDOC-88) Add tests for types and providers into acceptance 2016-09-30 15:08:19 -07:00
Will Hopper beb79d3a63 (PDOC-88) Add acceptance test for puppet functions 2016-09-30 13:39:09 -07:00
Peter Huene e5577e199c
(PDOC-63) Restore acceptance test to the spec directory.
Previously the acceptance test was implemented under the `spec` directory and
was moved out to a top level `acceptance` directory.

This broke the expected location for the node configuration files.

This commit puts the acceptance test back where it was previously.

Also fixes a failure in the test now that Markdown is the default markup
language used.
2016-09-16 15:42:00 -07:00
Peter Huene 9ba9b56306
(PDOC-63) Fix specs for Puppet versions less than 4.1.
The specs test functions written in the Puppet language in a few places, but
this feature is only supported in Puppet 4.1+.  This commit prevents these
specs from running if targeting older versions of Puppet.
2016-09-16 12:16:35 -07:00
Peter Huene cf77ef1379
(PDOC-63) Add specs to test the new implementation.
This commit adds specs to cover parts of the new implementation of Puppet
Strings.
2016-09-15 17:15:54 -07:00