Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: tecgen on March 16, 2016, 01:26:01 PM

Title: rst2html5 instead of rst2html
Post by: tecgen on March 16, 2016, 01:26:01 PM
Dear all,

I am compiling ML on a Mac running the latest OSX 10.11.3. The build fails because within the file modules/readme2modulestrings.py we use rst2html. I was not able to install rst2html dependency on OSX but I can install rst2html5 without any problems. I am sure many developer use Linux to compile ML.

- Is rst2html5 is also available on Linux?
- Can we simply switch from rst2html to rst2html5?
- Do we need a pull request or could one of the experienced developers simply commit this change? ;)

current line:
txt = run('cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html --no-xml-declaration | python ../html2text.py -b 700')


OSX compatible line:
txt = run('cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html5 | python ../html2text.py -b 700')


best regards,
Marco
Title: Re: rst2html5 instead of rst2html
Post by: a1ex on March 16, 2016, 01:33:20 PM
Probably one way would be to try all the usual names for this program (so far, rst2html, rst2html.py, rst2html5).
Title: Re: rst2html5 instead of rst2html
Post by: dmilligan on March 16, 2016, 01:53:38 PM
Quote from: tecgen on March 16, 2016, 01:26:01 PM
I was not able to install rst2html dependency on OSX but I can install rst2html5 without any problems.
Have your tried homebrew?

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python
pip install docutils

Then just symlink rst2html.py to rst2html

See also
http://www.magiclantern.fm/forum/index.php?topic=16012.msg156574#msg156574[/code]
Title: Re: rst2html5 instead of rst2html
Post by: tecgen on March 16, 2016, 04:08:50 PM
QuoteProbably one way would be to try all the usual names for this program (so far, rst2html, rst2html.py, rst2html5).
That a good idea. I'll try to implement it. I just need to check if one of the programs exist and just use the first I find.

QuoteHave your tried homebrew?
Yes, I installed python with brew.sh some time ago and with pip I came to rst2html5.

QuoteThen just symlink rst2html.py to rst2html
This is a solution. But I prefer if it would just work out of the box as easy as possible. ;)

By the way, could it be that make clean does not clean the files generated by readme2modulestrings.py properly? When I clone the latest ML into a new folder and switch to unified I could not build with make 5D2. When I change rst2html to rst2html5 within readme2modulestrings.py and run make clean and afterwards make 5D2 I can build ML properly. If I revert then the changes in readme2modulestrings.py and run make clean and make 5D2 I could build without problems. This is unexpected.

So far I do not completely understand how the whole build process works and why we transform from rst to HTML to text. Maybe we can transform it in future with another approach.
Title: Re: rst2html5 instead of rst2html
Post by: dfort on March 16, 2016, 06:57:23 PM
I experienced the same problems so once I worked it out I wrote up tutorials on how to compile ML. This is the one for the Mac:
http://magiclantern.fm/forum/index.php?topic=16012.0

This is what I did with the rst2html issue you're experiencing, first cd to /usr/local/bin:

Quote...the build process is looking for rst2html but the docutils installation gave us rst2html.py. Simply make a symbolic link to those .py files from the docutils package...
for f in /usr/local/bin/*.py; do ln -s $f "${f/.py/}"; done

I have sort of an ugly hack with the gcc compiler in that tutorial that dmilligan pointed out. I should change that.
Title: Re: rst2html5 instead of rst2html
Post by: tecgen on March 17, 2016, 03:45:22 PM
Here you can find my pull request.
https://bitbucket.org/hudson/magic-lantern/pull-requests/691/find-available-rst2html-command-and-use-it/diff

It searches a list of possible commands for rst2html and uses the first one. It would be nice if some of the linux users could clone this branch and try it out. On my Mac it uses rst2html5 the second possibility and build ML without any problems.
Title: Re: rst2html5 instead of rst2html
Post by: dfort on March 17, 2016, 11:25:35 PM
Thanks, this a great idea especially considering the number of posts with rst2html questions. Saw you had some bitbucket issues at first because the README.md file kept coming up on the pull list but all is fine now.