Comments (17)
You're right. It isn't properly documented. I'll look into it.
To answer your question: the default mode of this plugin uses the version of the js files hosted on the wavedrom servers. I assume that's the latest (stable) version
If you want more control over which version to use, I suggest you take a look at the example directory. That sphinx project demonstrates how to include offline versions of the js files in your codebase. That would allow you to use any version you want
from sphinx-wavedrom.
Ah OK. My problem is that I can see the wavedrom code in the generated HTML files, but nothing is shown in the browser. I don't realy know where the start the debugging. I can release the newest documentation - which uses your extension - in one or two days, so I can present the output to you.
I found other useful diagram written by @drom. Like Bitfield. Have you considered to write a sphinx extension for this diagram too?
from sphinx-wavedrom.
Ok, cool. I can't say I'm an expert in this field (I'm an embedded SW engineer, in fact), but I'll try to take a look!
Bitfield seems incredibly promising, thanks! I've been using nwdiag (packetdiag) for this up until now, but this looks a lot nicer!
from sphinx-wavedrom.
Until now, I'm using bytefield
from LaTeX with the standalone
package to generate PDF and PNG outputs. The generated files are then included into other files like PowerPoint or maybe ReStructured Text. I would like to bring it closer to the GitHub + ReadTheDocs (Sphinx) flow.
I'm also no web developer, but I like and use Python and its ecosystem. In fact, I'm a hardware designer for FPGAs with VHDL :). We are currently working on our documentation for our open source IP core library called PoC. So we need to document some interfaces with waveforms to give a better and quicker understanding. (ReadTheDocs estimates our documentation to > 300 PDF pages :)
from sphinx-wavedrom.
No need to provide any documentation from your part. I made a branch that uses the rtd theme (branch rtd_theme_support), and I seem to be able to reproduce it there. If you have the time, could you confirm?
from sphinx-wavedrom.
Yes I can confirm it. Here is your example, build on my local machine:
You can see the generated HTML source code in the second Chrome window. It contains wavedrom code, but the background windows shows no waveforms.
Is it related to the RTD theme?
from sphinx-wavedrom.
The fact that it doesn't work on the rtd theme, but does on the alabaster theme seems to be related to the fact that sphinx includes the javascript files at the top for the alabaster theme, and at the bottom for the rtd theme.
By manually playing around with it, I managed to get the diagrams back. I'll try to come up with something in the coming week
from sphinx-wavedrom.
If I understood your code correctly, the it will insert the JavaScript code multiple times. Is there a way to add the JavaScript file reference in the header, if at least one wavedrom section was found, and add a run command at the end for all wavedrom code snippets?
Thanks for you effort!
from sphinx-wavedrom.
In fact, the proper way to do it would be to implement it like this: https://www.npmjs.com/package/wavedrom
i.e., adapt the body tag so that it does something like this:
<body onload="WaveDrom.ProcessAll()">
In that case, I can leave the javascript includes as they are (let sphinx handle them), and remove all the duplicate WaveDrom.ProcessAll()
entries.
However, I'm not sure that's possible in the sphinx plugin environment. I'll have to do some digging, but the documentation for it isn't exactly huge, so it might take some time
from sphinx-wavedrom.
The other alternative would be to duplicate the javascript includes (<script type="text/javascript" src="_static/default.js"></script>
) for every diagram entry as well. This seems to work (tested manually), and is the easiest solution, but not the nicest..
from sphinx-wavedrom.
The Sphinx support is quite good. I have filed a lot of issues and questions in the last days. Just ask them who to register such an event in the body and link to this issue discussion :).
from sphinx-wavedrom.
I added a possible fix in pull request #2 . Any chance I could ask you to test on your side?
from sphinx-wavedrom.
There is one waveform after each headline. So it should work, right?
Do you supply your fix as a new PyPI version?
from sphinx-wavedrom.
Not sure what you mean with headline, but I tried to implement the proper solution, i.e. to run wavedrom.processAll() just once, on pageload. The javascript files are also just included once (per rst file)
It seems to work for the example project (I upgraded that to rtd), but wanted to check whether you could test it on your side first. To make things easier, I'll try to supply a version on PyPi tomorrow (if I figure out again how to do that 😏 )
from sphinx-wavedrom.
headline = the section headlined in the example text.
Thank you very much.
from sphinx-wavedrom.
I uploaded version 1.2.0 to pypi. You should be able to download it using pip
from sphinx-wavedrom.
Hello,
I updated the package and it works now.
So this issue can be closed. I'll write another issue (#3) for a different question (just to keep the issue clean and separated :) )
from sphinx-wavedrom.
Related Issues (20)
- Make the wavedrom link configurable HOT 10
- Support for bit fields HOT 4
- Followup of #12: Fix wavedrom build in CI HOT 1
- No tag with id="pmx" found HOT 3
- Graph is not drawing without name HOT 2
- Unable to install: Issues in installing cairo dependency HOT 4
- Plugin does not work in combination with hieroglyph HOT 2
- Latest Wavedrom release (v2.0.0) broken with Sphinx v3.0 HOT 6
- Can you adjust the scale of live-rendered waveforms? HOT 7
- Add support for the wavedrom CLI HOT 8
- Consider adding the sphinx-extension GitHub topic HOT 1
- Release HOT 2
- Fall back to wavedrompy, or give more helpful error message HOT 4
- Question: What is the 'xcffib' dependency used for HOT 5
- Python3.10 issue: ImportError: cannot import name 'Mapping' from 'collections' HOT 8
- Can this extension be marked parallel read and/or write safe? HOT 4
- wavedrom not working with make latexpdf HOT 6
- Relative paths for wavedrom-cli HOT 2
- Feature request - support .yaml files as well as .json files for input HOT 2
- Projects with sphinxcontrib.wavedrom extension fail to build on Mac with M2 chip HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx-wavedrom.