Commit 41236d29 authored by con's avatar con

Allow creating the api and pluginhowto documentation with qmake && make.

This copies the technique used for the app resources in share/qtcreator.
Also use the Qt style for the plugin howto.
parent 1aeef8d9
TEMPLATE = app
TARGET = apidoc
CONFIG -= qt
QT =
LIBS =
macx:CONFIG -= app_bundle
isEmpty(vcproj) {
QMAKE_LINK = @: IGNORE THIS LINE
OBJECTS_DIR =
win32:CONFIG -= embed_manifest_exe
} else {
CONFIG += console
PHONY_DEPS = .
phony_src.input = PHONY_DEPS
phony_src.output = phony.c
phony_src.variable_out = GENERATED_SOURCES
phony_src.commands = echo int main() { return 0; } > phony.c
phony_src.name = CREATE phony.c
phony_src.CONFIG += combine
QMAKE_EXTRA_COMPILERS += phony_src
}
QDOC_BIN = $$[QT_INSTALL_BINS]/qdoc3
equals(QMAKE_DIR_SEP, /) { # unix, mingw+msys
QDOC = SRCDIR=$$PWD OUTDIR=$$OUT_PWD/html $$QDOC_BIN
} else:win32-g++* { # just mingw
# The lack of spaces in front of the && is necessary!
QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$OUT_PWD/html&& $$QDOC_BIN
} else { # nmake
QDOC = set SRCDIR=$$PWD $$escape_expand(\\n\\t) \
set OUTDIR=$$OUT_PWD/html $$escape_expand(\\n\\t) \
$$QDOC_BIN
}
HELP_FILES = $$PWD/qtcreator-api.qdocconf
HELP_DEP_FILES = $$PWD/qtcreator-api.qdoc \
$$PWD/../qt-defines.qdocconf \
$$PWD/../qt-html-templates.qdocconf \
$$PWD/qtcreator-api.qdocconf
docs.name = CREATE API DOC
docs.input = HELP_FILES
docs.output = $$OUT_PWD/index.html
docs.depends = $$HELP_DEP_FILES
win32:docs.commands = $$QDOC \"${QMAKE_FILE_IN}\"
unix:docs.commands = $$QDOC ${QMAKE_FILE_IN}
docs.CONFIG += no_link
isEmpty(vcproj):docs.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += docs
TEMPLATE = app
TARGET = pluginhowto
CONFIG -= qt
QT =
LIBS =
macx:CONFIG -= app_bundle
isEmpty(vcproj) {
QMAKE_LINK = @: IGNORE THIS LINE
OBJECTS_DIR =
win32:CONFIG -= embed_manifest_exe
} else {
CONFIG += console
PHONY_DEPS = .
phony_src.input = PHONY_DEPS
phony_src.output = phony.c
phony_src.variable_out = GENERATED_SOURCES
phony_src.commands = echo int main() { return 0; } > phony.c
phony_src.name = CREATE phony.c
phony_src.CONFIG += combine
QMAKE_EXTRA_COMPILERS += phony_src
}
QDOC_BIN = $$[QT_INSTALL_BINS]/qdoc3
equals(QMAKE_DIR_SEP, /) { # unix, mingw+msys
QDOC = SRCDIR=$$PWD OUTDIR=$$OUT_PWD/html $$QDOC_BIN
} else:win32-g++* { # just mingw
# The lack of spaces in front of the && is necessary!
QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$OUT_PWD/html&& $$QDOC_BIN
} else { # nmake
QDOC = set SRCDIR=$$PWD $$escape_expand(\\n\\t) \
set OUTDIR=$$OUT_PWD/html $$escape_expand(\\n\\t) \
$$QDOC_BIN
}
HELP_FILES = $$PWD/qtcreator-pluginhowto.qdocconf
HELP_DEP_FILES = $$PWD/adv-find-filter.qdoc \
$$PWD/editor-type.qdoc \
$$PWD/find-filter.qdoc \
$$PWD/find-support.qdoc \
$$PWD/first-plugin.qdoc \
$$PWD/location-filter.qdoc \
$$PWD/menu.qdoc \
$$PWD/mode.qdoc \
$$PWD/nav-widget.qdoc \
$$PWD/pref-pane.qdoc \
$$PWD/progress.qdoc \
$$PWD/project-file-wizard.qdoc \
$$PWD/qtc-arch.qdoc \
$$PWD/qtc-project-plugin.qdoc \
$$PWD/qtcreator-compile.qdoc \
$$PWD/qtcreator-pluginhowto.qdoc \
$$PWD/vcs.qdoc \
$$PWD/../qt-defines.qdocconf \
$$PWD/../qt-html-templates.qdocconf \
$$PWD/qtcreator-pluginhowto.qdocconf
docs.name = CREATE API DOC
docs.input = HELP_FILES
docs.output = $$OUT_PWD/index.html
docs.depends = $$HELP_DEP_FILES
win32:docs.commands = $$QDOC \"${QMAKE_FILE_IN}\"
unix:docs.commands = $$QDOC ${QMAKE_FILE_IN}
docs.CONFIG += no_link
isEmpty(vcproj):docs.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += docs
project = Qt Creator Plugin HOWTO API
# Run qdoc from the directory that contains this file.
include(../qt-html-templates.qdocconf)
project = Qt Creator Plugin HOWTO
description = Qt Creator Plugin HOWTO Documentation
language = Cpp
headerdirs =
sourcedirs = $SRCDIR
imagedirs = $SRCDIR/images $SRCDIR/templates/images
outputdir = $OUTDIR
exampledirs = $SRCDIR
indexes = ../qt.index
sources.fileextensions = "*.qdoc"
sourcedirs = .
include(../qt-defines.qdocconf)
imagedirs = images
sources.fileextensions = *.qdoc
indexes = $QTDIR/doc/html/qt.index
# macros.qdocconf
outputdir = ./html
base = file:./html
versionsym = 1.3.1
codeindent = 1
tabsize = 4
macro.aring.HTML = "å"
macro.Auml.HTML = "Ä"
macro.author = "\\bold{Author:}"
macro.br.HTML = "<br />"
macro.BR.HTML = "<br />"
macro.aacute.HTML = "&aacute;"
macro.eacute.HTML = "&eacute;"
macro.iacute.HTML = "&iacute;"
macro.gui = "\\bold"
macro.hr.HTML = "<hr />"
macro.key = "\\bold"
macro.menu = "\\bold"
macro.note = "\\bold{Note:}"
macro.oslash.HTML = "&oslash;"
macro.ouml.HTML = "&ouml;"
macro.QA = "\\e{Qt Assistant}"
macro.QD = "\\e{Qt Designer}"
macro.QL = "\\e{Qt Linguist}"
macro.QC = "\\e{Qt Creator}"
macro.QMLD = "\\e{Qt Quick Designer}"
macro.QQV = "\\e{Qt QML Viewer}"
macro.param = "\\e"
macro.raisedaster.HTML = "<sup>*</sup>"
macro.reg.HTML = "<sup>&reg;</sup>"
macro.return = "Returns"
macro.starslash = "\\c{*/}"
macro.uuml.HTML = "&uuml;"
macro.mdash.HTML = "&mdash;"
## compat.qdocconf
alias.i = e
alias.include = input
# compat.qdocconf
alias.i = e
alias.include = input
macro.0 = "\\\\0"
macro.b = "\\\\b"
......@@ -44,40 +75,16 @@ macro.i81 = "\\o{8,1}"
macro.i91 = "\\o{9,1}"
macro.img = "\\image"
macro.endquote = "\\endquotation"
macro.relatesto = "\\relates"
spurious = "Missing comma in .*" \
"Missing pattern .*"
spurious = "Missing comma in .*" \
"Missing pattern .*"
# Doxygen compatibility commands
## macros.qdocconf
macro.aring.HTML = "&aring;"
macro.Auml.HTML = "&Auml;"
macro.author = "\\bold{Author:}"
macro.br.HTML = "<br />"
macro.BR.HTML = "<br />"
macro.aacute.HTML = "&aacute;"
macro.eacute.HTML = "&eacute;"
macro.iacute.HTML = "&iacute;"
macro.gui = "\\bold"
macro.hr.HTML = "<hr />"
macro.key = "\\bold"
macro.menu = "\\bold"
macro.note = "\\bold{Note:}"
macro.oslash.HTML = "&oslash;"
macro.ouml.HTML = "&ouml;"
macro.QA = "\\e{Qt Assistant}"
macro.QD = "\\e{Qt Designer}"
macro.QL = "\\e{Qt Linguist}"
macro.QC = "\\e{Qt Creator}"
macro.param = "\\e"
macro.raisedaster.HTML = "<sup>*</sup>"
macro.reg.HTML = "<sup>&reg;</sup>"
macro.return = "Returns"
macro.starslash = "\\c{*/}"
macro.uuml.HTML = "&uuml;"
macro.mdash.HTML = "&mdash;"
macro.see = "\\sa"
macro.function = "\\fn"
# qt-cpp-ignore.qdocconf
## qt-cpp-ignore.qdocconf
Cpp.ignoretokens = QAXFACTORY_EXPORT \
QDESIGNER_COMPONENTS_LIBRARY \
QDESIGNER_EXTENSION_LIBRARY \
......@@ -112,7 +119,6 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \
Q_EXPORT_CODECS_KR \
Q_EXPORT_PLUGIN \
Q_GFX_INLINE \
Q_AUTOTEST_EXPORT \
Q_GUI_EXPORT \
Q_GUI_EXPORT_INLINE \
Q_GUI_EXPORT_STYLE_CDE \
......@@ -134,7 +140,6 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \
Q_SQL_EXPORT \
Q_SVG_EXPORT \
Q_SCRIPT_EXPORT \
Q_SCRIPTTOOLS_EXPORT \
Q_TESTLIB_EXPORT \
Q_TYPENAME \
Q_XML_EXPORT \
......@@ -145,7 +150,8 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \
QT_BEGIN_INCLUDE_NAMESPACE \
QT_END_NAMESPACE \
QT_END_INCLUDE_NAMESPACE \
PHONON_EXPORT
PHONON_EXPORT \
EXTENSIONSYSTEM_EXPORT
Cpp.ignoredirectives = Q_DECLARE_HANDLE \
Q_DECLARE_INTERFACE \
Q_DECLARE_METATYPE \
......@@ -166,56 +172,3 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \
PHONON_OBJECT \
PHONON_HEIR
## qt-html-templates.qdocconf
HTML.stylesheets = classic.css
HTML.postheader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n" \
"<tr>\n" \
"<td align=\"left\" valign=\"top\" width=\"32\">" \
"<a href=\"http://www.trolltech.com/products/qt\"><img src=\"images/qt-logo.png\" align=\"left\" border=\"0\" /></a>" \
"</td>\n" \
"<td width=\"1\">&nbsp;&nbsp;</td>" \
"<td class=\"postheader\" valign=\"center\">" \
"<a href=\"index.html\">" \
"<font color=\"#004faf\">Home</font></a>&nbsp;&middot;" \
" <a href=\"namespaces.html\">" \
"<font color=\"#004faf\">All&nbsp;Namespaces</font></a>&nbsp;&middot;" \
" <a href=\"classes.html\">" \
"<font color=\"#004faf\">All&nbsp;Classes</font></a>&nbsp;&middot;" \
" <a href=\"mainclasses.html\">" \
"<font color=\"#004faf\">Main&nbsp;Classes</font></a>&nbsp;&middot;" \
" <a href=\"groups.html\">" \
"<font color=\"#004faf\">Grouped&nbsp;Classes</font></a>&nbsp;&middot;" \
" <a href=\"modules.html\">" \
"<font color=\"#004faf\">Modules</font></a>&nbsp;&middot;" \
" <a href=\"functions.html\">" \
"<font color=\"#004faf\">Functions</font></a>" \
"</td>\n" \
"<td align=\"right\" valign=\"top\" width=\"230\"></td></tr></table>"
HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
"<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation " \
"and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \
"<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Creator Plugin HOWTO\\version</div></td>\n" \
"</tr></table></div></address>"
## qt-defines.qdocconf
defines = Q_QDOC \
QT_.*_SUPPORT \
QT_.*_LIB \
QT_COMPAT \
QT_KEYPAD_NAVIGATION \
QT3_SUPPORT \
Q_WS_.* \
Q_OS_.* \
Q_BYTE_ORDER \
QT_DEPRECATED \
Q_NO_USING_KEYWORD \
__cplusplus
# Files not referenced in any qdoc file (last four needed by qtdemo)
# See also qhp.Qt.extraFiles
extraimages.HTML = qt-logo \
trolltech-logo
/* START non link areas where cursor should change to pointing hand */
$('.t_button').mouseover(function() {
$('.t_button').css('cursor','pointer');
/*document.getElementById(this.id).style.cursor='pointer';*/
});
/* END non link areas */
$('#smallA').click(function() {
$('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller');
$('.t_button').removeClass('active')
$(this).addClass('active')
});
$('#medA').click(function() {
$('.content .heading').css('font','600 16px/1 Arial');
$('.content h1').css('font','600 18px/1.2 Arial');
$('.content h2').css('font','600 16px/1.2 Arial');
$('.content h3').css('font','600 14px/1.2 Arial');
$('.content p').css('font','13px/20px Verdana');
$('.content li').css('font','400 13px/1 Verdana');
$('.content li').css('line-height','14px');
$('.content .toc li').css('font', 'normal 10px/1.2 Verdana');
$('.content table').css('font','13px/1.2 Verdana');
$('.content .heading').css('font','600 16px/1 Arial');
$('.content .indexboxcont li').css('font','600 13px/1 Verdana');
$('.t_button').removeClass('active')
$(this).addClass('active')
});
$('#bigA').click(function() {
$('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','large');
$('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('line-height','25px');
$('.t_button').removeClass('active')
$(this).addClass('active')
});
$('.feedclose').click(function() {
$('.bd').show();
$('.hd').show();
$('.footer').show();
$('#feedbackBox').hide();
$('#blurpage').hide();
});
$('.feedback').click(function() {
$('.bd').hide();
$('.hd').hide();
$('.footer').hide();
$('#feedbackBox').show();
$('#blurpage').show();
});
var lookupCount = 0;
var articleCount = 0;
var exampleCount = 0;
var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links
function processNokiaData(response){
var propertyTags = response.getElementsByTagName('page');
for (var i=0; i< propertyTags.length; i++) {
var linkStart = "<li class=\"liveResult\"><a href='"+qturl+"";
var linkEnd = "</a></li>";
if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){
lookupCount++;
for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
full_li_element = full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd;
$('#ul001').append(full_li_element);
$('#ul001 .defaultLink').css('display','none');
}
}
if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){
articleCount++;
for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ;
$('#ul002').append(full_li_element);
$('#ul002 .defaultLink').css('display','none');
}
}
if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){
exampleCount++;
for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ;
$('#ul003').append(full_li_element);
$('#ul003 .defaultLink').css('display','none');
}
}
if(i==propertyTags.length){$('#pageType').removeClass('loading');}
}
if(lookupCount == 0){$('#ul001').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');}
if(articleCount == 0){$('#ul002').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul002 li').css('display','block');}
if(exampleCount == 0){$('#ul003').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul003 li').css('display','block');}
// reset count variables;
lookupCount=0;
articleCount = 0;
exampleCount = 0;
}
//build regular expression object to find empty string or any number of blank
var blankRE=/^\s*$/;
function CheckEmptyAndLoadList()
{
var pageUrl = window.location.href;
var pageVal = $('title').html();
$('#feedUrl').remove();
$('#pageVal').remove();
$('#feedform').append('<input id="feedUrl" name="feedUrl" value="'+pageUrl+'" style="display:none;">');
$('#feedform').append('<input id="pageVal" name="pageVal" value="'+pageVal+'" style="display:none;">');
$('.liveResult').remove();
$('.defaultLink').css('display','block');
var value = document.getElementById('pageType').value;
if((blankRE.test(value)) || (value.length < 3))
{
//empty inputbox
// load default li elements into the ul if empty
// loadAllList(); // replaced
$('.defaultLink').css('display','block');
// $('.liveResult').css('display','none');
}else{
$('.defaultLink').css('display','none');
}
}
/*
$(window).resize(function(){
if($(window).width()<400)
$('body').addClass('offline');
else
$('body').removeClass('offline');
});
*/
// Loads on doc ready
$(document).ready(function () {
//alert(pageUrl);
//$('#pageUrl').attr('foo',pageUrl);
var pageTitle = $('title').html();
var currentString = $('#pageType').val() ;
if(currentString.length < 1){
$('.defaultLink').css('display','block');
CheckEmptyAndLoadList();
}
$('#pageType').keyup(function () {
var searchString = $('#pageType').val() ;
if ((searchString == null) || (searchString.length < 3)) {
$('#pageType').removeClass('loading');
$('.liveResult').remove(); // replaces removeResults();
CheckEmptyAndLoadList();
$('.report').remove();
// debug$('.content').prepend('<li>too short or blank</li>'); // debug
return;
}
if (this.timer) clearTimeout(this.timer);
this.timer = setTimeout(function () {
$('#pageType').addClass('loading');
// debug$('.content').prepend('<li>new search started </li>');// debug
// debug$('.content').prepend('<p class=\"report\">Search string ' +searchString +'</p>'); // debug
$.ajax({
contentType: "application/x-www-form-urlencoded",
url: 'http://' + location.host + '/nokiasearch/GetDataServlet',
data: 'searchString='+searchString,
dataType:'xml',
type: 'post',
success: function (response, textStatus) {
$('.liveResult').remove(); // replaces removeResults();
$('#pageType').removeClass('loading');
processNokiaData(response);
}
});
}, 500);
});
});
This diff is collapsed.
var narrowInit = function() {
/* TODO:
Could probably be more efficient, not hardcoding each element to be created
*/
// 1: Create search form
var narrowSearch = $('<div id="narrowsearch"></div>');
var searchform = $("#qtdocsearch");
narrowSearch.append(searchform);
$("#qtdocheader .content .qtref").after(narrowSearch);
// 2: Create dropdowns
var narrowmenu = $('<ul id="narrowmenu" class="sf-menu"></ul>');
// Lookup
var lookuptext = $("#lookup h2").attr("title");
$("#lookup ul").removeAttr("id");
$("#lookup ul li").removeAttr("class");
$("#lookup ul li").removeAttr("style");
var lookupul = $("#lookup ul");
var lookuplist = $('<li></li>');
var lookuplink = $('<a href="#"></a>');
lookuplink.append(lookuptext);
lookuplist.append(lookuplink);
lookuplist.append(lookupul);
narrowmenu.append