Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1fb180c

Browse files
committed
Update Readme
1 parent 760c3ed commit 1fb180c

File tree

1 file changed

+30
-275
lines changed

1 file changed

+30
-275
lines changed

README.md

Lines changed: 30 additions & 275 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,26 @@
11
# Magento Developer Documentation
22

3-
Welcome! This site contains the latest Magento developer documentation for ongoing Magento 2.x releases. For additional information, see our [Contribution Guide](https://github.com/magento/devdocs/blob/master/.github/CONTRIBUTING.md).
4-
5-
## Contributors
6-
7-
Our goal is to provide the Magento community with comprehensive and quality technical documentation. We believe that to accomplish that goal we need experts from the community to share their knowledge with us and each other. We are thankful to all of our contributors for improving Magento documentation.
8-
9-
![](https://raw.githubusercontent.com/wiki/magento/magento2/images/dev_docs_contributors.png)
3+
This project contains the source code of the latest 2.1 Magento developer documentation archived.
4+
The resulting website is available at <https://commerce-docs.github.io/devdocs-archive/2.1/>.
105

116
# Building this site
127

13-
You can build this site locally in the following ways:
14-
15-
- [Installing the project dependencies locally](#build-using-jekyll) (Mac, Linux)
16-
17-
- [Using a Vagrant virtual machine](#build-using-vagrant) (Mac, Linux, Windows)
18-
- [Build DevDocs in Windows](#build-devdocs-in-windows) (Windows 7 & 10)
19-
20-
## Build using Jekyll
21-
228
For local builds, you need to install Ruby 2.4 or later.
239

2410
To check the Ruby version on your environment, run in your terminal:
2511

2612
```shell
27-
$ ruby -v
13+
ruby -v
2814
```
2915

30-
### Install the latest Ruby (if the Ruby version is less than 2.4)
31-
32-
**MacOS users**
33-
34-
1. Install Homebrew. See the [Homebrew site](https://brew.sh) for instructions.
35-
1. Use Homebrew to install the latest stable version of Ruby:
36-
37-
```
38-
$ brew install ruby
39-
```
40-
41-
**Unix, Windows, and other OS users**
42-
43-
See the [Ruby site](https://www.ruby-lang.org/en/documentation/installation) for instructions.
16+
See the [Ruby site](https://www.ruby-lang.org/en/documentation/installation) for installation instructions.
4417

4518
### Install Bundler
4619

4720
Install the [Bundler](https://bundler.io/) gem, which helps with Ruby dependencies:
4821

49-
```
50-
$ gem install bundler
22+
```sh
23+
gem install bundler
5124
```
5225

5326
Once you have completed preparing your environment, you can build locally and review the site in your browser.
@@ -56,263 +29,45 @@ Once you have completed preparing your environment, you can build locally and re
5629

5730
Clone or download the repository. The first time you are at the `devdocs` directory, run:
5831

59-
```
60-
$ bundle install
32+
```sh
33+
bundle install
6134
```
6235

6336
Once you have completed preparing your environment, you can build locally and review the site in your browser.
6437

65-
### To build locally:
66-
67-
#### Using rake
38+
### Build and preview locally
6839

6940
[rake](https://github.com/ruby/rake) is a native Ruby tool that helps to automate tasks.
7041

7142
1. Run the rake task that installs all required dependencies and starts the [Jekyll](https://jekyllrb.com/) server:
7243

73-
```
74-
$ rake preview
44+
```sh
45+
rake preview
7546
```
7647

7748
1. Press `Ctrl+C` in the serve terminal to stop the server.
7849

79-
If rake fails on your environment, generate the preview [using jekyll](#using-jekyll).
80-
81-
#### Using jekyll
82-
83-
1. The first time you are at the `devdocs` directory or when you need to pick up changes in `Gemfile.lock` dependencies (for example, theme changes), run:
84-
85-
```
86-
$ bundle install
87-
```
88-
89-
1. To generate the local preview, run:
90-
91-
```
92-
$ bundle exec jekyll serve --incremental
93-
94-
Configuration file: /Users/username/Github/devdocs/_config.yml
95-
Source: /Users/username/Github/devdocs
96-
Destination: /Users/username/Github/devdocs/_site
97-
Incremental build: enabled
98-
Generating...
99-
done in x.x seconds.
100-
Auto-regeneration: enabled for '/Users/username/Github/devdocs'
101-
Server address: http://127.0.0.1:4000//
102-
Server running... press ctrl-c to stop.
103-
```
104-
105-
1. Use the **Server address** URL `http://127.0.0.1:4000/` in a browser to preview the content.
106-
107-
1. Press `Ctrl+C` in the serve terminal to stop the server.
108-
109-
> ***TIP***
110-
> Leave the serve terminal open and running. Every time you save changes to a file, it automatically regenerates the site so you can test the output immediately. Changing the `_config.yml` file requires a fresh build. Using the `--incremental` option limits re-builds to posts and pages that have changed.
111-
112-
### To minimize build time locally:
113-
114-
1. Create a `_config.local.yml` file at the root of the project directory and exclude all versions except the one that you want to preview.
115-
The following example will generate Magento 2.2 documentation only.
116-
117-
```yaml
118-
exclude:
119-
- /community/
120-
- /swagger/
121-
- /vagrant/
122-
- /guides/m1x/
123-
- /guides/v2.0/
124-
- /guides/v2.1/
125-
# - /guides/v2.2/
126-
- /guides/v2.3/
127-
128-
# Excluded in config.yml
129-
- /scss/
130-
- /bin/
131-
- /node_modules/
132-
- /vendor/
133-
- /.*
134-
- /Rakefile
135-
```
136-
137-
1. Run the preview command:
138-
139-
```
140-
$ rake preview
141-
```
142-
This command:
143-
* Checks your environment according to the dependencies in `Gemfile.lock`.
144-
* Removes the `_site/` directory, which contains previously generated preview files.
145-
* Generates a new preview and opens the landing page in a web browser.
146-
147-
If you don't have the `_config.local.yml` file at the root of your `devdocs/` directory, the rake will generate all versions of the documentation.
148-
149-
### To build v2.0 documentation
150-
151-
Magento 2.0.18 was the final 2.0.x release. After March 2018, Magento 2.0.x stopped receiving security patches, quality fixes, and documentation updates.
152-
153-
To ensure the quality of our public documentation for versions of Magento that are still supported and to avoid potential confusion about 2.0.x support, we removed all 2.0.x content from our public documentation websites on May 31, 2019.
154-
155-
To build v2.0 documentation:
156-
157-
> Also, you can use the GitHub interface to read the source Markdown files instead of building the site locally. Navigate to the [`2.0`](https://github.com/magento/devdocs/tree/2.0) branch and click the file you want to view.
158-
159-
1. Add an entry for 2.0 in the `Docfile.yml` file.
160-
161-
```yaml
162-
-
163-
directory: guides/v2.0
164-
repository: magento/devdocs
165-
branch: 2.0
166-
filter: false
167-
```
168-
169-
1. Initialize the `2.0` branch in your local devdocs repository.
170-
171-
```shell
172-
rake init
173-
```
50+
If rake fails on your environment, generate the preview using jekyll.
17451

175-
1. Run the preview command.
52+
## Build and deploy (for admins)
17653

177-
```shell
178-
rake preview
179-
```
54+
The website is deployed using the [GitHub Pages](https://pages.github.com/) service.
55+
The builds are pushed to the 2.1 directory at the gh-pages branch.
18056

181-
## Build using Vagrant
57+
To build and deploy the website, run:
18258

183-
You can deploy the devdocs site locally using [this Vagrant project](https://github.com/commerce-docs/vagrant-for-magento-devdocs).
184-
185-
***
186-
187-
If you have questions, open an issue and ask us. We're looking forward to hearing from you!
188-
189-
* <a href="https://twitter.com/MagentoDevDocs" class="twitter-follow-button" data-show-count="false">Follow @MagentoDevDocs</a>
190-
191-
* <a href="mailto:[email protected]">E-mail us</a>
192-
193-
* <a href="https://devdocs.magento.com">Visit our documentation site</a>, built using [GitHub pages](https://pages.github.com/).
194-
195-
## Build DevDocs in Windows
196-
197-
Some of the technologies we use to develop DevDocs is not compatible with Windows, such as [Jekyll](https://jekyllrb.com/docs/windows/). For this reason, we do not support DevDocs management in Windows; however, we have documented the following procedures to build the DevDocs in a Windows environment. Any further use of this setup or troubleshooting is up to you.
198-
199-
Download software:
200-
201-
- [Git for Windows](https://gitforwindows.org)
202-
- [Chocolatey](https://chocolatey.org/install)
203-
204-
### Install Chocolatey
205-
206-
Only Administrators can use Chocolatey features. You can use the Administrator account, or you can use the "Run as Administrator" function on the shortcut menu.
207-
208-
1. Open the **Command Prompt** using **Run as Administrator** in the shortcut menu.
209-
210-
1. [Install Chocolatey](https://chocolatey.org/install).
211-
212-
```cmd
213-
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
214-
```
215-
216-
1. Verify Chocolatey was added to the environment variables:
217-
218-
- In the Windows UI, open search and type `path`.
219-
- In the Windows CMD console, type `echo %path%`.
220-
221-
You should see `C:\ProgramData\chocolatey\bin` in the path.
222-
223-
1. Close and reopen the command prompt before using `choco` commands.
224-
225-
After running the script at the command line, you can install any required extensions. Chocolately has many extensions available, similar to Homebrew for MacOS. As a best practice, only use extensions labeled as a "trusted package". You can install editors, such as Nano and Notepad++, using Chocolatey, as well.
226-
227-
#### Install Ruby extension
228-
229-
If you have Ruby installed on the workstation, then you can skip this installation.
230-
231-
1. Open the **Command Prompt** using **Run as Administrator** in the shortcut menu.
232-
233-
1. Install the ruby extension:
234-
235-
```cmd
236-
choco install ruby
237-
```
238-
239-
1. Verify the environment variables were added properly:
240-
241-
- In the Windows UI, open search and type `path`.
242-
- In the Windows CMD console, type `echo %path%`.
243-
244-
> **NOTE**
245-
> If you encounter problems with Ruby, or the `gem` command is not recognized, you can install the `rubyinstaller-devkit.exe` development kit located in the `c:\ProgramData\chocolatey\bin` folder.
246-
247-
### Install Git for Windows
248-
249-
Use Git for Windows to prevent interference with the existing Windows environment and to have _Git Bash_ and _Git GUI_ launch commands available on the shortcut menu.
250-
251-
Open the Git Setup file downloaded from the Git for Windows site and use the following settings during installation wizard:
252-
253-
- select **Use Git from Git Bash only**
254-
- select **Checkout as-is, commit Unix-style line endings**
255-
- select your preferred editor (can use Nano, Notepad++, or VIM)
256-
- select **Enable symbolic links**
257-
258-
Although you can install Git using Chocolatey, we chose to install _Git for Windows_ independently for more control of the installation settings.
259-
260-
#### Set up SSH key
261-
262-
1. Open Git Bash. The **Git Bash** executable is on the shortcut menu.
263-
264-
1. Create a working directory for your Git repositories and change to the new directory.
265-
266-
```bash
267-
mkdir <directory-name>
268-
```
269-
270-
1. Follow the [Generating a new SSH](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) instructions.
271-
272-
273-
### Clone and build the DevDocs repository
274-
275-
You may have to close and reopen the Git Bash application after the Choco installations.
276-
277-
1. Open Git Bash. The **Git Bash** executable is on the shortcut menu.
278-
279-
1. Change to the directory you created for Git repositories and clone the DevDocs repository.
280-
281-
```bash
282-
git clone [email protected]:magento/devdocs.git
283-
```
284-
285-
1. Change to the `devdocs` directory.
286-
287-
1. Install [Bundler](https://bundler.io).
288-
289-
```bash
290-
gem install bundle
291-
```
292-
293-
1. Install gem executables required for building the site.
294-
295-
```bash
296-
bundle install
297-
```
298-
299-
1. Build site.
300-
301-
```bash
302-
bundle exec jekyll serve
303-
```
304-
305-
```terminal
306-
Configuration file: C:/Users/Administrator/mage/devdocs/_config.yml
307-
Source: C:/Users/Administrator/mage/devdocs
308-
Destination: C:/Users/Administrator/mage/devdocs/_site
309-
Incremental build: disabled. Enable with --incremental
310-
Generating...
311-
done in 643.551 seconds.
312-
Auto-regeneration: enabled for 'C:/Users/Administrator/mage/devdocs'
313-
Server address: http://127.0.0.1:4000/
314-
Server running... press ctrl-c to stop.
315-
```
59+
```sh
60+
rake build_and_deploy
61+
```
31662

317-
> **NOTE**
318-
> The `.bash_profile` file CAN be created and managed using Git Bash, which is useful for aliases and other customizations, This file is in the `users/Administrator` folder.
63+
The command performs the following actions:
64+
65+
1. Clears the _site directory.
66+
1. Builds the website with the base URL `devdocs-archive/2.1`.
67+
1. Remembers the number of commit that's been built to use later in a commit message for reference.
68+
1. Checkouts the gh-pages branch.
69+
1. Copies the content of the _site directory to the 2.1 directory.
70+
The \_site directory is ignored by git that makes the build from the archived-docs-v2.1 available in the gh-pages branch.
71+
1. Adds and commits the changes with the message that has reference to the commit of the built source code (see item 3 in this list).
72+
1. Pushes the commit to the remote repository.
73+
1. Checkouts back to the source code branch.

0 commit comments

Comments
 (0)