Commit 98e25c56 authored by Guillaume Lazzara's avatar Guillaume Lazzara Committed by Roland Levillain
Browse files

demo/xml2doc/main.cc: Add --template-path option.


Signed-off-by: Roland Levillain's avatarRoland Levillain <roland@lrde.epita.fr>
parent eefb756c
2013-04-18 Guillaume Lazzara <z@lrde.epita.fr>
* demo/xml2doc/main.cc: Add --template-path option.
2014-06-20 Roland Levillain <roland@lrde.epita.fr> 2014-06-20 Roland Levillain <roland@lrde.epita.fr>
Remove useless parts from the Scribo documentation machinery. Remove useless parts from the Scribo documentation machinery.
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "datarootdir.hh" #include "datarootdir.hh"
static QString template_path;
void check_xsltproc() void check_xsltproc()
{ {
...@@ -42,7 +44,11 @@ void check_xsltproc() ...@@ -42,7 +44,11 @@ void check_xsltproc()
QString get_datarootdir(const QString& file) QString get_datarootdir(const QString& file)
{ {
QFile f(SCRIBO_LOCAL_DATAROOTDIR "/templates/" + file); QFile f(template_path + "/templates/" + file);
if (f.exists())
return template_path + "/templates/";
f.setFileName(SCRIBO_LOCAL_DATAROOTDIR "/templates/" + file);
if (f.exists()) if (f.exists())
return SCRIBO_LOCAL_DATAROOTDIR "/templates/"; return SCRIBO_LOCAL_DATAROOTDIR "/templates/";
...@@ -90,7 +96,7 @@ int svg_base64(const QString& xml, const QString& svg) ...@@ -90,7 +96,7 @@ int svg_base64(const QString& xml, const QString& svg)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
QString man = \ QString man = \
"xml_transform\n" "Usage: scribo-xml2doc [--template-path <dir>] [OPTIONS]\n"
"OPTIONS:\n\n" "OPTIONS:\n\n"
"HTML output:\n" "HTML output:\n"
...@@ -138,8 +144,23 @@ int main(int argc, char **argv) ...@@ -138,8 +144,23 @@ int main(int argc, char **argv)
QString option(argv[1]); QString option(argv[1]);
if (argc > 4) if (argc == 5 || argc == 7)
{ {
if (argc == 7)
{
if ("--template-path" == option)
{
template_path = argv[2];
argv += 2;
option = QString(argv[1]);
}
else
{
qDebug() << man;
return 1;
}
}
if ("--html-full" == option) if ("--html-full" == option)
{ {
check_xsltproc(); check_xsltproc();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment