From c7033712b990d020a69f122ce01b255d21f6fb08 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 12 Dec 2015 05:07:36 +0100 Subject: [PATCH] fixed some code highlighting tags in the guide to match better the languages in highlight.js --- docs/guide-ja/tutorial-i18n.md | 6 +++--- docs/guide/start-installation.md | 26 ++++++++++++++++---------- docs/guide/tutorial-i18n.md | 8 ++++---- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/docs/guide-ja/tutorial-i18n.md b/docs/guide-ja/tutorial-i18n.md index 01e9324711..a74e3e90ae 100644 --- a/docs/guide-ja/tutorial-i18n.md +++ b/docs/guide-ja/tutorial-i18n.md @@ -703,19 +703,19 @@ class TranslationEventHandler './yii message/config' コマンドを使って、CLI 経由で、指定したオプションを持つ設定ファイルを動的に生成することも可能です。 例えば、`languages` と `messagePath` のパラメータは、次のようにして設定することが出来ます。 -```shell +```bash ./yii message/config --languages=de,ja --messagePath=messages path/to/config.php ``` 利用可能なオプションのリストを取得するためには、次のコマンドを実行します。 -```shell +```bash ./yii help message/config ``` 構成情報ファイルの編集が完了すれば、ついに、下記のコマンドを使ってメッセージを抽出することが出来ます。 -```shell +```bash ./yii message path/to/config.php ``` diff --git a/docs/guide/start-installation.md b/docs/guide/start-installation.md index a02f0e3827..d8f720168e 100644 --- a/docs/guide/start-installation.md +++ b/docs/guide/start-installation.md @@ -24,8 +24,10 @@ Installing via Composer If you do not already have Composer installed, you may do so by following the instructions at [getcomposer.org](https://getcomposer.org/download/). On Linux and Mac OS X, you'll run the following commands: - curl -sS https://getcomposer.org/installer | php - mv composer.phar /usr/local/bin/composer +```bash +curl -sS https://getcomposer.org/installer | php +mv composer.phar /usr/local/bin/composer +``` On Windows, you'll download and run [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe). @@ -37,8 +39,10 @@ by running `composer self-update`. With Composer installed, you can install Yii by running the following commands under a Web-accessible folder: - composer global require "fxp/composer-asset-plugin:~1.1.1" - composer create-project --prefer-dist yiisoft/yii2-app-basic basic +```bash +composer global require "fxp/composer-asset-plugin:~1.1.1" +composer create-project --prefer-dist yiisoft/yii2-app-basic basic +``` The first command installs the [composer asset plugin](https://github.com/francoispluchino/composer-asset-plugin/) which allows managing bower and npm package dependencies through Composer. You only need to run this command @@ -51,7 +55,9 @@ once for all. The second command installs Yii in a directory named `basic`. You > Tip: If you want to install the latest development version of Yii, you may use the following command instead, > which adds a [stability option](https://getcomposer.org/doc/04-schema.md#minimum-stability): > -> composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic +> ```bash +> composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic +> ``` > > Note that the development version of Yii should not be used for production as it may break your running code. @@ -94,14 +100,14 @@ After installation is done, either configure your web server (see next section) [built-in PHP web server](https://secure.php.net/manual/en/features.commandline.webserver.php) by running the following console command while in the project `web` directory: -``` +```bash php yii serve ``` > Note: By default the HTTP-server will listen to port 8080. However if that port is already in use or you wish to serve multiple applications this way, you might want to specify what port to use. Just add the --port argument: -``` +```bash php yii serve --port=8888 ``` @@ -119,7 +125,7 @@ Yii's requirements. You can check if the minimum requirements are met using one * Copy `/requirements.php` to `/web/requirements.php` and then use a browser to access it via `http://localhost/requirements.php` * Run the following commands: - ``` + ```bash cd basic php requirements.php ``` @@ -161,7 +167,7 @@ the [Shared Hosting Environment](tutorial-shared-hosting.md) section for more de Use the following configuration in Apache's `httpd.conf` file or within a virtual host configuration. Note that you should replace `path/to/basic/web` with the actual path for `basic/web`. -``` +```apache # Set document root to be "basic/web" DocumentRoot "path/to/basic/web" @@ -185,7 +191,7 @@ To use [Nginx](http://wiki.nginx.org/), you should install PHP as an [FPM SAPI]( You may use the following Nginx configuration, replacing `path/to/basic/web` with the actual path for `basic/web` and `mysite.local` with the actual hostname to serve. -``` +```nginx server { charset utf-8; client_max_body_size 128M; diff --git a/docs/guide/tutorial-i18n.md b/docs/guide/tutorial-i18n.md index 385c598e42..ded0f01933 100644 --- a/docs/guide/tutorial-i18n.md +++ b/docs/guide/tutorial-i18n.md @@ -635,7 +635,7 @@ Translations can be stored in [[yii\i18n\PhpMessageSource|php files]], [[yii\i18 First of all you need to create a configuration file. Decide where you want to store it and then issue the command -```shell +```bash ./yii message/config-template path/to/config.php ``` @@ -647,19 +647,19 @@ Open the created file and adjust the parameters to fit your needs. Pay special a You may also use './yii message/config' command to dynamically generate configuration file with specified options via cli. For example, you can set `languages` and `messagePath` parameters like the following: -```shell +```bash ./yii message/config --languages=de,ja --messagePath=messages path/to/config.php ``` To get list of available options execute next command: -```shell +```bash ./yii help message/config ``` Once you're done with the configuration file you can finally extract your messages with the command: -```shell +```bash ./yii message path/to/config.php ```