aosabook/500lines

many errors on building

baiyuxiong opened this issue · 5 comments

OS: Mac 10.12.3
python Python 2.7.12, no virtualenv used

cmd:
python build.py --html

output:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/envoy/core.py", line 214, in run
out, err = cmd.run(data, timeout, kill_timeout, env, cwd)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/envoy/core.py", line 93, in run
raise self.exc
OSError: [Errno 2] No such file or directory

./_build/fix_html_title.sh html/content/pages/template-engine.md

sed: 1: "html/content/pages/temp ...": extra characters at the end of h command

python _build/preprocessor.py --chapter 22 --html-refs --output=./web-server/web-server.markdown.1 --latex ./web-server/web-server.markdown

pandoc --csl=minutiae/pdf/ieee.csl --mathjax -t html -f markdown+citations -o html/content/pages/web-server.md ./web-server/web-server.markdown.1

No such file or directory
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/envoy/core.py", line 214, in run
out, err = cmd.run(data, timeout, kill_timeout, env, cwd)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/envoy/core.py", line 93, in run
raise self.exc
OSError: [Errno 2] No such file or directory

./_build/fix_html_title.sh html/content/pages/web-server.md

sed: 1: "html/content/pages/web- ...": extra characters at the end of h command

make html
pelican /Users/baiyuxiong/code/500lines/html/content -o /Users/baiyuxiong/code/500lines/html/output -s /Users/baiyuxiong/code/500lines/html/pelicanconf.py

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pelican", line 7, in
from pelican import main
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pelican/init.py", line 19, in
from pelican.generators import (ArticlesGenerator, PagesGenerator,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pelican/generators.py", line 20, in
from pelican.cache import FileStampDataCacher
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pelican/cache.py", line 10, in
from pelican.utils import mkdir_p
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pelican/utils.py", line 29, in
from six.moves.html_parser import HTMLParser
ImportError: No module named html_parser
make: *** [html] Error 1

cp -a ./blockcode/blockcode-images html/output/pages/

cp -a ./ci/ci-images html/output/pages/

.......

Having the same problem on 64-bit Linux Mint 18.1, with both the HTML and the PDF build.

pandoc is need.
I fixed this by installing pandoc :
brew install pandoc

visit http://localhost:8000 for docs

pdflatex is needed when building pdf format

_build/fix_html_title.sh should been edited before building on MAC.
Add "" after "-i"

before:

#!/usr/bin/env bash

sed -i 's|<p>\(title:.*\)author:\(.*\)</p>|\1\
author:\2\
|' $1

after:

#!/usr/bin/env bash

sed -i "" 's|<p>\(title:.*\)author:\(.*\)</p>|\1\
author:\2\
|' $1

Latest try on Mac OSX (High Sierra, mactex + pandox & all dependancies installed):

  • sed fix from above comment necessary
  • Pandox --chapters and -S options are removed. In build.py these replacements are necessary:
    • Line 161:
      python cmd = '{pandoc} --top-level-division=chapter -f markdown+smart+mmd_title_block --highlight-style=kate -o 500L.epub epubtitle.txt introduction.markdown {markdowns}'
    • Line 217:
      python temp = '{pandoc} -V chaptertoken={chaptertoken} -t latex --top-level-division=chapter -f markdown+smart+mmd_title_block+tex_math_dollars --template=tex/chaptertemplate.tex --no-highlight -o tex/{basename}.tex.1 tex/{md}'

Builds afterwards (489 pages in pdf). However, still shows build errors in CLI and noticed several typesetting issues in the resulting pdf. Building using TexMaker with the *.tex files generated by the preprocessor steps from the python build script does not work.