blob: 77393981339f55b010d8ca35b1fe29eb29feb040 [file] [log] [blame]
extends ../layouts/basic
block extra_head
title 代码规范 - Apache ECharts
link(rel='stylesheet', type='text/css', href='#{cdnPayRoot}/#{ecWWWLang}/vendors/prettify/prettify.css?_v_=#{cdnPayVersion}')
script(type='text/javascript', src='#{cdn3rdRoot.prettifyJS}')
script(type='text/javascript', src='#{cdn3rdRoot.prettifyCSSHandlerJS}')
block content
nav(class='navbar navbar-default navbar-fixed-top')
include ../components/nav
.page-main
.page-info
h1 代码规范
p 如果你想要为 ECharts 贡献代码,请遵从以下代码规范。
p.page-info-echarts Apache ECharts<sup>TM</sup>
.page-content.single-page
.page-nav
ul#standard-nav
.page-detail
include ../../_generated/zh/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();