nilsBoeAc / m2docgen

A program that converts .m files into html files and creates a structured xml file compatible with the matlab documentation.
7 stars 3 forks source link

Improved GenerateTocXml.m #2

Closed DionTimmermann closed 2 years ago

DionTimmermann commented 2 years ago

I had a toc file that missed opening tocitem statements at the beginning of the file (see example below). This pull-request fixes that issue and also simplifies the code. However, I believe there are still issues with GenerateTocXml.m that were not in GenerateTocXml_old.m. My config contained a quite large toc structure with empty folders and entries (for files which I later added through another script). GenerateTocXml.m seems to ignore theses structures.

Also, I think the toc structure defined in the config should not be sorted, only the auto-generated entries. This is currently also not done.

Start of the incorrect helptoc.xml file. (The last two lines in this excerpt are correct, as is everything afterwards.)

<tocitem target="prf Toolbox.html" image="$toolbox/matlab/icons/book_mat.gif">prf Toolbox
                        <tocitem target="License.html">License</tocitem>
                        <tocitem target="openpdatb.html">openpdatb</tocitem>
                        <tocitem target="opens1p.html">opens1p</tocitem>
                        <tocitem target="opens2p.html">opens2p</tocitem>
                        <tocitem target="opens3p.html">opens3p</tocitem>
                        <tocitem target="opens4p.html">opens4p</tocitem>
                        <tocitem target="opensdatb.html">opensdatb</tocitem>
                        <tocitem target="opensdatcv.html">opensdatcv</tocitem>
                        <tocitem target="opensdatx.html">opensdatx</tocitem>
                        <tocitem target="openvdatb.html">openvdatb</tocitem>
                        <tocitem target="openvdatcv.html">openvdatcv</tocitem>
                        <tocitem target="openvdatx.html">openvdatx</tocitem>
                     </tocitem>
                  </tocitem>
               </tocitem>
            </tocitem>
         </tocitem>
      </tocitem>
   </tocitem>
   <tocitem target="prf. Package.html" image="$toolbox/matlab/icons/book_mat.gif">prf. Package
      <tocitem target="addUncertainty.html">addUncertainty</tocitem>