Skip to content

Commit 18487ea

Browse files
authored
Merge pull request #7757 from kenjis/docs-console-command
docs: remove `>` in console command
2 parents c56edf2 + a6acb4f commit 18487ea

32 files changed

+345
-170
lines changed

contributing/documentation.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,16 @@ As a general rule, we use ``**`` for in-line file paths, and `````` for source c
171171
E.g.::
172172

173173
Open the **app/Config/Filters.php** file and update the ``$methods`` property like the following:
174+
175+
**********
176+
Code Block
177+
**********
178+
179+
CLI Command
180+
===========
181+
182+
::
183+
184+
.. code-block:: console
185+
186+
php spark migrate

user_guide_src/source/_static/css/citheme.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(
241241
margin-top: 2rem;
242242
}
243243

244+
.highlight-console .highlight {
245+
background-color: #fffff0;
246+
}
247+
244248
/* Messages ----------------------------------------------------------------- */
245249

246250
.rst-content .success {

user_guide_src/source/_static/css/citheme_dark.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,8 @@
343343
.highlight .ni {
344344
color: #b780b7;
345345
}
346+
347+
.highlight-console .highlight pre {
348+
background: #434343;
349+
}
346350
}

user_guide_src/source/cli/cli_commands.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ run()
6565
-----
6666

6767
The ``run()`` method is the method that is called when the command is being run. The ``$params`` array is a list of
68-
any CLI arguments after the command name for your use. If the CLI string was::
68+
any CLI arguments after the command name for your use. If the CLI string was:
6969

70-
> php spark foo bar baz
70+
.. code-block:: console
71+
72+
php spark foo bar baz
7173
7274
Then **foo** is the command name, and the ``$params`` array would be:
7375

user_guide_src/source/cli/cli_generators.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ Introduction
1414
************
1515

1616
All built-in generators reside under the ``Generators`` group when listed using ``php spark list``.
17-
To view the full description and usage information on a particular generator, use the command::
17+
To view the full description and usage information on a particular generator, use the command:
1818

19-
> php spark help <generator_command>
19+
.. code-block:: console
20+
21+
php spark help <generator_command>
2022
2123
where ``<generator_command>`` will be replaced with the command to check.
2224

@@ -287,9 +289,11 @@ wrapper to the controller, model, entity, migration, and seeder generator comman
287289
name that will be used to name all the generated classes. Also, **individual options** supported by each
288290
generator command are recognized by the scaffold command.
289291

290-
Running this in your terminal::
292+
Running this in your terminal:
293+
294+
.. code-block:: console
291295
292-
> php spark make:scaffold user
296+
php spark make:scaffold user
293297
294298
will create the following files:
295299

user_guide_src/source/cli/cli_overview.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ The Spark Commands
3636

3737
CodeIgniter ships with the official command **spark** and built-in commands.
3838

39-
You can run the spark and see the help::
39+
You can run the spark and see the help:
4040

41-
> php spark
41+
.. code-block:: console
42+
43+
php spark
4244
4345
See the :doc:`spark_commands` page for detailed information.
4446

user_guide_src/source/cli/spark_commands.rst

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,66 +23,86 @@ Showing List of Commands
2323

2424
When called **spark** without specifying a command, a simple help page is displayed
2525
that also provides a list of available commands and their descriptions, sorted by
26-
categories::
26+
categories:
2727

28-
> php spark
28+
.. code-block:: console
29+
30+
php spark
2931
3032
spark list
3133
^^^^^^^^^^
3234

33-
``php spark`` is the exactly same as the ``list`` command::
35+
``php spark`` is the exactly same as the ``list`` command:
36+
37+
.. code-block:: console
3438
35-
> php spark list
39+
php spark list
3640
3741
You may also use the ``--simple`` option to get a raw list of all available commands,
38-
sorted alphabetically::
42+
sorted alphabetically:
43+
44+
.. code-block:: console
3945
40-
> php spark list --simple
46+
php spark list --simple
4147
4248
Showing Help
4349
------------
4450

45-
You can get help about any CLI command using the ``help`` command as follows::
51+
You can get help about any CLI command using the ``help`` command as follows:
52+
53+
.. code-block:: console
54+
55+
php spark help db:seed
4656
47-
> php spark help db:seed
57+
Since v4.3.0, you can also use the ``--help`` option instead of the ``help`` command:
4858

49-
Since v4.3.0, you can also use the ``--help`` option instead of the ``help`` command::
59+
.. code-block:: console
5060
51-
> php spark db:seed --help
61+
php spark db:seed --help
5262
5363
Running a Command
5464
-----------------
5565

56-
You should pass the name of the command as the first argument to run that command::
66+
You should pass the name of the command as the first argument to run that command:
5767

58-
> php spark migrate
68+
.. code-block:: console
5969
60-
Some commands take additional arguments, which should be provided directly after the command, separated by spaces::
70+
php spark migrate
6171
62-
> php spark db:seed DevUserSeeder
72+
Some commands take additional arguments, which should be provided directly after the command, separated by spaces:
73+
74+
.. code-block:: console
75+
76+
php spark db:seed DevUserSeeder
6377
6478
For all of the commands CodeIgniter provides, if you do not provide the required arguments, you will be prompted
65-
for the information it needs to run correctly::
79+
for the information it needs to run correctly:
80+
81+
.. code-block:: console
6682
67-
> php spark make:controller
83+
php spark make:controller
6884
6985
Controller class name :
7086
7187
Suppressing Header Output
7288
-------------------------
7389

