mirror of
https://git.rtems.org/rtems-docs/
synced 2025-06-06 16:32:59 +08:00
html: Add support for an HTML cover page for releases.
This commit is contained in:
parent
1e9f28ceeb
commit
d8a1037cbc
72
common/html-coverpage/index.html
Normal file
72
common/html-coverpage/index.html
Normal file
@ -0,0 +1,72 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>RTEMS - Documentation</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<meta name="created" content="11th Jan 2017 15:32" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="keywords" content="" />
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="static/css/bootstrap.min.css" />
|
||||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
||||
<script type="text/javascript" src="static/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="static/js/bootstrap.min.js"></script>
|
||||
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="static/rtems/css/rtems.css" />
|
||||
<link rel="shortcut icon" href="/static/rtems/favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- page-top -->
|
||||
<!-- header-top -->
|
||||
<header class="header">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<img class="img-responsive" alt="Header logo" src="static/rtems/image/rtemslogo.png"/>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<h1>RTEMS - Real Time Operating System</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<!-- header-bottom -->
|
||||
<!-- layout-top -->
|
||||
<div id="layout">
|
||||
<!-- current-top -->
|
||||
<div class="container">
|
||||
<div id="messages">
|
||||
</div>
|
||||
<div class="content">
|
||||
<div id="content_inner">
|
||||
</div>
|
||||
</div>
|
||||
<div id="rtems-catalogue-title"></div>
|
||||
<div class="table-responsive">
|
||||
<div id="rtems-catalogue">
|
||||
<h3> No catalogue found. </h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Load the catalogues and generate the content -->
|
||||
<script type="text/javascript" src="static/rtems/js/catalogue.js"></script>
|
||||
<script> loadCatalogue('catalogue.xml'); </script>
|
||||
<!-- current-bottom -->
|
||||
</div>
|
||||
<!-- layout-bottom -->
|
||||
<!-- footer-top -->
|
||||
<hr>
|
||||
<footer class="footer text-center">
|
||||
<div class="container">
|
||||
Copyright 2017 RTEMS Project
|
||||
</div>
|
||||
</footer>
|
||||
<!-- footer-bottom -->
|
||||
<!-- page-bottom -->
|
||||
</body>
|
||||
</html>
|
6
common/html-coverpage/static/css/bootstrap.min.css
vendored
Normal file
6
common/html-coverpage/static/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 979 B |
BIN
common/html-coverpage/static/images/html-xxl.png
Normal file
BIN
common/html-coverpage/static/images/html-xxl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
30
common/html-coverpage/static/js/bloodhound.js
Normal file
30
common/html-coverpage/static/js/bloodhound.js
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
var states = new Bloodhound({
|
||||
remote: '/search/autocomplete/?q=%QUERY',
|
||||
datumTokenizer: function(d) {
|
||||
return Bloodhound.tokenizers.whitespace(d.value);
|
||||
},
|
||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||
limit: 15
|
||||
});
|
||||
|
||||
// kicks off the loading/processing of `local` and `prefetch`
|
||||
states.initialize();
|
||||
|
||||
$('#bloodhound .typeahead').typeahead({
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'states',
|
||||
displayKey: 'value',
|
||||
// `ttAdapter` wraps the suggestion engine in an adapter that
|
||||
// is compatible with the typeahead jQuery plugin
|
||||
source: states.ttAdapter()
|
||||
});
|
||||
|
||||
|
||||
$('#search_input').bind('typeahead:selected', function(obj, datum, name) {
|
||||
$("form").submit();
|
||||
});
|
7
common/html-coverpage/static/js/bootstrap.min.js
vendored
Normal file
7
common/html-coverpage/static/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
common/html-coverpage/static/js/jquery.min.js
vendored
Normal file
5
common/html-coverpage/static/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
72
common/html-coverpage/static/rtems/css/rtems.css
Normal file
72
common/html-coverpage/static/rtems/css/rtems.css
Normal file
@ -0,0 +1,72 @@
|
||||
header {
|
||||
background: #38532f;
|
||||
}
|
||||
|
||||
.h1, h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.h3, h3 {
|
||||
font-size: 25px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
|
||||
.navbar-default {
|
||||
background-color: #dbe5c6;
|
||||
border-color: #b2baa1;
|
||||
}
|
||||
|
||||
.navbar-inverse .navbar-brand {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.navbar-inverse .navbar-text {
|
||||
color: #333;
|
||||
}
|
||||
.navbar-inverse .navbar-nav > li > a {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav > li > a {
|
||||
color: 333;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav > li > a:hover,
|
||||
.navbar-default .navbar-nav > li > a:focus {
|
||||
color: #333;
|
||||
background-color: #b2baa1;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav > .open > a,
|
||||
.navbar-default .navbar-nav > .open > a:hover,
|
||||
.navbar-default .navbar-nav > .open > a:focus {
|
||||
color: #fcfcfc;
|
||||
background-color: #38532f;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
|
||||
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
|
||||
color: #333;
|
||||
background-color: #b2baa1;
|
||||
}
|
||||
|
||||
.navbar-inverse .navbar-link {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
col-md-3 {
|
||||
background: #38532f;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
col-md-9, h1 {
|
||||
color: #fcfcfc;
|
||||
}
|
||||
|
||||
.table-condensed > thead > tr > td,
|
||||
.table-condensed > tbody > tr > td,
|
||||
.table-condensed > tfoot > tr > td {
|
||||
padding: 2px;
|
||||
border-collapse: separate !important;
|
||||
border-spacing: 0;
|
||||
}
|
BIN
common/html-coverpage/static/rtems/image/rtemslogo.png
Normal file
BIN
common/html-coverpage/static/rtems/image/rtemslogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
76
common/html-coverpage/static/rtems/js/catalogue.js
Normal file
76
common/html-coverpage/static/rtems/js/catalogue.js
Normal file
@ -0,0 +1,76 @@
|
||||
/*!
|
||||
* Catalogue 0.1
|
||||
* Copyright 2017 Chris Johns <chrisj@rtems.org>
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
|
||||
function parseCatalogue(xml) {
|
||||
if (window.DOMParser)
|
||||
{
|
||||
parser = new DOMParser();
|
||||
xmlDoc = parser.parseFromString(xml, "text/xml");
|
||||
}
|
||||
else // Internet Explorer
|
||||
{
|
||||
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
|
||||
xmlDoc.async = false;
|
||||
xmlDoc.loadXML(xml);
|
||||
}
|
||||
return xmlDoc;
|
||||
}
|
||||
|
||||
function catalogueHeader(date) {
|
||||
return '<table class="table table-condensed table-nonfluid">\n' +
|
||||
' <tbody>\n' +
|
||||
' <thead><tr><th>Built: ' + date + '</th><th>PDF</th><th>Single Page</th></tr></thead>\n';
|
||||
}
|
||||
function catalogueFooter() {
|
||||
return ' </tbody>\n' +
|
||||
'</table>\n';
|
||||
}
|
||||
|
||||
function loadCatalogue(path) {
|
||||
var el_cat_title = $('#rtems-catalogue-title');
|
||||
var el_cat = $('#rtems-catalogue');
|
||||
|
||||
var f = $.get(path, function(xml) {
|
||||
/*
|
||||
* Use jquery as XMLDocument is consider not stable on Firefox's web site.
|
||||
*/
|
||||
var pdfIcon = 'static/images/Adobe_PDF_file_icon_32x32.png';
|
||||
var htmlIcon = 'static/images/html-xxl.png';
|
||||
var docs = $(xml).find('rtems-docs');
|
||||
var date = $(docs).attr('date');
|
||||
var title = $(docs).find('catalogue');
|
||||
var table = catalogueHeader(date);
|
||||
$(docs).find('doc').each(function() {
|
||||
var name = $(this).find('name').text();
|
||||
var title = $(this).find('title').text();
|
||||
var release = $(this).find('release').text();
|
||||
var version = $(this).find('version').text();
|
||||
var html = $(this).find('html').text();
|
||||
var pdf = $(this).find('pdf').text();
|
||||
var singlehtml = $(this).find('singlehtml').text();
|
||||
var empty = '<td></a></td>\n';
|
||||
table += '<tr>\n';
|
||||
if (html)
|
||||
table += '<td><a href="' + html + '">' + title + '</a></td>\n';
|
||||
else
|
||||
table += empty;
|
||||
if (pdf)
|
||||
table += '<td><a href="' + '/' + pdf + '">' +
|
||||
'<img src="' + pdfIcon + '" width="20" height="20"></a></td>\n';
|
||||
else
|
||||
table += empty;
|
||||
if (singlehtml)
|
||||
table += '<td><a href="' + '/' + singlehtml + '">' +
|
||||
'<img src="' + htmlIcon + '" width="20" height="20"></a></td>\n';
|
||||
else
|
||||
table += empty;
|
||||
table += '</tr>\n';
|
||||
});
|
||||
table += catalogueFooter();
|
||||
el_cat_title.html('<h3>' + $(title).text() + '</h3>');
|
||||
el_cat.html(table);
|
||||
}, 'xml');
|
||||
}
|
12
wscript
12
wscript
@ -9,7 +9,7 @@ path.append(abspath('common'))
|
||||
import waflib
|
||||
import waf as docs_waf
|
||||
|
||||
version = 'Master (4.11.99)'
|
||||
version = '4.11 (4.11.2)'
|
||||
|
||||
build_all = ['user',
|
||||
'rsb',
|
||||
@ -39,10 +39,20 @@ def catalogue(ctx):
|
||||
def build(ctx):
|
||||
for b in building:
|
||||
ctx.recurse(b)
|
||||
|
||||
#
|
||||
# Build the catalogue and install with the coverpage and static content.
|
||||
#
|
||||
ctx(rule = catalogue,
|
||||
target = 'catalogue.xml',
|
||||
source = ['wscript', 'common/waf.py'])
|
||||
ctx.install_files('${PREFIX}', 'catalogue.xml')
|
||||
ctx.install_files('${PREFIX}', 'common/html-coverpage/index.html')
|
||||
static_dir = ctx.path.find_dir('common/html-coverpage/static')
|
||||
ctx.install_files('${PREFIX}/static',
|
||||
static_dir.ant_glob('**'),
|
||||
cwd = static_dir,
|
||||
relative_trick = True)
|
||||
|
||||
def install(ctx):
|
||||
for b in building:
|
||||
|
Loading…
x
Reference in New Issue
Block a user