Commit Graph

126 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
willmeek d4e743dbad
Merge pull request #175 from eputnam/pdoc238
(PDOC-238) add generated message to markdown
2018-04-23 16:33:46 +01:00
willmeek 8ce914ee71
Merge pull request #176 from eputnam/pdoc36
(PDOC-36) fix hack for README urls
2018-04-23 16:33:31 +01:00
Eric Putnam 5d2c4411ca
(PDOC-36) fix hack for README urls
Discovered that this hack was finding broken links and then replacing all instances of the link text in the README. This led to a lot of non-links being affected. This patch works harder to match only actual links and works as far as I can tell.
2018-04-23 16:06:29 +01: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 9a1a0b4af6
(PDOC-240) add handling for :array node type in rsapi_handler
The 'features' key in the resource api expects an array of feature names. Currently, if you run strings on a resource api type that specifies features, it falls over because it doesn't know what to do with an AST node of type :array. Further, the method that throws the error is looking for an undefined variable called 'parameters'. This removes the odd conditional that calls 'parameters' and adds a method that returns an array of the array contents that may be passed to features. Features are not currently sent to the renderer, but now Strings will be able to handle any array it comes across in an rsapi type.
2018-04-20 15:06:58 +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
Hunter Haugen 6eec1544f7
Merge pull request #168 from eputnam/_pdoc228
(PDOC-228) puppet plan support
2018-03-29 10:22:50 -07:00
Eric Putnam baf000b07e
(PDOC-229) fix error with return_type and @return
Currently, if the user is documenting a Puppet 4 type custom function and they try to use the return_type method without also including an @return tag, Strings will throw an error. This is caused by the function handler trying to add a type to a return tag on the function object that doesn't exist. To fix the problem, if you are using return_type, the handler will now add an empty return tag first if one does not exist.
2018-03-29 08:48:52 -07: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
Hunter Haugen e37c8b70ae
Merge pull request #167 from eputnam/pdoc36
(PDOC-36) hack to fix README links in generated HTML
2018-03-26 17:03:39 -07:00
Eric Putnam c56ee788b5
(PDOC-192) remove warning for title/name
Currently, if a user attempts to document the title or name params, Strings will throw a warning saying that these parameters are missing from the class/type. Of course, they aren't, they just may not be explicit. This removes the warning if the param name is 'name' or 'title'.
2018-03-22 16:07:24 -07:00
Eric Putnam 37cfe49f95
(PDOC-36) hack to fix README links in generated HTML 2018-03-22 15:39:38 -07:00
Hunter Haugen 67f249c8ea
Merge pull request #164 from eputnam/update_travis
(PDOC-223) prepare travis for dropping old version support
2018-03-22 13:35:29 -07:00
Eric Putnam be444fa6ad
(PDOC-223) revert rsapi changes and remove markdown test
First, there were some rspec problems we originally connected to directory naming (e.g. 'yard'), but now we think it's a possible bug in rspec (https://github.com/rspec/rspec-core/issues/2184). this removes the markdown_spec.rb test that was both triggering the bug and, as it turns out, is an unnecessary test.

Reverted some of the changes made to the rsapi handler during markdown
output work. Those changes were made because of a typo in the spec
tests, so the typo has been fixed and most of the handler returned to
its original state.
2018-03-22 11:35:37 -07:00
Eric Putnam 2a5d23f82b
(PDOC-223) prepare travis for dropping old version support
This gets rid of test cells for old versions of ruby (< 2.1.9) and old versions of puppet (< 4) and also updates the test command to run all 100+ unit tests instead of a whopping 27 that rake spec runs
2018-03-22 11:34:19 -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
Ewoud Kohl van Wijngaarden 9728d1004a
(PDOC-224) Handle --emit-json(-stdout) again 2018-03-01 18:28:48 +01:00
Hunter Haugen 378c01a719
Merge pull request #157 from eputnam/pdoc-184_2
(maint) do not display name if there is nothing to display
2018-02-26 14:13:31 -08:00
Eric Putnam 65bfdaf1de
remove displayed tag business 2018-02-26 13:50:19 -08: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
Eugene Piven 4db84c81e5 Fix return type matching for Puppet functions 2018-02-23 13:56:55 +03: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
Hunter Haugen 7dff75642b
Merge pull request #156 from eputnam/pdoc184
(PDOC-184) generate markdown
2018-02-20 15:28:34 -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 db88cd9857
(PDOC-184) custom_type back to resource_type 2018-02-16 09:29:50 -08:00
Eric Putnam 840dfca1bc
Merge pull request #152 from DavidS/codecov
Enable code coverage tracking
2018-02-14 08:59:09 -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
Eric Putnam 59aa812cda
Merge pull request #153 from DavidS/pdk-437-rsapi-types
(PDK-437) Add support for Resource API types
2018-02-02 09:41:23 -08:00
Eric Putnam ad35df8f89
yard is smarter now?
On the changed line, YARD thought the bin path given was a regex and was interpretting it as such. It is not a regex.
2018-01-29 16:07:57 -08:00
David Schmitt 5156e8db10 (PDK-437) Add support for Resource API types 2018-01-29 16:17:30 +00:00
David Schmitt 8364b8e685 Enable code coverage tracking 2018-01-26 14:09:20 +00:00
Jesse Scott e4ef0ed2f8 (MAINT) Fix up rubocop settings and clean up inconsistent indentation 2017-10-20 14:37:28 -07:00
Will Hopper 4990576f61 (PDOC-161) Add `summary` tag for short descriptions
This tag is primarily meant to be applied to Puppet classes,
but it is also supported by every other construct that can be
documented with strings.
2017-03-16 12:51:53 -07:00
Eric Thompson 7bc5fb7f7f (PDOC-144) acceptance: fix windows pre-suite
* install the correct CAs in the correct places so windows can install gems
* use a gem_command abstraction to find the correct puppet gem exe

[skip ci]
2017-02-07 00:35:33 +00:00
Will Hopper 2d0a1f0c70 (maint) Put provider command in quotes in JSON test 2017-01-10 13:59:41 -08:00
Will Hopper 165170c08b (PDOC-155) Allow type documentation in Puppet 4 code
Because Puppet 4 is typed, parameter type information can
be automatically determined without any explicit documentation
in @param tags. However, users may desire to do so anyway for
consistency. This commit allows @param tags to include a [type]
in Puppet 4 code. Strings will emit a warning if the documented
type does not match the actual type. In such an event, the incorrect
documented type will be ignored in favor of the real one.
2017-01-10 13:59:38 -08:00
Will Hopper bb9db53702 (PDOC-125) Update JSON acceptance test with signatures changes 2016-11-15 11:01:12 -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