2016-02-04 6 views
10

का उपयोग कर बनाने के लिए मैं इस तरह के कोड है:buildout कैसे कॉन्फ़िगर करें मेरी <strong>buildout.cfg</strong> फ़ाइल में स्फिंक्स प्रलेखन bin/sphinxbuilder

parts = 
    ... 
    sphinxbuilder 

अगले एक ही फाइल में:

eggs= 
    ... 
    jinja2 
    markupsafe 
    sphinx 

और फिर, फ़ाइल के अंत में:

[sphinxbuilder] 
recipe = collective.recipe.sphinxbuilder 
source = ${buildout:directory}/docs-src 
build = ${buildout:directory}/docs 

मैं करता हूं:

bin/buildout 

जो उत्पादन देता है (सामान्य रूप में: ठीक है):

Updating sphinxbuilder. 
collective.recipe.sphinxbuilder: writing MAKEFILE.. 
collective.recipe.sphinxbuilder: writing BATCHFILE.. 
collective.recipe.sphinxbuilder: writing custom sphinx-builder script.. 

अंडे फ़ोल्डर में मैं Sphinx ईईजी की है।

buildout के बाद, परियोजना निर्देशिका के तहत मेरे पास एक नया कैटलॉग है: docs

bin/sphinx-quickstart 

और root path for the documentation के रूप में मैं docs

सेट तो मैं docs/conf.py और टिप्पणी हटाएं

sys.path.insert(0, os.path.abspath('.')) 

मैं आदेश bin/sphinxbuilder चलाने को संपादित करने और त्रुटि मिलती है:

Makefile:12: *** The 'sphinx-build' command was not found. 
Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the 'sphinx-build' executable. 
Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/. Stop. 
तो मैं आदेश चला

मुख्य समस्याओं: (1) कैसे स्फिंक्स buildout के साथ स्वत: काम कर पाने के लिए? (2) कैसे .rst फाइलों में मॉड्यूल (ऐप्स) परियोजना के लिए सही रास्ते स्थापित करने के लिए? (3) कहाँ conf.py फ़ाइल डाल करने के लिए?

+1

आप विंडोज पर काम कर रहे हैं? वहाँ जो (लाइन 146 sphinxbuilder/__ init__.py में) जो मुझे बाहर का निर्माण करने से रोकता है मेरे लिए एक त्रुटि का कारण बनता है 0.8.2 py27 collective.recipe.sphinxbuilder अंडे में एक बग है। मैं अभी भी अन्य लिपियों का उपयोग करने में सक्षम हूँ, लेकिन का उपयोग कर "भागों = sphinxbuilder" उनके डॉक्स में के रूप में सही ढंग से –

+0

नहीं है, काम नहीं करता है लिनक्स पर। धन्यवाद। –

उत्तर

0

यहाँ खिड़कियों पर, लेकिन मैं ने वही समस्या को याद करने लगते हैं।

निम्नलिखित cfg विस्तार दो बातें सुनिश्चित करता: 1) सभी entrypoints हम उत्पन्न स्फिंक्स अंडे 2) भागों जो स्फिंक्स entrypoints उन entrypoints -after- निष्पादित किया जाएगा पर भरोसा करते हैं उत्पन्न कर रहे हैं के लिए उपयोग किया

[sphinx] 
eggs = 
    sphinx 
    <if you have theme eggs or other extensions, put em here> 

parts = 
    sphinx.console_scripts 

[sphinx.console_scripts] 
recipe = zc.recipe.egg 
dependent-scripts = true 
eggs = 
    ${sphinx.eggs} 
    ${buildout:eggs} 

इस का प्रयोग करके आप भागों है कि निर्माण/apidoc निष्पादनयोग्य पर भरोसा करते हैं जोड़ सकते हैं और अपने प्रलेखन पीढ़ी एक एक क्लिक buildout का हिस्सा बन जाता:

[sphinx.apidoc] 
recipe = plone.recipe.command 
command = ${buildout:bin-directory}\sphinx-apidoc.exe <all your flags/settiongs based on buildout> 
संबंधित मुद्दे