| extends ../layouts/basic |
| |
| block variablesLang |
| include ./_variablesLang.jade |
| |
| block extra_head |
| title Coding Standard - Apache ECharts |
| |
| link(rel='stylesheet', type='text/css', href='#{cdnPayRoot}/#{ecWWWLang}/vendors/prettify/prettify.css?_v_=#{cdnPayVersion}') |
| script(type='text/javascript', src='#{cdnThirdParty.prettifyJS}') |
| script(type='text/javascript', src='#{cdnThirdParty.prettifyCSSHandlerJS}') |
| |
| |
| block content |
| nav(class='navbar navbar-default navbar-fixed-top') |
| include ./nav |
| |
| .page-main |
| .page-info |
| h1 Coding Standard |
| p Please follow this standard when contribute to ECharts project. |
| p.page-info-echarts Apache ECharts<sup>TM</sup> |
| |
| .page-content.single-page |
| .page-nav |
| ul#standard-nav |
| .page-detail |
| include ../../_generated/en/coding-standard-content.html |
| include ../components/inner-footer |
| |
| block extra_js |
| |
| script(type='text/javascript'). |
| document.getElementById('nav-contribute').className = 'active'; |
| |
| var $list = $('#standard-nav'); |
| $('.page-detail h2, .page-detail h3, .page-detail h4') |
| .each(function () { |
| var $this = $(this); |
| var text = $this.text(); |
| var anchor = text.toLowerCase().replace(/[^\w\u4e00-\u9fa5]+/g, '-'); |
| var tagName = $this.prop('tagName').toLowerCase(); |
| |
| if (tagName === 'h2') { |
| $list.append('<li><a href="#' + anchor + '"><h4 class="inner">' + text + '</h4></a></li>'); |
| } |
| else { |
| $list.append('<li><a href="#' + anchor + '">' + text + '</a></li>'); |
| } |
| }); |
| |
| $('.page-nav a').click(function () { |
| $('.page-nav a').removeClass('active'); |
| $(this).addClass('active'); |
| }); |
| |
| // Fix scroll position covered by nav |
| window.addEventListener('hashchange', function() { |
| scrollBy(0, -50); |
| }); |
| |
| $('.page-detail pre code').each(function (index, el) { |
| $(el).addClass('prettyprint'); |
| }); |
| prettyPrint(); |
| |