-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --format option to docs command #6982
Conversation
@@ -28,7 +28,7 @@ class Crystal::Doc::Generator | |||
}, | |||
} | |||
|
|||
def initialize(@program : Program, @included_dirs : Array(String), @output_dir : String, @canonical_base_url : String?) | |||
def initialize(@program : Program, @included_dirs : Array(String), @output_dir : String, @output_format : String, sss @canonical_base_url : String?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sss
? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, typo
src/compiler/crystal/command/docs.cr
Outdated
@@ -4,7 +4,10 @@ | |||
# is in `crystal/tools/doc/` | |||
|
|||
class Crystal::Command | |||
private VALID_OUTPUT_FORMATS = ["html", "json"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pedantic: %w(html json)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really an improvement, just a different way to express this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid duplicate in the logic to grab the content of the readme file.
There is also interest in allowing the use to use other file than readme as initial doc content.
Should I skip the generation of |
That would require to change the JavaScript for loading the docs. Currently, it loads
You can tackle it right now or leave that for a new PR. |
I'd prefer to handle it in another PR |
@mniak It would be good to add "to docs command" in the title since it's not clear now what's this option is about. Also please change "Solves the issue" to "Fixes" or "Closes" since these two are the keywords used by GH to auto-close issues. |
@Sija thanks for these tips |
@bcardiff I tried to follow your tip avoiding duplicate the logic to grab the content of the readme file. |
@bcardiff ping |
Merging this broke master :( |
A conflict with the specs added during #7063 |
Fixes #2772
#2772 (comment)