Some doc enhancements.

This commit is contained in:
Matthias Koefferlein 2017-10-01 22:21:01 +02:00
parent 580ed1ec6d
commit 44d2ea5c25
3 changed files with 25 additions and 21 deletions

View File

@ -4,9 +4,9 @@
<doc>
<title>About Packages</title>
<keyword>Packages Manager</keyword>
<keyword>Packages</keyword>
<keyword>Salt</keyword>
<keyword name="Package Manager"/>
<keyword name="Packages"/>
<keyword name="Salt"/>
<p>
"Salt" is KLayout's package manager which allows selecting and installing packages from a global repository.
@ -30,7 +30,7 @@
<p>
Packages are identified by name. A package name needs to be unique in the package universe.
You can use a prefixed name like "www.mydomain.org/nameofpackage" to create a non-ambiguous name.
You can use a prefixed name like <tt>www.mydomain.org/nameofpackage</tt> to create a non-ambiguous name.
The choice of the prefix is entirely up to you. You can use a domain name that is owned by
yourself for example.
</p>
@ -51,7 +51,7 @@
<p>
The key component for the package repository is the "Salt.Mine" package repository
service (sami.klayout.org). It is a web service that maintains a package list. It
service (<tt>sami.klayout.org</tt>). It is a web service that maintains a package list. It
does not host the packages, but stores links to the actual hosting site. In order
to author a package, you need to upload the package to one of the supported host
sites and register your package on the Salt.Mine page. Registration is a simple
@ -83,7 +83,7 @@
Packages are published on the Salt.Mine server. This is a web service that delivers a
complete list of packages plus a little meta data such as current version, the icon
and a brief description. KLayout will download this list from
"http://sami.klayout.org/repository.xml" by default. You can set the KLAYOUT_SALT_MINE
<tt>http://sami.klayout.org/repository.xml</tt> by default. You can set the <tt>KLAYOUT_SALT_MINE</tt>
environment variable to a different URL which makes KLayout use another repository
service, i.e. one inside your own organisation. This service can be any HTTP server
that delivers a package list in the same format than the Salt.Mine package service.

View File

@ -102,7 +102,7 @@ Class<lay::HelpSource> decl_HelpSource (laybasicdecl_BrowserSource (), "HelpSour
gsi::method ("title_for", &lay::HelpSource::title_for, gsi::arg ("path"), "@brief Reserved internal use") +
gsi::method ("parent_of", &lay::HelpSource::parent_of, gsi::arg ("path"), "@brief Reserved internal use") +
gsi::method ("create_index_file", &lay::HelpSource::create_index_file, gsi::arg ("path"), "@brief Reserved internal use"),
"@brief A \\BrowserSource implementation delivering the help text for the help dialog\n"
"@brief A BrowserSource implementation delivering the help text for the help dialog\n"
"This class can be used together with a \\BrowserPanel or \\BrowserDialog object to implement "
"custom help systems.\n"
"\n"

View File

@ -143,15 +143,6 @@ struct DocumentationParser
DocumentationParser (const gsi::MethodBase *method)
{
std::string doc = method->doc ();
if (pya::PythonInterpreter::instance ()) {
std::string pydoc = pya::PythonInterpreter::instance ()->python_doc (method);
if (! pydoc.empty ()) {
doc += "\n@<h4>\n";
doc += tl::to_string (QObject::tr ("Python specific notes:\n"));
doc += "@</h4>\n\n";
doc += pydoc;
}
}
parse_doc (doc);
}
@ -1195,17 +1186,27 @@ GSIHelpProvider::produce_class_doc (const std::string &cls) const
const gsi::MethodBase::MethodSynonym &syn = i->second.first->begin_synonyms () [i->second.second];
DocumentationParser method_doc (i->second.first);
std::string pydoc;
if (pya::PythonInterpreter::instance ()) {
pydoc = pya::PythonInterpreter::instance ()->python_doc (i->second.first);
}
os << "<a name=\"method" << n << "\"/>"
<< "<a name=\"m_" << escape_xml (i->first) << "\"/>"
<< "<keyword title=\"" << tl::to_string (QObject::tr ("API reference - Class")) << " " << escape_xml (cls) << ", " << tl::to_string (QObject::tr ("Method")) << " " << escape_xml (i->first) << "\" name=\"" << escape_xml (cls) << "#" << escape_xml (i->first) << "\"/>" << std::endl;
os << "<tr><td>";
os << "<tr>";
if (i->first != prev_title) {
int rows = 0;
for (std::multimap <std::string, std::pair<const gsi::MethodBase *, size_t> >::const_iterator j = i; j != mm.end () && j->first == i->first; ++j) {
++rows;
}
os << "<td rowspan=\"" << rows << "\">";
os << "<h3>" << escape_xml (i->first) << "</h3>" << std::endl;
prev_title = i->first;
os << "</td>";
}
os << "</td><td style=\"padding-bottom: 16px\">";
os << "<td style=\"padding-bottom: 16px\">";
os << "<p><b>" << tl::to_string (QObject::tr ("Signature")) << "</b>: ";
std::string attr = method_attributes (i->second.first, method_doc);
@ -1215,8 +1216,6 @@ GSIHelpProvider::produce_class_doc (const std::string &cls) const
os << method_return (i->second.first, method_doc, true) << " <b> " << escape_xml (i->first) << " </b> " << method_arguments (i->second.first, cls_obj, method_doc, true, "");
os << "</p>" << std::endl;
os << "<div style=\"margin-left: 10px\">";
os << "<p><b>" << tl::to_string (QObject::tr ("Description")) << "</b>: " << replace_references (escape_xml (method_doc.brief_doc), cls_obj) << "</p>" << std::endl;
if (! method_doc.params.empty () || ! method_doc.ret_val.empty ()) {
@ -1250,7 +1249,12 @@ GSIHelpProvider::produce_class_doc (const std::string &cls) const
}
}
os << "</div>";
if (! pydoc.empty ()) {
os << "<p><b>";
os << tl::to_string (QObject::tr ("Python specific notes:"));
os << "</b><br/>" << escape_xml (pydoc) << "</p>" << std::endl;
}
os << "</td></tr>";
}