Build Merchant Documentation in Windows - ccondra/merchdocs GitHub Wiki
Some of the technologies we use to develop Merchant Documentation is not compatible with Windows, such as Jekyll. For this reason, we do not support Merchant Documentation management in Windows; however, we have documented the following procedures to build this site in a Windows environment. Any further use of this setup or troubleshooting is up to you.
Download software:
Install Chocolatey
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.
-
Open the Command Prompt using Run as Administrator in the shortcut menu.
-
@"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin"
-
Verify Chocolatey was added to the environment variables:
- In the Windows UI, open search and type
path
. - In the Windows CMD console, type
echo %path%
.
You should see
C:ProgramDatachocolateybin
in the path. - In the Windows UI, open search and type
-
Close and reopen the command prompt before using
choco
commands.
After running the script at the command line, you can install any required extensions. Chocolatey 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.
Install Ruby extension
If you have Ruby installed on the workstation, then you can skip this installation.
-
Open the Command Prompt using Run as Administrator in the shortcut menu.
-
Install the ruby extension:
choco install ruby
-
Verify the environment variables were added properly:
- In the Windows UI, open search and type
path
. - In the Windows CMD console, type
echo %path%
.
- In the Windows UI, open search and type
NOTE If you encounter problems with Ruby, or the
gem
command is not recognized, you can install therubyinstaller-devkit.exe
development kit located in thec:ProgramDatachocolateybin
folder.
Install Git for Windows
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.
Open the Git Setup file downloaded from the Git for Windows site and use the following settings during installation wizard:
- select Use Git from Git Bash only
- select Checkout as-is, commit Unix-style line endings
- select your preferred editor (can use Nano, Notepad++, or VIM)
- select Enable symbolic links
Although you can install Git using Chocolatey, we chose to install Git for Windows independently for more control of the installation settings.
Set up SSH key
-
Open Git Bash. The Git Bash executable is on the shortcut menu.
-
Create a working directory for your Git repositories and change to the new directory.
mkdir <directory-name>
-
Follow the Generating a new SSH instructions.
Clone and build the repository
You may have to close and reopen the Git Bash application after the Choco installations.
-
Open Git Bash. The Git Bash executable is on the shortcut menu.
-
Change to the directory you created for Git repositories and clone the MerchDocs repository.
git clone [email protected]:magento/merchdocs.git
-
Change to the
merchdocs
directory. -
Install Bundler.
gem install bundle
-
Install gem executables required for building the site.
bundle install
-
Build site.
bundle exec jekyll serve
Configuration file: C:/Users/Administrator/mage/merchdocs/_config.yml Source: C:/Users/Administrator/mage/merchdocs Destination: C:/Users/Administrator/mage/merchdocs/_site Incremental build: disabled. Enable with --incremental Generating... done in 643.551 seconds. Auto-regeneration: enabled for 'C:/Users/Administrator/mage/merchdocs' Server address: http://127.0.0.1:4000/ Server running... press ctrl-c to stop.
NOTE The
.bash_profile
file CAN be created and managed using Git Bash, which is useful for aliases and other customizations, This file is in theusers/Administrator
folder.)