Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Conversation

atwixfirster
Copy link
Contributor

Purpose of this PR

This PR adds bash syntax to command line examples.

Affected URLs

Thank you!

- https://devdocs.magento.com/guides/v2.1/cloud/cdn/configure-fastly.html
- https://devdocs.magento.com/guides/v2.2/cloud/cdn/configure-fastly.html
- https://devdocs.magento.com/guides/v2.3/cloud/cdn/configure-fastly.html
- https://devdocs.magento.com/guides/v2.1/cloud/howtos/sample-data.html
- https://devdocs.magento.com/guides/v2.2/cloud/howtos/sample-data.html
- https://devdocs.magento.com/guides/v2.3/cloud/howtos/sample-data.html
- https://devdocs.magento.com/guides/v2.1/cloud/live/live-sanity-check.html
- https://devdocs.magento.com/guides/v2.2/cloud/live/live-sanity-check.html
- https://devdocs.magento.com/guides/v2.3/cloud/live/live-sanity-check.html
- https://devdocs.magento.com/guides/v2.1/cloud/live/sens-data-initial.html
- https://devdocs.magento.com/guides/v2.2/cloud/live/sens-data-initial.html
- https://devdocs.magento.com/guides/v2.3/cloud/live/sens-data-initial.html
- https://devdocs.magento.com/guides/v2.1/cloud/trouble/redis-troubleshooting.html
- https://devdocs.magento.com/guides/v2.2/cloud/trouble/redis-troubleshooting.html
- https://devdocs.magento.com/guides/v2.3/cloud/trouble/redis-troubleshooting.html
- https://devdocs.magento.com/guides/v2.1/cloud/trouble/trouble-error-html-minification.html
- https://devdocs.magento.com/guides/v2.2/cloud/trouble/trouble-error-html-minification.html
- https://devdocs.magento.com/guides/v2.3/cloud/trouble/trouble-error-html-minification.html
- https://devdocs.magento.com/guides/v2.1/comp-mgr/trouble/cman/ce-ee-upgrade.html
- https://devdocs.magento.com/guides/v2.2/comp-mgr/trouble/cman/ce-ee-upgrade.html
- https://devdocs.magento.com/guides/v2.3/comp-mgr/trouble/cman/ce-ee-upgrade.html
- https://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-cache.html
- https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-cache.html
- https://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-compiler.html
- https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-compiler.html
- https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-compiler.html
- https://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-i18n.html
- https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-i18n.html
- https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-i18n.html
- https://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-spt-util.html
- https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-spt-util.html
- https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-spt-util.html
- https://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-static-view.html
- https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-static-view.html
- https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-static-view.html
- https://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-urn.html
- https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-urn.html
- https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-urn.html
- https://devdocs.magento.com/guides/v2.1/config-guide/prod/prod_file-sys-perms.html
- https://devdocs.magento.com/guides/v2.2/config-guide/prod/prod_file-sys-perms.html
- https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html
- https://devdocs.magento.com/guides/v2.1/config-guide/solr/solr-magento.html
- https://devdocs.magento.com/guides/v2.1/ext-best-practices/extension-coding/example-module-adminpage.html
- https://devdocs.magento.com/guides/v2.1/extension-dev-guide/cli-cmds/cli-naming-guidelines.html
- https://devdocs.magento.com/guides/v2.1/extension-dev-guide/prepare/lifecycle.html
- https://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-images.html
- https://devdocs.magento.com/guides/v2.1/install-gde/install/cli/dev_downgrade.html
- https://devdocs.magento.com/guides/v2.1/install-gde/install/cli/dev_update-magento.html
@rogyar rogyar self-assigned this Apr 17, 2019
@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

@dobooth
Copy link
Contributor

dobooth commented Apr 17, 2019

Nice.
A couple things:
If you have two+ commands in a row, they each get their own bash block, separated by a space of course. This ensures that the $ is added at the start of each line. Second: you can remove empty lines just after the bash.
Third: some of these code blocks are heavily indented. Pull them in where you can.
I didn't leave a comment on every instance, just as examples.

* In the "repositories" section, you should have:

```json
"fastly-magento2": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull in indenting in things like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

git push origin <branch name>
```bash
git add -A && git commit -m "Install sample data"
git push origin <branch name>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each gets its own ```bash block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


The following snippet from `config.local.php` shows an example of changing the default locale to `en_GB` and changing static file optimization settings:

```php
Copy link
Contributor

@dobooth dobooth Apr 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PRE tags are the old highlighting code. It should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap the code in a php block, and place this line immediately below the block
{: .no-copy }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

The following command adds, commits, and pushes to master:

