Closed zeraphin21 closed 2 years ago
It sounds like CSS and JS from the plugin are not registered properly:
Copying those is part of the plugin:
But hard to guess, why would that not work for you :thinking:
OK I'm going ahead with this problem. As you can see above, tab text is include in a \<p> and span class name is caption-text (why?)
So I have modified sphinxcontrib-httpexemple.js :
(function() {
var jQuery = window.jQuery || function() {};
jQuery(function($) {
$('.http-example.container').each(function() {
var $container = $(this),
$blocks = $(this).children(),
$captions = $(this).find('.caption-text');
$captions.each(function() {
var $paragraph = $(this).parent();
var $block = $(this).parent().parent();
$(this).on('click', function() {
$captions.removeClass('selected');
$(this).addClass('selected');
$paragraph.hide();
$blocks.hide();
$block.show();
});
$container.append($(this));
});
$container.append($blocks);
$captions.first().click();
});
});
})();
I've also modified CSS to include .caption-text instead of .caption And now it's working as expected. As you can see I need to get parent of parent ($(this).parent().parent()) to get block DOM.
My question is why do I have a modification on span field? I don't really understand...
@zeraphin21 Thanks! I'd guess there is a change in HTML generated by docutils or Sphinx between some versions. This plugin does not generate its own HTML, but relies on docutils directives to do that.
Let's keep this issue open then. The JS and CSS needs to be fixed to work with both of the versions.
It seems docutils-0.17 causes this issue
Hello, I have a problem with this extension, I only try to pull it from Github, install dependancies in virtualenv and then just generate the doc with this command :
Generated html is :
As you can see, div with id2, id3, etc are not hidden so I have all code blocks displayed one below another one. Can you explain me what I'm doing wrong?