7490
When you run a command, the header with CodeIgniter version and the current time
75-
is output::
91+
is output:
7692

77-
> php spark env
93+
.. code-block:: console
94+
95+
php spark env
7896
7997
CodeIgniter v4.3.5 Command Line Tool - Server Time: 2023-06-16 12:45:31 UTC+00:00
8098
8199
Your environment is currently set as development.
82100
83-
You may always pass ``--no-header`` to suppress the header output, helpful for parsing results::
101+
You may always pass ``--no-header`` to suppress the header output, helpful for parsing results:
102+
103+
.. code-block:: console
84104
85-
> php spark env --no-header
105+
php spark env --no-header
86106
87107
Your environment is currently set as development.
88108

user_guide_src/source/concepts/autoloader.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ those classes can be found in:
5555
The key of each row is the namespace itself. This does not need a trailing back slash.
5656
The value is the location to the directory the classes can be found in.
5757

58-
.. note:: You can check the namespace configuration by ``spark namespaces`` command::
58+
.. note:: You can check the namespace configuration by ``spark namespaces`` command:
5959

60-
> php spark namespaces
60+
.. code-block:: console
61+
62+
php spark namespaces
6163
6264
By default, the application directory is namespace to the ``App`` namespace. You must namespace the controllers,
6365
libraries, or models in the application directory, and they will be found under the ``App`` namespace.

user_guide_src/source/dbmgmt/db_commands.rst

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ db:table --show
1919
---------------
2020

2121
To list all the tables in your database straight from your favorite terminal,
22-
you can use the ``db:table --show`` command::
22+
you can use the ``db:table --show`` command:
2323

24-
> php spark db:table --show
24+
.. code-block:: console
25+
26+
php spark db:table --show
2527
2628
When using this command it is assumed that a table exists.
2729
Otherwise, CodeIgniter will complain that the database has no tables.
@@ -32,21 +34,27 @@ Retrieve Some Records
3234
db:table
3335
--------
3436

35-
When you have a table named ``my_table``, you can see the field names and the records of a table::
37+
When you have a table named ``my_table``, you can see the field names and the records of a table:
38+
39+
.. code-block:: console
3640
37-
> php spark db:table my_table
41+
.. code-block:: consolephp spark db:table my_table
3842
3943
If the table ``my_table`` is not in the database, CodeIgniter displays a list of available tables to select.
4044

41-
You can also use the following command without the table name::
45+
You can also use the following command without the table name:
46+
47+
.. code-block:: console
4248
43-
> php spark db:table
49+
php spark db:table
4450
4551
In this case, the table name will be asked.
4652

47-
You can also pass a few options::
53+
You can also pass a few options:
4854

49-
> php spark db:table my_table --limit-rows 50 --limit-field-value 20 --desc
55+
.. code-block:: console
56+
57+
php spark db:table my_table --limit-rows 50 --limit-field-value 20 --desc
5058
5159
The option ``--limit-rows 50`` limits the number of rows to 50 rows.
5260

@@ -60,9 +68,11 @@ Retrieve Field Metadata
6068
db:table --metadata
6169
-------------------
6270

63-
When you have a table named ``my_table``, you can see metadata like the column type, max length of the table with the ``--metadata`` option::
71+
When you have a table named ``my_table``, you can see metadata like the column type, max length of the table with the ``--metadata`` option:
72+
73+
.. code-block:: console
6474
65-
> php spark db:table my_table --metadata
75+
php spark db:table my_table --metadata
6676
6777
When using this command it is assumed that the table exists.
6878
Otherwise, CodeIgniter will show a table list to select.

user_guide_src/source/dbmgmt/forge.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,24 @@ CodeIgniter supports creating databases straight from your favorite terminal usi
6060
command. By using this command it is assumed that the database is not yet existing. Otherwise, CodeIgniter
6161
will complain that the database creation has failed.
6262

63-
To start, just type the command and the name of the database (e.g., ``foo``)::
63+
To start, just type the command and the name of the database (e.g., ``foo``):
6464

65-
> php spark db:create foo
65+
.. code-block:: console
66+
67+
php spark db:create foo
6668
6769
If everything went fine, you should expect the ``Database "foo" successfully created.`` message displayed.
6870

6971
If you are on a testing environment or you are using the SQLite3 driver, you may pass in the file extension
7072
for the file where the database will be created using the ``--ext`` option. Valid values are ``db`` and
7173
``sqlite`` and defaults to ``db``. Remember that these should not be preceded by a period.
72-
::
74+
:
75+
76+
.. code-block:: console
77+
78+
php spark db:create foo --ext sqlite
7379
74-
> php spark db:create foo --ext sqlite
75-
// will create the db file in WRITEPATH/foo.sqlite
80+
The above command will create the db file in **WRITEPATH/foo.sqlite**.
7681

7782
.. note:: When using the special SQLite3 database name ``:memory:``, expect that the command will still
7883
produce a success message but no database file is created. This is because SQLite3 will just use

0 commit comments

Comments
 (0)