{"id":920,"date":"2022-09-22T18:11:59","date_gmt":"2022-09-22T18:11:59","guid":{"rendered":"https:\/\/bechele.de\/?page_id=920"},"modified":"2022-09-23T13:36:10","modified_gmt":"2022-09-23T13:36:10","slug":"howto-use-cd2browse","status":"publish","type":"page","link":"https:\/\/bechele.de\/?page_id=920","title":{"rendered":"Howto use cd2browse"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">Name:\n   cd2browse - create browsable menus out of directory structures.\n   index is a part of cd2browse and can run from the command line. If you start \n   cd2browse instead, a GUI menu will be started where you can set the command\n   line options for index.pl which then runs in the background.\n\nVersion: 1.05\n\nSynopsis:\n   index -p &lt;path to index&gt; [-n -m -t -s -i -x -r -q -v]\n\nDescription:\n   index is a command line tool, to create html menues out of directory\n   trees mostly used on CDs and DVDs it also indexes all files and provides a\n   java script search engine for full text search.\n\nPreperation:\n   befor you start to process a directory, you should consider the following.\n\n   cd2browse creates several files and subdirectories inside the document root -\n   means in the directory you start processing. All subdirectories in the tree\n   will be scanned by cd2browse and the html results are written to the document\n   root directory and special subdirectories. All files, necessary to use the\n   html menues are written to the document root directory (given by the -p option).\n   Files in the root directory itself are not indexed and processed. Just sub-\n   folders are recognised from the root. Above root also ordinary files are read\n   and indexed.\n\n   For each file in the file tree a line in the belonging html menu(s) will be\n   written. There are three possibilities to create the title of a file:\n   The highest priority has the .htaccess file in each directory. The .htaccess\n   file is a standard on apache web server and cd2browse uses the same syntax.\n   If a line in the .htaccess file refers to a file in the directory, this title\n   has priority and will therefore be taken for the menu. Example:\n\n   AddDescription \"The description of how to use cd2browse\" cd2browse_use.txt\n\n   The above line in .htaccess will show a longer description than just\n   cd2browse_use.txt\n   The second priority has a title tag of whether a pdf or a html file.\n   cd2browse scans each pdf or html file for a title tag and takes this as the\n   title in the menu line.\n   If none of both, a .htaccess entry or a title tag exists, cd2browse takes the\n   file name.\n\n   If cd2browse finds a Image in the file tree, it calculates a thumb nail\n   image, a preview page and image of this image. So that automatically a image\n   gallery is built. If you dont want to process images, for example beause\n   images are linked inside html files, you may add a line in the .htaccess file\n   with \"IndexIgnore &lt;list of extensions&gt;\" to the directory you don't want to\n   index images.\n\nHow to start processing on the command line:\n\n   perl index.pl -p &lt;path to index&gt; [-n -m -t -s -i -x -r -q -v]\n\n\n   where options -n , -m , -t ,-s -i -x -r -q and -v are optional\n\nHow to start the GUI for window based interface:\n\n   perl CD2Browse.pl\n\n   The GUI is mostly self explaining - if you need help, go to Help -&gt; Help, or\n   read the file CD2Browse.hlp\n\nExample:\n\n   perl c:\\perl\\own\\index.pl -p \"c:\\Own Files\\CD project\"\n   ( use the double quotes for files or path with spaces )\n\n   The above line will index all sub directories in \"c:\\Own Files\\CD project\"\n   and writes the result into c:\\Own Files\\CD project\n\n   After calculation, point your browser to index.html in the directory and\n   enjoy.\n\nOptions:\n  -n  (re) calculate no images to save cpu time\n      This is especially interesting to re-calculate the indexes and omitting\n      re-calculation of images, because this may save a lot of time.\n  -m  maxwidh of the preview image (default=800)\n      You can define the maximum with of the preview images with this option\n      the size is in pixels. If the files are smaller, the image gets the\n      previous size.\n  -s  size of the thumbnails (default=90x90)\n      The size of the thumbnails in the menu. The aspect ratio of the image is\n      kept, but the resulting maximum is according to the setting width or\n      height, depending on which exceeds first.\n  -t  title\n      The title of the menu pages.\n  -i  do not index images\n      If -i exists, no images will be indexed at all - for example if all\n      images belong to html files.\n  -x  do not extract title from pdf file\n      If -x exists, the indexing process will not extract the title from the\n      pdf file. Instead, the file name is used. This is helpful, when the\n      pdf files do not contain senseful title tags\n  -r  do not create several output pages for sorting. When applied, only\n      one result page per directory is created. This does not allow sorting\n      on the other hand. A different page.tpl template is recommended, because\n      if the sort template is used, clicking onto the sort links lead to a\n      error message of the browser - missing page. If the option is not\n      present, 8 pages per directory will be created, for offline sorting.\n  -q  quiet - do not output progress information on the console window.\n  -v  Do not create folder navigation in the page section of the main view.\n      If you use this option, no links for sub folders will be created in the\n      main views (page_xxx.html) So subfolders are not visible in the page\n      section. This forces the User to use the tree section for folder\n      navigation.\n\n.htaccess functions:\n   Since the command line options influence the behaviour of cd2browse in\n   general, there is a need to define the behaviour on a per directory base.\n   Similiar to the apache directives, it is possible to influence the indexing\n   process by setting directives inside .htaccess files.\n\n   if a .htaccess file exists in a scanned directory, it will be opened and\n   parsed.\n   \n   The following directives are recognized in .htaccess files:\n\n   IndexIgnore\n   IndexOptions SuppressDescription\n   AddDescription\n\n   IndexIgnore takes Arguments like in apache.cnf:\n   Like in Apache, the settings are valid also for all sub directories.\n\n   IndexIgnore *.gif *.css *.jpg *.png thumbs.db\n\n   The above line for examle does not index gif,jpeg and png images and also no\n   css files and thumbs.db files.\n   One or more lines with this directive may be used in the .htaccess file.\n\n   IndexOptions SuppressDescription\n   Like in Apache, the settings are valid also for all sub directories.\n\n   The above line prevents the indexing process to extract the pdf title from\n   pdf files - this is a per directory setting similiar to the -x command line\n   option, which works globally.\n   One line with this directive may be used in the .htaccess file.\n\n   AddDescription \"Description of the file\" filename\n   Other than in Apache, the File description is not used in sub directories.\n   This is a feature, since Apache annoys with repeating descriptions in sub\n   directories, when the same file name appears.\n\n   The above line adds a description for a particular file. - see also the hints\n   further up in this document.\n\n   note: if you want to have a mix of images in a directory you want to index and\n   images you dont want to be indexed because they belong to a html file, you may\n   create a directory with a leading dot like for example .resource and put the\n   images for html pages inside this directory and link it inside the html\n   accordingly. Directories with a leading dot will not be indexed at all.\n\nCustomizing cd2browse:\n\n   To customize the look and feel of cd2browse results, you may read the\n   following:\n\n   Files are copied from the resourcesource directory of cd2browse - usually\n   \/var\/opt\/cd2browse\/repository (unix\/Linux) or\n   c:\\strawberry_operate\\opt\\cd2browse\\repository (Windows)\n   - to the target directory \"&lt;dir to index&gt;\/.repository\"\n\n   CD2Browse checks before copying the files. If the files to copy already\n   exist, cd2browse does not copy, but takes the settings from the target.\n   So you may change just the files in your particular target directory\n   instead of changing the source. Each further run of index.pl will take the\n   settings from the target. This means you can customize the output on a\n   project base this way. On the other hand this means, that if once a target\n   directory has been changed, it will be never overwritten again, until you\n   delete all files in the .repository directory on the target manually.\n\nFiles:\n\n\\var\\opt\\cd2browse\\repository\\head.html    - the upper frame (search form and head\n                                             line)content\n\\var\\opt\\cd2browse\\repository\\index.html   - the frame set itself\n\\var\\opt\\cd2browse\\repository\\result.html  - do not edit - will be overwritten -\n                                             change\n                                  \\var\\cd2browse\\repository\\menu\\templatespage.tpl\n                                  and list.tpl instead\n\\var\\opt\\cd2browse\\repository\\welcome.html - the first page shown in the main\n                                             frame\n\\var\\opt\\cd2browse\\repository\\start.exe    - used together with autorun.inf to\n                                             autostart the browser when on cd and\n                                             cd is inserted\n\\var\\opt\\cd2browse\\repository\\autorun.inf  - used together with start.exe to\n                                             autostart the browser when on cd and\n                                             cd is inserted\n\\var\\opt\\cd2browse\\repository\\cd.ico       - shown in explorer as the drive icon\n\\var\\opt\\cd2browse\\repository\\resources    - file type icons for the use in the\n                                             menu\n\\var\\opt\\cd2browse\\repository\\empty_dir.html -page shown if the user clicks onto\n                                             a empty directory if the folder\n                                             navigation is not in use\n\\var\\opt\\cd2browse\\repository\\image_end.html -page shown if the last image of the\n                                             gallery is reached\n\\var\\opt\\cd2browse\\resources\\templates\\image.tpl\n                                           - template for the image gallery html\n\\var\\opt\\cd2browse\\repository\\templates\\page.tpl  - template for the menu pages\n\\var\\opt\\cd2browse\\repository\\menu\\templates\\list.tpl\n                                           - template for each menu page list line\n\\var\\opt\\cd2browse\\repository\\menu\\templates\\tree.tpl\n                                           - template for the file tree menu\n\\var\\var\\opt\\cd2browse\\repository\\menu\\templates\\treeitem1-1.tpl\n                                           - template for the root folders of the\n                                             tree menu - this is the opening tag.\n                                             Together with treeitem1-2.tpl it\n                                             contains the code for this folder\n                                             level menu structure\n...\\treeitem1-2.tpl                        - Closing tag  - works together with\n                                             treeitem1-1.tpl\n...\\treeitem2-1.tpl                        - This is the end fragment for the folder\n                                             hirarchy i.e. used for a folder wich\n                                             has no sub-folders.\n...\\treeitem2-2.tpl                        - Contains the closing tag - works\n                                             together with treeitem2-1.tpl\n...\\treeitem2-1a.tpl                       - Used for folders in between the root\n                                             and the end folder\n...\\treeitem2-2a.tpl                       - Contains the closing tag - works\n                                             together with treeitem2-1a.tpl\n\nAfter running cd2browse once sucessfully, a similar structure exists in your\ntarget file tree, because the above files and folders will be copied to your\ndocument root. These files will be copied only if the don't exist before. This\nmeans customizing them allows you a project based look and feel\n\n&lt;target directory&gt;\\index.html\n&lt;target directory&gt;\\.repository\\head.html\n&lt;target directory&gt;\\.repository\\result.html\n&lt;target directory&gt;\\.repository\\welcome.html\n&lt;target directory&gt;start.exe\n&lt;target directory&gt;autorun.inf\n&lt;target directory&gt;cd.ico\n&lt;target directory&gt;\\.repository\\resources &lt;all copied from\n                                          \\var\\opt\\cd2browse\\repository\\resources&gt;\n&lt;target directory&gt;\\.repository\\menu\\     &lt;all copied from\n                                               \\var\\opt\\cd2browse\\repository\\menu&gt;\n&lt;target directory&gt;\\.repository\\teplates\\ &lt;all copied from\n                                          \\var\\opt\\cd2browse\\repository\\templates&gt;\n\nHow to use different Tree menus:\nTo use a different tree menu, you can rename one of the additional sample\nrepository directories \"\\var\\opt\\cd2browse\\repository_xxxxx\" into \"repository\"\nPlease read also the README files in the different repository_xxx directories.\n\n  A template set for the tree menu consists of four levels as shown below and is\n  the base for the resulting tree.html. During run time of index.pl, the templates\n  will be filled with data and linked together to form the resulting tree.html\n-------------------\n|                 |\n|                 --------------------\n|                 |  treeitem1-1.tpl |\n|                 ----------------------------\n|                        |  treeitem2-1a.tpl |\n|                        ---------------------\n|                                  .....\n|                                ----------------------\n|                                | treeitem2-1a.tpl   |\n|                                -------------------------------\n|                                        | treeitem2-1.tpl     |\n|  tree.tpl                              -----------------------  \n|                                        | treeitem2-1.tpl     |\n|                                -------------------------------\n|                                | treeitem2-2a.tpl   |\n|                                ----------------------\n|                                  .....\n|                        ---------------------\n|                        |  treeitem2-2a.tpl |\n|                 ----------------------------\n|                 |  treeitem1-2.tpl |\n|                 --------------------\n|                 |  treeitem1-1.tpl |\n|                 --------------------\n|                       .....\n|                 --------------------\n|                 |  treeitem1-2.tpl |\n|                 --------------------\n|                 |\n------------------- Remember: After running once index.pl on a particular directory tree, you need\nto delete the .resources directory in the target file tree if you want to try a\ndifferent tree menu for the same directory. Otherwise you will see no change !\n<\/pre>\n\n\n\n<p><a href=\"http:\/\/cmfs.de\/run\/edit\/addoc.cgi?nextdtl=1;process=69\">*<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Name: cd2browse &#8211; create browsable menus out of directory structures. index is a part of cd2browse and can run from the command line. If you&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":907,"menu_order":2,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-920","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages\/920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bechele.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=920"}],"version-history":[{"count":3,"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages\/920\/revisions"}],"predecessor-version":[{"id":926,"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages\/920\/revisions\/926"}],"up":[{"embeddable":true,"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages\/907"}],"wp:attachment":[{"href":"https:\/\/bechele.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}