Salome HOME
Reconfigure generation of the documentation to be able to merge documentations of...
authorazv <azv@opencascade.com>
Fri, 19 Feb 2021 21:06:16 +0000 (00:06 +0300)
committerazv <azv@opencascade.com>
Tue, 28 Dec 2021 19:25:01 +0000 (22:25 +0300)
src/Config/Config_FeatureReader.cpp
src/Config/Config_FeatureReader.h
src/Config/Config_Keywords.h
src/Config/Config_ModuleReader.cpp
src/Config/Config_ModuleReader.h

index 5f397d63842790722ab0d1ed789086cdc7e5c72a..3d53a63d604873b234866534bb79e555a1206617 100644 (file)
 
 Config_FeatureReader::Config_FeatureReader(const std::string& theXmlFile,
                                            const std::string& theLibraryName,
+                                           const std::string& theDocSection,
                                            const char* theEventGenerated)
     : Config_XMLReader(theXmlFile),
       myLibraryName(theLibraryName),
+      myLibraryDocSection(theDocSection),
       myEventGenerated(theEventGenerated ? theEventGenerated : Config_FeatureMessage::GUI_EVENT()),
       myIsProcessWidgets(theEventGenerated != NULL)
 {
@@ -176,8 +178,11 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode,
   outFeatureMessage->setInternal(isInternal);
 
   std::string aHelpFile = getProperty(theFeatureNode, HELP_FILE);
-  if (!aHelpFile.empty())
-    outFeatureMessage->setHelpFileName(myLibraryName + "/" + aHelpFile);
+  if (!aHelpFile.empty()) {
+    aHelpFile =
+      (myLibraryDocSection.empty() ? myLibraryName : myLibraryDocSection) + "/" + aHelpFile;
+    outFeatureMessage->setHelpFileName(aHelpFile);
+  }
 
   bool isHideFaces = getBooleanAttribute(theFeatureNode, HIDEFACES_PANEL, false);
   outFeatureMessage->setHideFacesPanel(isHideFaces);
index 015090889c6cd075c05bc33a9a535b0e7dd85d22..e3d1098f9e8e419dd3a41765474610186dc058d6 100644 (file)
@@ -40,6 +40,7 @@ class Config_FeatureReader : public Config_XMLReader
   /// Constructor
   Config_FeatureReader(const std::string& theXmlFile,
                        const std::string& theLibraryName,
+                       const std::string& theDocSection = std::string(),
                        const char* theEventGenerated = 0);
   virtual ~Config_FeatureReader();
   /// Returns list of all features defined in reader's file
@@ -61,6 +62,7 @@ class Config_FeatureReader : public Config_XMLReader
 
  private:
   std::string myLibraryName;
+  std::string myLibraryDocSection;
 
   std::list<std::string> myFeatures;
   /// event generated on feature data sending, by default it is Config_FeatureMessage::GUI_EVENT()
index 9774c3519516e628d846c0fb4d46f0d7a52693a2..cfbbcc2a1149851f320fd9bbaf8db2c384717eb4 100644 (file)
@@ -145,6 +145,7 @@ MAYBE_UNUSED const static char* PLUGIN_LIBRARY = "library";
 MAYBE_UNUSED const static char* PLUGIN_SCRIPT = "script";
 MAYBE_UNUSED const static char* PLUGIN_DEPENDENCY = "dependency";
 MAYBE_UNUSED const static char* PLUGIN_USES = "uses";
+MAYBE_UNUSED const static char* PLUGIN_DOCSECTION = "docsection";
 
 /*
  * Hardcoded xml entities of dataModel.xml
index ca2bd6d852a77ac82458a31cd25359d681bb3325..afbd79c85ac657a19d2cc9b90a9a866658f304f6 100644 (file)
@@ -103,6 +103,7 @@ void Config_ModuleReader::processNode(xmlNodePtr theNode)
     std::string aPluginLibrary = getProperty(theNode, PLUGIN_LIBRARY);
     std::string aPluginScript = getProperty(theNode, PLUGIN_SCRIPT);
     std::string aPluginName = addPlugin(aPluginLibrary, aPluginScript, aPluginConf);
+    std::string aPluginDocSection = getProperty(theNode, PLUGIN_DOCSECTION);
     std::string aUsesPlugin = getProperty(theNode, PLUGIN_USES);
     if (!aUsesPlugin.empty()) { // send information about the plugin dependencies
       std::shared_ptr<Config_PluginMessage> aMess(new Config_PluginMessage(
@@ -111,7 +112,7 @@ void Config_ModuleReader::processNode(xmlNodePtr theNode)
       Events_Loop::loop()->send(aMess);
     }
 
-    std::list<std::string> aFeatures = importPlugin(aPluginName, aPluginConf);
+    std::list<std::string> aFeatures = importPlugin(aPluginName, aPluginConf, aPluginDocSection);
     std::list<std::string>::iterator it = aFeatures.begin();
     for (; it != aFeatures.end(); it++) {
       addFeature(*it, aPluginConf);
@@ -137,7 +138,8 @@ bool Config_ModuleReader::hasRequiredModules(xmlNodePtr theNode) const
 }
 
 std::list<std::string> Config_ModuleReader::importPlugin(const std::string& thePluginLibrary,
-                                                         const std::string& thePluginXmlConf)
+                                                         const std::string& thePluginXmlConf,
+                                                         const std::string& thePluginDocSection)
 {
   if (thePluginXmlConf.empty()) {  //probably a third party library
     loadLibrary(thePluginLibrary);
@@ -146,6 +148,7 @@ std::list<std::string> Config_ModuleReader::importPlugin(const std::string& theP
 
   Config_FeatureReader aReader = Config_FeatureReader(thePluginXmlConf,
                                                       thePluginLibrary,
+                                                      thePluginDocSection,
                                                       myEventGenerated);
   aReader.readAll();
   return aReader.features();
index b5533bda5577db99631a3a35a1a7ef1a5be16600..ce6198edb6e991bc1acba5a4d32d8486863f31fb 100644 (file)
@@ -77,7 +77,8 @@ class Config_ModuleReader : public Config_XMLReader
   bool hasRequiredModules(xmlNodePtr aNode) const;
   /// reads info about plugin's features from plugin xml description
   std::list<std::string> importPlugin(const std::string& thePluginLibrary,
-                                      const std::string& thePluginFile);
+                                      const std::string& thePluginFile,
+                                      const std::string& thePluginDocSection);
   /// stores information about plugin in the internal cache
   std::string addPlugin(const std::string& aPluginLibrary,
                         const std::string& aPluginScript,