git add app/etc/config.local.php && git commit -m "Add system-specific configuration" && git push origin master
```bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank line below and on the others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


php <your Magento install dir>/bin/magento setup:upgrade
```bash
php <your Magento install dir>/bin/magento setup:upgrade
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use <magento_root>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use <magento_root>

done


php bin/magento setup:upgrade && php bin/magento cache:clean
```bash
php bin/magento setup:upgrade && php bin/magento cache:clean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention is just bin/magento command...
You can remove the php from all these commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention is just bin/magento command...
You can remove the php from all these commands.

implemented

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The blanket PHP changes made can not apply to Cloud documentation. Some of those affect sample code for copy to YAML files and will cause errors without the "PHP". Please revert changes to Cloud documentation for PHP command.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The blanket PHP changes made can not apply to Cloud documentation. Some of those affect sample code for copy to YAML files and will cause errors without the "PHP". Please revert changes to Cloud documentation for PHP command.

reverted for Cloud documentation


git add -A; git commit -m "Install Fastly"; git push origin <branch name>
```bash
git add -A; git commit -m "Install Fastly"; git push origin <branch name>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would && be better here than ;?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would && be better here than ;?

implemented


Sample result:

```terminal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is terminal a correct alias for syntax highlight? I'm unable to find it in the linguist reference which is used by Github.
Maybe we should use bash in such cases as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use bash for commands because the CSS adds the $ to the line but it is not included when copying.
terminal will work and it is used to show the output/results of a command. It will not include the $ at the start of the line.

Copy link
Contributor

@hguthrie hguthrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all Cloud topics: Code blocks inside of steps need a 4-space indention with a blank line before and after the code block.

1. Replace <your Magento install dir> with <magento_root> regarding Donald Booth comment
1. Replace "php bin/magento" with "bin/magento" regarding Donald Booth comment
@atwixfirster
Copy link
Contributor Author

For all Cloud topics: Code blocks inside of steps need a 4-space indention with a blank line before and after the code block.

implemented

Thank you, @hguthrie !

cronrun:
spec: "* * * * *"
cmd: "php bin/magento cron:run"
cmd: "bin/magento cron:run"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are YAML file snippets and need the PHP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are YAML file snippets and need the PHP

reverted

cronrun:
spec: "* * * * *"
cmd: "php bin/magento cron:run"
cmd: "bin/magento cron:run"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PHP belongs in the YAML snippet


```bash
php bin/magento --version
bin/magento --version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested in Cloud, either way works

### 101.7.3 changes

<!--- MAGECLOUD-782 -->* Magento no longer throws an error when only the default store issued. Previously, when only the default store is used, Magento threw the following error when running `php bin/magento magento-cloud:scd-dump`:
<!--- MAGECLOUD-782 -->* Magento no longer throws an error when only the default store issued. Previously, when only the default store is used, Magento threw the following error when running `bin/magento magento-cloud:scd-dump`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't change old release notes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't change old release notes.

ok. Reverted 😊

@atwixfirster
Copy link
Contributor Author

Nice.
A couple things:
If you have two+ commands in a row, they each get their own bash block, separated by a space of course. This ensures that the $ is added at the start of each line. Second: you can remove empty lines just after the bash.
Third: some of these code blocks are heavily indented. Pull them in where you can.
I didn't leave a comment on every instance, just as examples.

done

Copy link
Contributor

@hguthrie hguthrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloud changes approved at this time.

@osrecio osrecio self-requested a review April 23, 2019 08:59
@jcalcaben
Copy link
Contributor

@dobooth is there an update for this?

Merge remote-tracking branch 'upstream/master' into format-bash

# Conflicts:
#	guides/v2.1/architecture/security_intro.md
#	guides/v2.2/cloud/configure/setup-b2b.md
@atwixfirster
Copy link
Contributor Author

@dobooth , could you please approve this PR ;)

Many thanks!

@dobooth
Copy link
Contributor

dobooth commented May 6, 2019

Oh sorry! Missed it.

@dobooth
Copy link
Contributor

dobooth commented May 6, 2019

running tests

@osrecio osrecio self-assigned this May 6, 2019
@dobooth dobooth merged commit 93604e2 into magento:master May 6, 2019
@ghost
Copy link

ghost commented May 6, 2019

Hi @atwixfirster, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@dobooth dobooth added 2.1.x 2.2.x 2.3.x Magento 2.3 related changes Major Update Significant original updates to existing content Special achievement High-value contributions that earn higher rewards and special attention Technical Updates to the code or processes that alter the technical content of the doc and removed Major Update Significant original updates to existing content labels May 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2.1.x 2.2.x 2.3.x Magento 2.3 related changes Partner: Atwix partners-contribution PR created by Magento partner Special achievement High-value contributions that earn higher rewards and special attention Technical Updates to the code or processes that alter the technical content of the doc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants