From 44d2ea5c25648a12368a7d6eb3f909a62ce82ddb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 1 Oct 2017 22:21:01 +0200 Subject: [PATCH] Some doc enhancements. --- src/lay/lay/doc/about/packages.xml | 12 +++++------ src/lay/lay/gsiDeclLayHelpDialog.cc | 2 +- src/lay/lay/layGSIHelpProvider.cc | 32 ++++++++++++++++------------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/lay/lay/doc/about/packages.xml b/src/lay/lay/doc/about/packages.xml index 89ffea698..aa9f8c4c6 100644 --- a/src/lay/lay/doc/about/packages.xml +++ b/src/lay/lay/doc/about/packages.xml @@ -4,9 +4,9 @@ About Packages - Packages Manager - Packages - Salt + + +

"Salt" is KLayout's package manager which allows selecting and installing packages from a global repository. @@ -30,7 +30,7 @@

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 www.mydomain.org/nameofpackage 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.

@@ -51,7 +51,7 @@

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 (sami.klayout.org). 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 + http://sami.klayout.org/repository.xml by default. You can set the KLAYOUT_SALT_MINE 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. diff --git a/src/lay/lay/gsiDeclLayHelpDialog.cc b/src/lay/lay/gsiDeclLayHelpDialog.cc index 6de1461a9..b02345a09 100644 --- a/src/lay/lay/gsiDeclLayHelpDialog.cc +++ b/src/lay/lay/gsiDeclLayHelpDialog.cc @@ -102,7 +102,7 @@ Class 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" diff --git a/src/lay/lay/layGSIHelpProvider.cc b/src/lay/lay/layGSIHelpProvider.cc index 08637a407..6853a514c 100644 --- a/src/lay/lay/layGSIHelpProvider.cc +++ b/src/lay/lay/layGSIHelpProvider.cc @@ -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@

\n"; - doc += tl::to_string (QObject::tr ("Python specific notes:\n")); - doc += "@

\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 << "" << "first) << "\"/>" << "first) << "\" name=\"" << escape_xml (cls) << "#" << escape_xml (i->first) << "\"/>" << std::endl; - os << ""; + os << ""; if (i->first != prev_title) { + int rows = 0; + for (std::multimap >::const_iterator j = i; j != mm.end () && j->first == i->first; ++j) { + ++rows; + } + os << ""; os << "

" << escape_xml (i->first) << "

" << std::endl; prev_title = i->first; + os << ""; } - os << ""; + os << ""; os << "

" << tl::to_string (QObject::tr ("Signature")) << ": "; 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) << " " << escape_xml (i->first) << " " << method_arguments (i->second.first, cls_obj, method_doc, true, ""); os << "

" << std::endl; - os << "
"; - os << "

" << tl::to_string (QObject::tr ("Description")) << ": " << replace_references (escape_xml (method_doc.brief_doc), cls_obj) << "

" << 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 << "
"; + if (! pydoc.empty ()) { + os << "

"; + os << tl::to_string (QObject::tr ("Python specific notes:")); + os << "
" << escape_xml (pydoc) << "

" << std::endl; + } + os << ""; }