CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

pdf documentation for libraries
https://forum.codesys.com/viewtopic.php?f=18&t=7380
Page 1 of 1

Author:  learnetk [ Fri Nov 25, 2016 3:59 pm ]
Post subject:  pdf documentation for libraries

Hallo Everyone

I have been trying to script my documentation and get a pdf output for the same.
using Sphix and rst2pdf. The try the command

>sphinx-build -b pdf C:\Project\SysFile\Source C:\Project\SysFile\Build

and i get errors

libraries [ERROR] pdfbuilder.py:130 too many values to unpack
..
ValueError: too many values to unpack
FAILED
build succeeded.

has anyone been successful using this..!!

I am using Codesys V3.6.
Thanks and warm regards

Author:  M.Keller [ Fri Nov 25, 2016 4:38 pm ]
Post subject:  Re: pdf documentation for libraries

Hi learnetk.

From the subject I think you want to generate documentation for a library but from the text I get the impression you want to generate documentation for your scripts. Which is the correct one?

If you want to generate documentation for a library did you use CODESYS Libdoc? See "Library Development Summary" and "Script your Documentation" in the online help.

BR
Martin

Author:  learnetk [ Mon Nov 28, 2016 10:22 am ]
Post subject:  Re: pdf documentation for libraries

Hi Martin,

I am using Codesys V3.5 SP6 Patch 3

Firstly, i installed Python 2.7.12 along with the packages Sphinx and rst2pdf.

Then started with the Libdoc scripts (as in Script your Documentation) and followed the steps as under :

Step 1 : Libdoc export c:\project\lib\sysfile.library c:\project\lib\sysfile.json
Step 2 : Libdoc generate c:\project\lib\sysfile.json c:\project\lib\Frame
Step 3 : Libdoc merge c:\project\lib\sysfile.json c:\project\lib\Frame c:\project\lib\Source

Step 4 : copy the files 'conf.py' to the Source folder, remove the html part and reference to libdoc_builder
Step 5 : Add in Conf.py the following changes
extensions = ['sphinx.ext.todo', 'rst2pdf.pdfbuilder']
pdf_documents = [('index', u'rst2pdf', u'SysFileDoc', u'Test'),]

Step 6 : sphinx-build -b pdf c:\project\lib\source c:\project\lib\build

>sphinx-build -b pdf c:\project\lib\source c:\project\lib\build
Running Sphinx v1.4.9
loading pickled environment... failed: source directory has changed
building [mo]: targets for 0 po files that are out of date
building [pdf]: targets for 27 source files that are out of date
updating environment: 27 added, 0 changed, 0 removed
reading sources... [100%] libraries
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
processing rst2pdf... index ACCESS_MODE SYS_FILETIME SYS_FILE_STATUS SysFileClose SysFileCopy SysFileDelete SysFileDeleteByHandle SysFileEOF SysFileFlush SysFileGetName SysFileGetName2 SysFileGetPath
SysFileGetPos SysFileGetSize SysFileGetSizeByHandle SysFileGetStatus SysFileGetStatus2 SysFileGetTime SysFileOpen SysFileRead SysFileRename SysFileSetPos SysFileTruncate SysFileWrite info libraries [E
RROR] pdfbuilder.py:130 too many values to unpack
Traceback (most recent call last):
File "c:\python27\lib\site-packages\rst2pdf\pdfbuilder.py", line 122, in write
appendices=opts.get('pdf_appendices', self.config.pdf_appendices) or [])
File "c:\python27\lib\site-packages\rst2pdf\pdfbuilder.py", line 209, in assemble_doctree
index_nodes=genindex_nodes(genindex)
File "c:\python27\lib\site-packages\rst2pdf\pdfbuilder.py", line 385, in genindex_nodes
for entryname, (links, subitems) in entries:
ValueError: too many values to unpack
FAILED
build succeeded.

Thanks and warm regards

Author:  M.Keller [ Mon Nov 28, 2016 3:00 pm ]
Post subject:  Re: pdf documentation for libraries

Hi learnetk.

Why didn't you use our tool to generate the PDF? For that you have to transform the source to LaTeX which can be converted to PDF. See "PDF Output Format" in the online help.

Maybe you should use a newer version of CODESYS to create your documentation because there were some bugs in the early versions of the tool.

BR
Martin

Author:  learnetk [ Mon Nov 28, 2016 6:06 pm ]
Post subject:  Re: pdf documentation for libraries

Hi Martin,
Thank you ..!!
That works, as described in the section "PDF Output Format". But how could i add multiple .tex files to make a single document.

Thanks and warm regards.

Author:  codesys_sig_forum [ Mon Mar 11, 2019 2:26 pm ]
Post subject:  Re: pdf documentation for libraries - unable to load extension codesys for sphinx

Hello Martin,

I have gotten to the step where, the source and frame are merged and the libdoc 3.5.11.0 installed in a virtualenv. When I try to run the sphinx command to generate a pdf, I get the error

"Could not import extension sphinx.ext.codesys ( no module named codesys)"

What am I missing here. Also if I try to run pdflatex on the lib.tex, I get a missing cmap.sty error and I am not able to proceed further.

Thanks in advance

Best Regards

Shivaram

Author:  phongpham [ Wed Sep 04, 2019 11:47 pm ]
Post subject:  Re: pdf documentation for libraries

I'm running into the same error
Could not import extension sphinx.ext.codesys (exception: No module named codesys)
could anyone give us a hint?

Thank you!

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/