[TYPO3-doc] Extending Sphinx for TYPO3: cannot compile as JSON

Xavier Perseguers xavier at typo3.org
Thu May 9 21:46:22 CEST 2013


Hi,

>> If the Yaml files are missing: Did you install Yaml support for
>> your Python? See: http://wiki.typo3.org/Rendering_reST_on_Linux
> 
> Might be ... I get this:
> 
>> # easy_install pyyaml
>> Searching for pyyaml
>> Reading http://pypi.python.org/simple/pyyaml/
>> Reading http://pyyaml.org/wiki/PyYAML
>> Best match: PyYAML 3.10
>> Downloading http://pyyaml.org/download/pyyaml/PyYAML-3.10.zip
>> Processing PyYAML-3.10.zip
>> Writing /tmp/easy_install-k1yFdn/PyYAML-3.10/setup.cfg
>> Running PyYAML-3.10/setup.py -q bdist_egg --dist-dir /tmp/easy_install-
> k1yFdn/PyYAML-3.10/egg-dist-tmp-Qj23Sq
>> build/temp.linux-x86_64-2.7/check_libyaml.c:2:18: schwerwiegender Fehler: 
> yaml.h: Datei oder Verzeichnis nicht gefunden
>> Kompilierung beendet.
>>
>> libyaml is not found or a compiler error: forcing --without-libyaml
>> (if libyaml is installed correctly, you may need to
>>  specify the option --include-dirs or uncomment and
>>  modify the parameter include_dirs in setup.cfg)
>> zip_safe flag not set; analyzing archive contents...
>> Adding PyYAML 3.10 to easy-install.pth file
>>
>> Installed /usr/lib/python2.7/site-packages/PyYAML-3.10-py2.7-linux-
> x86_64.egg
>> Processing dependencies for pyyaml
>> Finished processing dependencies for pyyaml
> 
> 
> Now it works. Thanks for the hint.

My upload comment in TER stated to rebuild Sphinx environment but...

> Btw, it looks like the global python installation still has precedence over 
> the version build in EXT:sphinx, because this is build with
> 
> 
>> Update script for sphinx
>>
>> Sphinx 1.1.3 has been downloaded.
>> Sphinx 1.1.3 has been unpacked.
>> Sphinx 1.1.3 has been successfully installed.
>> TYPO3 ReStructuredText Tools (845f6708ba3771ad316ee1c0b38f62459096b1d8) 
> have been downloaded.
>> TYPO3 ReStructuredText Tools have been unpacked.
>> TYPO3 RestructuredText Tools have been successfully installed.
>> PyYAML 3.10 has been downloaded.
>> PyYAML has been unpacked.
>> PyYAML has been successfully installed.
>> Following versions of Sphinx may be installed locally:

... the Makefile in fact works with global python installation, not with
the local one from EXT:sphinx.

My extension has been thought to be invoked externally (classes with
static methods to compile, kickstart a project, ...) but for the time
being I don't provide any command line tool to make use of those static
methods. Of course if someone wants to contribute, this would certainly
be useful for everyone, including me :)

Currently, if you want to compile from the command line, here is what
should be scripted with a directory structure with "_make" directory:

file _make/my-local-compile.sh
-----------
#!/bin/bash

export
PYTHONPATH='/path/to/typo3conf/ext/sphinx/Resources/Private/sphinx/1.2b1/lib/python'
SPHINXBUILD=/path/to/typo3conf/ext/sphinx/Resources/Private/sphinx/1.2b1/bin/sphinx-build

$SPHINXBUILD -b html -c . -d build/doctrees .. build/html
-----------

BTW, I started to refactor a bit with
http://forge.typo3.org/issues/48094 to allow local override of ReST
Tools, or even Sphinx sources to be allowed and then to let user
"rebuild and install" with locally installed sources without forcing
original sources to be downloaded.

This would allow for instance to use official ReST tools repository in
Resources/Private/sphinx-sources/RestTools

Cheers

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-project-documentation mailing list