Tags:
create new tag
view all tags

SID-00687: Using script to create project documentation from templates

Status: Answered Answered TWiki version: 4.2.3 Perl version: 5.8.8
Category: CategoryAutomation Server OS: Fedora 7 kernel 2.6.23 Last update: 16 years ago

I'd like to use a script to automatically create a bunch of standard documents for a project based upon a set of templates. I would use one document as a base name for the rest of the documents.

For example, a project would include:

  • Base document - "DevProject" Each of the following documents shows up in a list on this document

  • Document1 - "DevProjectDocument1"
  • Document2 - "DevProjectDocument2"
  • etc.

I have created a perl script using the twiki edit script to attempt to create the documents, but I'd like to invoke it from my Development Projects TWiki WebHome document. In other words, a "Create new Project" button would be connected to a field where one would enter the base name above, and all of the requisite documents would automatically get created as a child of the WebHome document. It would be great id the new base document show up in a list on the WebHome doc as well.

Is there a good tutorial out there somewhere that I can use to get a jump start?

-- RonSiven - 2009-12-21

Discussion and Answer

I don't think you need a Perl script for that. Here are some guidelines.

1. Create template pages DevProjectTemplate, DevProjectTemplateDoc1, DevProjectTemplateDoc2.

2. Define a DevProjectForm and attach the form to DevProjectTemplate. Details in TWikiForms.

3. Install TopicCreatePlugin.

4. Add this to DevProjectTemplate to instantiate child topics for new project pages:

%TOPICCREATE{ template="DevProjectTemplateDoc1" topic="%TOPIC%Doc1" disable="DevProjectTemplate" }%
%TOPICCREATE{ template="DevProjectTemplateDoc2" topic="%TOPIC%Doc2" disable="DevProjectTemplate" }%

5. Create an HTML form to create new project pages with auto incremented names, such as DevProject001, DevProject002 etc. Details in TWikiTemplates.

6. Add reports in WebHome and other pages as needed. Details in VarSEARCH, QuerySearch, FormattedSearch.

-- PeterThoeny - 2009-12-22

Yes! This is exactly what I needed. It works like a charm. Thank you!!

-- RonSiven - 2009-12-23

I am glad it worked out for you. Please consider contributing back to the TWiki community, in any form of:

-- PeterThoeny - 2009-12-23

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Using script to create project documentation from templates
SupportCategory CategoryAutomation
TWiki version 4.2.3
Server OS Fedora 7 kernel 2.6.23
Web server Apache 2.2.8
Perl version 5.8.8
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2009-12-23 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.