Building laravel documentation locally

Semih Erdogan
2 min readDec 21, 2020

--

Photo by Rich Tervet on Unsplash

Laravel documentation website is great and i can find whatever i needed.
But this document pages updating almost everyday and keeping track of those changes became almost impossible for me.

For solving this issue i build laravel documentation website on my local computer and used git for getting differences between my local and remote documentation repository.

Let’s start!

Head over to github laravel docs repository https://github.com/laravel/docs.
In this repository you can see branches are the same with laravel versions (8.x, 7.x, 6.x etc.).
And also you can see all pages in “.md” format (artisan.md, blade.md etc.)

What we are going to do is, we will clone this repo and checkout branches into another folders.

  • Create and cd into new documentation folder
    $ mkdir laravel-docs & cd laravel-docs .
  • Clone branch which you want to keep track of changes.
    $ git clone https://github.com/laravel/docs.git -b 8.x --single-branch 8.x
  • For seeing changes first you need to get latest changes from github.
    $ git pull
  • After pulling changes from remote you may see these changes with
    $ git diff HEAD@{1}`

Example output will be like this:

After this steps i was able to know latest changes about laravel documentation but after some time i’ve realised that i need changes from another branches too and checking those changes manually will take too much time.

For this reason i’ve created a script that gets all branches. With this script checking this changes got much easier. And i also add basic html page to see .md files locally.

For learning more about the script you can check github repository https://github.com/laratoolbox/laravel-local-documentation .

--

--

Semih Erdogan
Semih Erdogan

Written by Semih Erdogan

Computer engineer, full stack developer

No responses yet