-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider sphinx extension to render different versions of examples code #854
Comments
Examine this extension to see if can render different code examples. The web page says:
then
but the example suggests the tab names are defined in |
This might lead us to a refactor of the code examples. One could imagine tabs for nexusformat, h5py, h5lite, NAPI-C, h5lite, NAPI-Fortran, h5lite, ... to create the same HDF5/NeXus data file. |
The extension Ray linked to is derived from sphinxcontrib-examplecode, which claims to do what we want, while the former adapts the tabs idea to installation commands on different OS's (includes some checking that the commands are correct). Both of these extensions use the Sphinx.info() command, which was deprecated and removed long ago and they should be updated to use the logging API before we can use them. This is pretty easily fixed, but I haven't got the promised tabs to work properly yet. |
Google says I should probably just use the Sphinx-tabs extension that does exactly what we want and is still being maintained. |
I can get the Sphinx-tabs to work, but including text from other files (via |
Progress! |
I think the recommended Sphinx code would be like:
Plus the sphinx-tabs needs to be installed on the compiling system and |
@prjemian @PeterC-DLS |
Printing the html page will print the already open tabs, just as they appear in the browser window at that time. |
An implementation is underway in branch 854-code-tabs and I'm trying to include tabs (holding nexusformat and h5py based code) throughout section 2.1.2. of the manual and make it somewhat self-consistent in as minimal a fashion possible. This experience is already showing that the code examples being written in #807 lack the context to be useful and so any rewriting of the code examples will require considering the entire situation that the code examples are based on (i.e. the WONI instrument). |
Closed with #1117 |
@rayosborn suggested:
Originally posted by @rayosborn in #807 (comment)
The text was updated successfully, but these errors were encountered: