<p>How to build local Plutus document:</p>
<ol>
<li><code>cd plutus</code></li>
<li><code>nix-shell</code></li>
<li><code>nix build -f default.nix docs.site</code></li>
<li><code>cd result</code></li>
<li><code>python3 -m http.server 8081</code></li>
</ol>
<p>Try open http://localhost:8081/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Value.html#g:1</p>

CC BY-SA 4.0
2022-07-28T23:18:20.357Z
this worked for me
D S
CC BY-SA 4.0
2021-11-19T07:28:03.570Z
2021-11-19T07:28:03.570Z
Tony
<p>I keep finding myself coming back here as i hate remembering commands.</p>
<p>So I somewhat automated the process. On Ubuntu (Unless you disable your Firefox browser) the following script will build and launch your plutus docs.</p>
<p>To use it copy the script to your plutus folder and activate your environment with <code>nix-shell</code>.</p>
<p>Then run the bash script from the terminal using the command:</p>
<p><code>sh Make_Docs.sh</code></p>
<p>You can get the Make_Docs file from my plutus automation <a href="https://github.com/AI-madman/Plutus_Automation" rel="nofollow noreferrer">repo</a>.</p>

CC BY-SA 4.0
2022-02-25T22:00:01.893Z
2022-02-25T22:00:01.893Z
KryptoKing
<p>I have been building the documentation with</p>
<pre><code>[~/plutus] nix-build -A plutus-playground.haddock
</code></pre>
<p>following the <a href="https://docs.plutus-community.com/docs/setup/buildDocumentation.html" rel="nofollow noreferrer">Plutus Community guide</a> and</p>
<pre><code>nix build -f default.nix docs.site
</code></pre>
<p>from the <a href="https://github.com/input-output-hk/plutus/tree/master/doc" rel="nofollow noreferrer">Plutus repo</a> and they both work as expected, generating the documentation for the current checkout.</p>
<p>The most probable cause for the issue is that git may not have updated as expected, i.e. throwing an error due to changed files in the local repo. That happened to me a few times when I was switching between the pioneer lecture weeks.</p>
<p>And in my opinion it is worth to set up the webserver as per the Plutus Community instructions, it makes the up to date documentation a great resource!</p>

CC BY-SA 4.0
2021-08-05T13:07:02.737Z
2021-08-05T13:07:02.737Z
vcwebco
<p>I've been following <a href="https://docs.plutus-community.com/docs/setup/buildDocumentation.html" rel="noreferrer">this guide</a> to build Plutus documentation locally.  The key line is -</p>
<pre><code>[~/plutus] nix-build -A plutus-playground.haddock
</code></pre>
<p>This works fine, but I'm following the Pioneer Program and this requires checking out specific commits each week in order to follow the lesson.  When re-building the documentation, the resulting docs doesn't seem to reflect the tag that I've checked out.</p>
<p>My steps are -</p>
<ul>
<li><code>git pull origin master</code> to get the latest commits</li>
<li><code>git checkout</code> of the tag specified for the week</li>
<li>rebuild the documentation using <code>nix-build -A plutus-playground.haddock</code></li>
</ul>
<p>I'm guessing that there is some caching going on that I'm not cleaning up but, if I compare the source files in the plutus dir they don't match the source that is linked to in the documentation.</p>
<p>Should mention that I have a superficial understanding of both nix and haddock.<br />
Any guidance appreciated :)</p>

