Skip to content

[Console] Improve markdown format #20866

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

Merged
merged 1 commit into from
Dec 13, 2016
Merged

[Console] Improve markdown format #20866

merged 1 commit into from
Dec 13, 2016

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Dec 11, 2016

Q A
Branch? "master"
Bug fix? no
New feature? no
BC breaks? not sure?
Deprecations? no
Tests pass? yes
Fixed tickets comma-separated list of tickets fixed by the PR, if any
License MIT
Doc PR reference to the documentation PR, if any

This improves the markdown description for a console application. To make the ouput read more friendly and intuitively (less bloated IMHO).

Before:

Markdown files in https://github.com/symfony/symfony/tree/master/src/Symfony/Component/Console/Tests/Fixtures

After:

Markdown files in https://github.com/ro0NL/symfony/tree/console/markdown/src/Symfony/Component/Console/Tests/Fixtures

@ogizanagi
Copy link
Contributor

ogizanagi commented Dec 11, 2016

👍

To me it isn't a BC break, because the markdown format is not something meant to be analyzed programmatically and only intends to provide a quick documentation of the console application (I'm not even sure it'll be considered as a BC break for json actually, nor any format produced by a command is part of the BC promise).

Status: Reviewed

@javiereguiluz
Copy link
Member

@ogizanagi I agree that this should't be considered a BC. By the way, a while ago I thought about opening a RFC issue to discuss about removing this feature. Do people really use this Markdown descriptor?

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 11, 2016

It's nice API doc for a command. Ie. i would use this to generate a README.md for a command repo.

@ogizanagi
Copy link
Contributor

ogizanagi commented Dec 11, 2016

I think it's an easy way to provide a minimalistic documentation for a tool and it is worth keeping it.

I don't see as much utility for the json/xml descriptors though. I don't know what usages it deserves. Someone may try to implement a UI by parsing programmatically those formats, or maybe it can be consumed by generic worker in order to know which command to use and how to call it, but I never seen someone doing nor asking for this.

@fabpot
Copy link
Member

fabpot commented Dec 11, 2016

Guys, before discussing removing something, you should assume that it was added for a reason :) The XML format is used by tools like IDEs to get information about available commands to provide a nice UI for instance.

@javiereguiluz
Copy link
Member

javiereguiluz commented Dec 11, 2016

Yes, the XML export is useful for those cases. But what about the Markdown export?

@fabpot
Copy link
Member

fabpot commented Dec 11, 2016

IIRC, the Markdown format has been added quite recently. So, let's dig a bit into the past PRs to see why it was added.

@ogizanagi
Copy link
Contributor

ogizanagi commented Dec 11, 2016

All formats were added in the same PR by @jfsimon: #7454 ^^

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 11, 2016

This PR only tends to improve what we already have :) (application_2.md goes from 376 to 350 lines btw).

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 11, 2016

What about removing Is value required if an option accepts no value?

@nicolas-grekas nicolas-grekas added this to the 3.x milestone Dec 12, 2016
@fabpot
Copy link
Member

fabpot commented Dec 13, 2016

Thank you @ro0NL.

@fabpot fabpot merged commit 302a19d into symfony:master Dec 13, 2016
fabpot added a commit that referenced this pull request Dec 13, 2016
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Improve markdown format

| Q             | A
| ------------- | ---
| Branch?       | "master"
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | not sure?
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

This improves the markdown description for a console application. To make the ouput read more friendly and intuitively (less bloated IMHO).

Before:

Markdown files in https://github.com/symfony/symfony/tree/master/src/Symfony/Component/Console/Tests/Fixtures

After:

Markdown files in https://github.com/ro0NL/symfony/tree/console/markdown/src/Symfony/Component/Console/Tests/Fixtures

Commits
-------

302a19d [Console] Improve markdown format
@javiereguiluz
Copy link
Member

I was late to this PR, but I was just about to propose the following improvements.

This is how an app description looks like:

before

And here are some comments:

after

@fabpot
Copy link
Member

fabpot commented Dec 13, 2016

If the commands are hidden, I think they should not be part of the Mardown format but still be listed in the JSON or XML formats. The idea is that end users should not see them but machines should. 👍 for your other suggestions.

@ro0NL
Copy link
Contributor Author

ro0NL commented Dec 13, 2016

I believe hidden commands are already skipped indeed.

The application version is actually included now in the markdown title (ref, ref2), it wasnt before. However the default version (UNKNOWN) is not shown.

I think we're good :)

@ro0NL ro0NL deleted the console/markdown branch December 13, 2016 08:52
fabpot added a commit that referenced this pull request Jan 4, 2017
…rs (ogizanagi)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Show hidden commands in json & xml descriptors

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no (may be considered, but as hidden commands did not exist before 3.2, looks more like a behavior change, hence a feature)
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20866 (comment)
| License       | MIT
| Doc PR        | N/A

Commits
-------

b6cf240 [Console] Show hidden commands in json & xml descriptors
symfony-splitter pushed a commit to symfony/console that referenced this pull request Jan 4, 2017
…rs (ogizanagi)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Show hidden commands in json & xml descriptors

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no (may be considered, but as hidden commands did not exist before 3.2, looks more like a behavior change, hence a feature)
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony#20866 (comment)
| License       | MIT
| Doc PR        | N/A

Commits
-------

b6cf240ab5 [Console] Show hidden commands in json & xml descriptors
@nicolas-grekas nicolas-grekas modified the milestone: 3.x Mar 24, 2017
@fabpot fabpot mentioned this pull request May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants