[kde-doc-english] [kdoctools] /: Remove support for htdig index generation from meinproc
Luigi Toscano
luigi.toscano at tiscali.it
Thu Mar 27 20:46:24 UTC 2014
Git commit e44d403cd9f2e37816493cc8c2a354cfb6f071ef by Luigi Toscano.
Committed on 27/03/2014 at 00:40.
Pushed by ltoscano into branch 'master'.
Remove support for htdig index generation from meinproc
htdig indexing and search in kcan be replaced by something else
more supported and developed (Xapian, maybe with Baloo for
searching?)
M +0 -8 docs/meinproc5/man-meinproc5.8.docbook
D +0 -59 src/customization/htdig_index.xsl
M +10 -51 src/meinproc.cpp
http://commits.kde.org/kdoctools/e44d403cd9f2e37816493cc8c2a354cfb6f071ef
diff --git a/docs/meinproc5/man-meinproc5.8.docbook b/docs/meinproc5/man-meinproc5.8.docbook
index 7b4c535..be6d683 100644
--- a/docs/meinproc5/man-meinproc5.8.docbook
+++ b/docs/meinproc5/man-meinproc5.8.docbook
@@ -61,7 +61,6 @@ Also, based on the information from http://olympus.het.brown.edu/cgi-bin/man/man
<arg choice="opt">KDE-options</arg>
<arg choice="opt">--cache<replaceable> file</replaceable></arg>
<arg choice="opt">--check</arg>
-<arg choice="opt">--htdig</arg>
<arg choice="opt">--srcdir</arg>
<arg choice="opt">--param <replaceable>key</replaceable>=<replaceable>value</replaceable></arg>
@@ -183,13 +182,6 @@ The trick is to look at the first error, fix that error, save the file, and run
</varlistentry>
<varlistentry>
-<term><option>--htdig</option></term>
-<listitem>
-<para>Create a ht://dig compatible index</para>
-</listitem>
-</varlistentry>
-
-<varlistentry>
<term><option>-o</option>, <option>--output</option><parameter> file</parameter></term>
<listitem>
<para>
diff --git a/src/customization/htdig_index.xsl b/src/customization/htdig_index.xsl
deleted file mode 100644
index 7aa9113..0000000
--- a/src/customization/htdig_index.xsl
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version='1.0'>
-
-<xsl:template match="*">
- <!-- xsl:message>
- <xsl:text>No template matches </xsl:text>
- <xsl:value-of select="name(.)"/>
- <xsl:text>.</xsl:text>
- </xsl:message -->
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="keywordset/keyword">
- <entry header="10">
- <xsl:apply-templates/>
- </entry>
-</xsl:template>
-
-<xsl:template match="book/title|bookinfo/title|abstract">
- <entry header="5">
- <xsl:apply-templates/>
- </entry>
-</xsl:template>
-
-<xsl:template match="chapter/title">
- <entry header="4">
- <xsl:apply-templates/>
- </entry>
-</xsl:template>
-
-<xsl:template match="sect1/title">
- <entry header="3">
- <xsl:apply-templates/>
- </entry>
-</xsl:template>
-
-<xsl:template match="sect*/title|emphasis">
- <entry header="2">
- <xsl:apply-templates/>
- </entry>
-</xsl:template>
-
-<xsl:template match="application|guilabel|guiicon|menuchoice|guibutton|guisubmenu|guimenuitem|term|guimenu|literal|acronym">
- <entry header="1">
- <xsl:apply-templates/>
- </entry>
-</xsl:template>
-
-<xsl:template match="book">
- <entry header="0">
- <xsl:apply-templates/>
- </entry>
-</xsl:template>
-
-<xsl:template match="date|releaseinfo|anchor|imagedata">
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/src/meinproc.cpp b/src/meinproc.cpp
index a7b2e07..08c1cea 100644
--- a/src/meinproc.cpp
+++ b/src/meinproc.cpp
@@ -108,7 +108,6 @@ int main(int argc, char **argv)
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("stylesheet"), QCoreApplication::translate("main", "Stylesheet to use"), QStringLiteral("xsl")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("stdout"), QCoreApplication::translate("main", "Output whole document to stdout")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("o") << QStringLiteral("output"), QCoreApplication::translate("main", "Output whole document to file"), QStringLiteral("file")));
- parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("htdig"), QCoreApplication::translate("main", "Create a ht://dig compatible index")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("check"), QCoreApplication::translate("main", "Check the document for validity")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("cache"), QCoreApplication::translate("main", "Create a cache file for the document"), QStringLiteral("file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("srcdir"), QCoreApplication::translate("main", "Set the srcdir, for kdelibs"), QStringLiteral("dir")));
@@ -190,14 +189,10 @@ int main(int argc, char **argv)
}
params.append(NULL);
- bool index = parser.isSet(QStringLiteral("htdig"));
QString tss = parser.value(QStringLiteral("stylesheet"));
if (tss.isEmpty()) {
tss = QStringLiteral("customization/kde-chunk.xsl");
}
- if (index) {
- tss = QStringLiteral("customization/htdig_index.xsl");
- }
QString tssPath = locateFileInDtdResource(tss);
if (tssPath.isEmpty()) {
@@ -214,57 +209,21 @@ int main(int argc, char **argv)
const bool usingOutput = parser.isSet(QStringLiteral("output"));
const QString outputOption = parser.value(QStringLiteral("output"));
- if (index) {
- xsltStylesheetPtr style_sheet =
- xsltParseStylesheetFile((const xmlChar *)tssPath.toLatin1().data());
-
- if (style_sheet != NULL) {
-
- xmlDocPtr doc = xmlParseFile(QFile::encodeName(checkFilename).constData());
-
- xmlDocPtr res = xsltApplyStylesheet(style_sheet, doc, ¶ms[0]);
-
- xmlFreeDoc(doc);
- xsltFreeStylesheet(style_sheet);
- if (res != NULL) {
- xmlNodePtr cur = xmlDocGetRootElement(res);
- if (!cur || xmlStrcmp(cur->name, (const xmlChar *) "entry")) {
- xmlFreeDoc(res);
- DIE("Document of the wrong type, root node != entry");
- }
- PairList list;
- parseEntry(list, cur, 0);
- int wi = 0;
- for (PairList::ConstIterator it = list.constBegin(); it != list.constEnd();
- ++it, ++wi)
- fprintf(stdout, "w\t%s\t%d\t%d\n", (*it).word.toUtf8().data(),
- 1000 * wi / list.count(), (*it).base);
-
- xmlFreeDoc(res);
- } else {
- DIE("Unable to parse document" << checkFilename);
- }
- } else {
- DIE("Unable to parse style sheet" << tssPath);
- }
-
- } else {
- QString output = transform(checkFilename, tssPath, params);
- if (output.isEmpty()) {
- DIE("Unable to parse" << checkFilename);
- }
+ QString output = transform(checkFilename, tssPath, params);
+ if (output.isEmpty()) {
+ DIE("Unable to parse" << checkFilename);
+ }
#ifndef MEINPROC_NO_KARCHIVE
- if (!cache.isEmpty()) {
- if (!saveToCache(output, cache)) {
- qWarning() << QCoreApplication::translate("main", "Could not write to cache file %1.").arg(cache);
- }
- goto end;
+ if (!cache.isEmpty()) {
+ if (!saveToCache(output, cache)) {
+ qWarning() << QCoreApplication::translate("main", "Could not write to cache file %1.").arg(cache);
}
+ goto end;
+ }
#endif
- doOutput(output, usingStdOut, usingOutput, outputOption, true /* replaceCharset */);
- }
+ doOutput(output, usingStdOut, usingOutput, outputOption, true /* replaceCharset */);
#ifndef MEINPROC_NO_KARCHIVE
end:
#endif
More information about the kde-doc-english
mailing list