CC BY-SA 4.0
2021-08-01T21:38:18.680Z
I've not tried building the documentation. But [here is what I use](https://playground.plutus.iohkdev.io/tutorial/haddock/index.html)
Aoaddeola
CC BY-SA 4.0
2021-08-02T02:20:40.193Z
Thanks @Aoaddeola . That works for the latest version, but the API changes quite a lot from week to week. It makes it hard to follow the lectures when the docs that Lars is referencing are different from the latest.  The lectures themselves are a lot to take in, so easier when you can follow what he's pointing out 1:1.
Phil Boltt
CC BY-SA 4.0
2021-08-02T07:15:55.787Z
You can say that again, Phil. I also find myself having to figure out the latest signature of functions through searching Github using Keywords... It sure would be nice to know how to build the documentation.
Aoaddeola
CC BY-SA 4.0
2021-08-03T11:27:59.653Z
There is also an option to build the documentation using `docker`, I tried it and it failed when starting it using `docker-compose`. Have you tried this option? The commands you need are `docker-compose build --no-cache` followed by `docker-compose up` in the `/docker` directory.
eddex
<plutus><plutus-pioneer-program><documentation>
Building local Plutus documentation
# Building local Plutus documentation

(Asked by: username_0 on 2021-08-01)

I've been following this guide to build Plutus documentation locally.  The key line is -
[~/plutus] nix-build -A plutus-playground.haddock

This works fine, but I'm following the Pioneer Program and this requires checking out specific commits each week in order to follow the lesson.  When re-building the documentation, the resulting docs doesn't seem to reflect the tag that I've checked out.
My steps are -

git pull origin master to get the latest commits
git checkout of the tag specified for the week
rebuild the documentation using nix-build -A plutus-playground.haddock

I'm guessing that there is some caching going on that I'm not cleaning up but, if I compare the source files in the plutus dir they don't match the source that is linked to in the documentation.
Should mention that I have a superficial understanding of both nix and haddock.
Any guidance appreciated :)

**Tags:** plutus, plutus-pioneer-program, documentation
> **Comments:**
> **username_1**: I've not tried building the documentation. But [here is what I use](https://playground.plutus.iohkdev.io/tutorial/haddock/index.html)  
> **username_0**: Thanks @Aoaddeola . That works for the latest version, but the API changes quite a lot from week to week. It makes it hard to follow the lectures when the docs that Lars is referencing are different from the latest.  The lectures themselves are a lot to take in, so easier when you can follow what he's pointing out 1:1.  
> **username_1**: You can say that again, Phil. I also find myself having to figure out the latest signature of functions through searching Github using Keywords... It sure would be nice to know how to build the documentation.  
> **username_2**: There is also an option to build the documentation using `docker`, I tried it and it failed when starting it using `docker-compose`. Have you tried this option? The commands you need are `docker-compose build --no-cache` followed by `docker-compose up` in the `/docker` directory.  

---

## 3 answers

### Answer by username_6 on 2021-08-05. Score: 1 | Accepted answer

I have been building the documentation with
[~/plutus] nix-build -A plutus-playground.haddock

following the Plutus Community guide and
nix build -f default.nix docs.site

from the Plutus repo and they both work as expected, generating the documentation for the current checkout.
The most probable cause for the issue is that git may not have updated as expected, i.e. throwing an error due to changed files in the local repo. That happened to me a few times when I was switching between the pioneer lecture weeks.
And in my opinion it is worth to set up the webserver as per the Plutus Community instructions, it makes the up to date documentation a great resource!


---

### Answer by username_3 on 2021-11-19. Score: 3

How to build local Plutus document:

1. `cd plutus`
2. `nix-shell`
3. `nix build -f default.nix docs.site`
4. `cd result`
5. `python3 -m http.server 8081`

Try open http://localhost:8081/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Value.html#g:1

> **Comments:**
> **username_4**: this worked for me  

---

### Answer by username_5 on 2022-02-25. Score: 0

I keep finding myself coming back here as i hate remembering commands.

So I somewhat automated the process. On Ubuntu (Unless you disable your Firefox browser) the following script will build and launch your plutus docs.

To use it copy the script to your plutus folder and activate your environment with `nix-shell`.

Then run the bash script from the terminal using the command:

`sh Make_Docs.sh`

You can get the Make\_Docs file from my plutus automation [repo](https://github.com/AI-madman/Plutus_Automation).


---

