Question
I havea great deal of pre-generated HTML documentation that I would like to import into TWiki. I don't want TWiki users to be able to edit it, but I do want TWiki to be able to search through it, as well as the editable TWiki contents.
I have a general idea how to protect the imported pages, but how can I have TWiki import web pages into itself?
- TWiki version: Current
- Web server: Apache
- Server OS: Solaris
--
RalphBroom - 18 Jul 2001
Answer
You can just copy the web pages into the corresponding sub-webs under the twiki's
data folder, and changing the file extension to .txt. You will need to remove the html header section of your files, so that it will not conflict with the twiki templates, but that would be most of it. If you have some perl experience, it could be mostly automated with a relatively simple perl script.
Another option is to create a separate web for your web pages and modify that web's templates to accomodate your pre-existing pages, but then you will have to manually add some navigation links for them to be kept as part of the twiki.
In any case, unless somebody has automated such import, you will still have to edit all the html links to make them twiki-links, as, even though twiki will render them correctly, these would be broken as they will refer to non-existing files outside of the twiki.
Yet another option, would be to modify the
search.pm code so that it allows for searches outside of the twiki hierarchy.
--
EdgarBrown - 18 Jul 2001
Sounds like the sort of thing that lots of people would like to do...
--
MartinCleaver - 19 Jul 2001
Has anyone done any work or seen any prior art that does this?
--
FrancisLiu - 17 Apr 2003
Have a look at
PowerEditPlugin, I think it supports this.
--
RichardDonkin - 17 Apr 2003
Following is shown a directory with html files located in /var/www/htdocs/twiki/externhtml.
This structure is only a part of a hughe 20MB html tree.
The link tree is in TWiki-Format [[link/to/file.html][Description]] to stay dynamic.
With the
HTML2TML cotribution i generated a TWiki tree:
#!/bin/bash
for t in `find . -name \*.html`
do
../htmltotwiki.sh $t > $t.new
mv -f $t.new $t
done
But this tree is only searched flat not traversed deep.
Is there another way to search in extern located (not in web) files with traversing the directory structure?
* [[/twiki/externhtml/api/plsql/jcs_chain/job_add_call_destination.html][jcs_chain.job_add_call_destination]]<o:p _moz-userdefined=""></o:p>
* [[/twiki/externhtml/api/plsql/jcs_chain/job_add_postcondition.html][jcs_chain.job_add_postcondition]]<o:p _moz-userdefined=""></o:p>
* [[/twiki/externhtml/api/plsql/jcs_chain/job_add_step.html][jcs_chain.job_add_step]]<o:p _moz-userdefined=""></o:p>
* [[/twiki/externhtml/api/plsql/jcs_chain/job_define_call_des_parameter.html][jcs_chain.job_define_call_des_parameter]]<o:p _moz-userdefined=""></o:p>
* [[/twiki/externhtml/api/plsql/jcs_chain/job_define_call_parameter.html][jcs_chain.job_define_call_parameter]]<o:p _moz-userdefined=""></o:p>
* [[/twiki/externhtml/api/plsql/jcs_chain/job_delete_call_destination.html][jcs_chain.job_delete_call_destination]]<o:p _moz-userdefined=""></o:p>
* [[/twiki/externhtml/api/plsql/jcs_chain/job_modify_call.html][jcs_chain.job_modify_call]]<o:p _moz-userdefined=""></o:p>
* [[/twiki/externhtml/api/plsql/jcs_chain/job_modify_postcondition.html][jcs_chain.job_modify_postcondition]]<o:p _moz-userdefined=""></o:p>
--
ElviraMiller - 07 Mar 2008
Please open a new support question.
--
PeterThoeny - 08 Mar 2008
Support question:
MoveExistingHtmlTreeToTwikiForSearch
--
ElviraMiller - 11 Mar 2008