diff --git a/conf.py b/conf.py index bd015ab0f..eaabd9cda 100644 --- a/conf.py +++ b/conf.py @@ -135,7 +135,8 @@ html_theme_path = ['extensions'] # directory. They are copied after the builtin static files, so a file named "default.css" will # overwrite the builtin "default.css". html_static_path = ['static'] -html_add_permalinks = '' +html_add_permalinks = 'ΒΆ' # Sphinx < 3.5 +html_permalinks = True # Sphinx >= 3.5 html_js_files = [ 'js/atom.js', 'js/accounts.js', @@ -148,6 +149,10 @@ html_js_files = [ 'js/coa-valuation-continental.js', 'js/coa-valuation-anglo-saxon.js', ] +html_css_files = [ + 'css/accounting.css', + 'css/legal.css', +] #=== Options for LaTeX output ===# @@ -227,10 +232,6 @@ LANGUAGES = { } def setup(app): - # VFE TODO: use html_js_files & html_css_files conf attributes instead. - # app.add_stylesheet('css/accounting.css') - # app.add_stylesheet('css/legal.css') - app.connect('html-page-context', canonicalize) # VFE TODO remove default before merge app.add_config_value('canonical_root', os.path.dirname(os.path.realpath(__file__)), 'env') diff --git a/extensions/odoo_theme/static/js/layout.js b/extensions/odoo_theme/static/js/layout.js index a9738f8fa..e753f2392 100644 --- a/extensions/odoo_theme/static/js/layout.js +++ b/extensions/odoo_theme/static/js/layout.js @@ -7,19 +7,6 @@ content.querySelectorAll('img').forEach(image => { image.classList.add('img-fluid'); }); - - // Add permalink anchors next to body sections - content.querySelectorAll('section').forEach(section => { - const heading = section.querySelector('h1,h2,h3,h4,h5,h6'); - if (heading) { - const permalinkMarker = document.createElement('a'); - permalinkMarker.href = `#${section.id}`; - permalinkMarker.classList.add('o_permalink_marker'); - permalinkMarker.innerText = "O_REMOVE_ME" - heading.classList.add('o_has_permalink_marker'); // TODO EDI do we need this class? - heading.append(permalinkMarker); - } - }); }); })(); diff --git a/extensions/odoo_theme/static/style.scss b/extensions/odoo_theme/static/style.scss index 60b76cac9..8893e7a2f 100644 --- a/extensions/odoo_theme/static/style.scss +++ b/extensions/odoo_theme/static/style.scss @@ -536,6 +536,25 @@ dt { margin-top: -$o-header-height; } +// TODO EDI this makes permalinks only visible on hover. Please re-write and sort + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + #wrap { margin-top: $o-header-height; display: flex;