Note: This is only a proof of concept and not entirely polished or working. Help would be appreciated :)
config =
[ ExtractDocsJson.rule
]
Maybe this is an interesting start for generating documentation for your project.
The target is to have something like this
that can be decoded using Elm.Docs.decoder.
Example output
[
{
"name": "Api.Endpoint",
"comment": "MISSING",
"unions": [
{
"name": "Endpoint",
"comment": "{-| Get a URL to the Conduit API.\n\nThis is not publicly exposed, because we want to make sure the only way to get one of these URLs is from this module.\n\n-}",
"args": [],
"cases": [
[
"Endpoint",
[
"String"
]
]
]
}
],
"aliases": [],
"values": [
{
"name": "tags",
"comment": "{-| The endpoint to get tags\n-}",
"type": "Endpoint"},
{
"name": "feed",
"comment": "MISSING",
"type": "List QueryParameter -> Endpoint"}
],
"binops": []
}
]
Try it out
You can try this rule out by running the following command:
Recreate
docs.json
for your project.Note: This is only a proof of concept and not entirely polished or working. Help would be appreciated :)
config = [ ExtractDocsJson.rule ]
Maybe this is an interesting start for generating documentation for your project.
The target is to have something like this that can be decoded using
Elm.Docs.decoder
.Example output
[ { "name": "Api.Endpoint", "comment": "MISSING", "unions": [ { "name": "Endpoint", "comment": "{-| Get a URL to the Conduit API.\n\nThis is not publicly exposed, because we want to make sure the only way to get one of these URLs is from this module.\n\n-}", "args": [], "cases": [ [ "Endpoint", [ "String" ] ] ] } ], "aliases": [], "values": [ { "name": "tags", "comment": "{-| The endpoint to get tags\n-}", "type": "Endpoint" }, { "name": "feed", "comment": "MISSING", "type": "List QueryParameter -> Endpoint" } ], "binops": [] } ]
Try it out
You can try this rule out by running the following command:
elm-review --template jfmengels/elm-review-random-insights/preview --report=json --extract | jq -r '.extracts.ExtractDocsJson'