How to build MongoDB documentation locally?

MongoDB documentation github project : GitHub - mongodb/docs: The MongoDB Documentation Project Source.

I have Ubuntu 20.04 LTS
python2 is Python 2.7.18
python3 is Python 3.8.10

Based on build instructions i should do

$ python2 -m pip install giza
ERROR: Could not find a version that satisfies the requirement Pygments>=2.7 
(from jsx-lexer->giza) 
(from versions: 0.5, 0.5.1, 0.6, 0.7, 0.7.1, 0.8, 0.8.1, 0.9, 0.10,
 0.11, 0.11.1, 1.0, 1.1, 1.1.1, 1.2, 1.2.1, 1.2.2, 1.3, 1.3.1, 1.4, 
1.5, 1.6rc1, 1.6, 2.0rc1, 2.0, 2.0.1, 2.0.2, 2.1, 2.1.1, 2.1.2, 
2.1.3, 2.2.0, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.4.2, 2.5.1, 2.5.2)
ERROR: No matching distribution found for Pygments>=2.7
 (from jsx-lexer->giza)

So i tried to do make htlm with the giza for python3 that i have

$ make htlm
....
curl: (22) The requested URL returned error: 404 
make: *** [Makefile:123: examples] Error 22

Some URL’s didn’t work so i removed those lines from the make-file

$ make html
...
giza.libgiza.git.GitError: encountered error Command
'['git', 'rev-parse', '--abbrev-ref', 'HEAD']' 
returned non-zero exit status 128

Even if i solve this which i dont know how, probably i will find a new error.

If someone tries it and builds the MongoDB docs, if you can send how to do it. Its supposed to be just install giza, and make html.

@Takis I tried with Python 3 on Ubuntu and got the same curl failure … It’s on change_streams.js. I think they removed it and forgot to change the Makefile … I opened an issue.

Thank you @Jack_Woehr after searching on the web i managed to do it.

For other people on ubuntu try this

python2 -m pip install -r https://raw.githubusercontent.com/mongodb/docs-tools/master/giza/requirements.txt

also in Makefile remove the examples, because some links are broken i think or the variable doesnt work, and after that , do
make html

I found information from this page that gives instructions for MacOs

1 Like