Hi,
> According to me, the expected result must be a single web page for each > sample, with one or more screenshots, the python source code being syntax > highlighted. I don't know whether Sphinx or Epydoc are suitable for this > purpose, they might be a good solution. > Sphinx handles syntax hilghlighting. Actually it just use a specific tool called Pygments (http://pygments.org/). So one way or the other, we can always use pygments for syntax highlighting. > The other one is to develop a simple script, let's say sample_to_html.py > that parses the python sample, run it to generate the screenshot and create > the html page. > The idea could be used with sphinx also. I mean instead of directly creating plain Html, we could generate reStructuredText<http://docutils.sf.net/rst.html> files which might be easier to produce from a script. Then the script (sample_to_html.py) would just call sphinx to create final html pages. Anyway, what is not clear to me is how to parse the sample. I mean I see how we can get an html page that only contains the source code (syntax higlighted). But what if we are to generate a page with more information (like the purpose of the sample, what is illustrated)? Honnestly I don't find my examples very convincing, so the code + screenshots should be a good starting point. Also about the screenshot, besides the offscreen rendering issue, do you think the external script (sample_to_html.py) should know what to take a screenshots? I personally see things differently, like having a custom function in each sample with always the same name (like getScreenShots, that will be called by sample_to_html.py. Or if we want to minimize editing the samples, we could simply add too each sample a custom variable storing the list of shapes we want to take a screenshot. This list would then be pass to sample_to_tmpl.py which will handle taking the screenshots (in offscreen mode soon ;-)) . Any comments? Loïc > > >> 2) how to automatically create screenshots >> Here also we should decide if we want to extend all the samples with a >> utility function (which is easier I think) or to handle it with an external >> script only. >> Besides, Bryan raised the issue that while taking screenshot, no window >> should popup. Thomas have you find a solution to this yet? >> > > Nope. I ran a few tests and got many segfaults! I need more time to go > further, without being sure that it's indeed possible. > >> >> Please go ahead, giving your opinion on what is important or not, and >> suggestions on how we should proceed... >> Kind regards, >> Loïc >> >> > Thomas > > > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users > >
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users