-
Notifications
You must be signed in to change notification settings - Fork 0
How to create a document template from scratch
Original working document https://docs.google.com/document/d/1WSJ1Y2Ow12QjisocdN1O7fqZYoYwtUwIBer_wKpm6wM/edit?tab=t.0 Delete when info will be transferred to this page.
- KM - Knowledge model
- DM - document template
This is a guide on how to create a Document Template for a simple KM from scratch. Such simple KM and corresponding template contains only Value-text questions with guidelines. It is just a DSW version of a funder template (e.g. FNR or MRC). Steps to create more advanced structures such as tables and aesthetics is not part of this guide.
Watch the video tutorial (you can skip "Installation of DSW TDK" and "Connection to DSW API" and start from 19:00).
-
Create a new DT editor following this guide.
- Leave the field “Based on” empty.
-
Go to the “Settings” tab on the freshly created DT and
- fill all General settings;
- fill out the Knowledge Model(s), you wish the created doc template to be compatible with.
- leave the field “Max version” empty
- go to the “Formats” tab and add the formats you wish for the doc template.
- you can copy them from another DT, like Horizon Europe DMP template.
-
Navigate to the “Files” tab and create the following:
- subfolder
src
- inside scr create files
-
index.html.j2
; -
style.css
; -
uuids.j2
.
- subfolder
At the end you will have something like this: TODO:image
- Put the following skeleton into
index.html.j2
:
{%- set km = ctx.knowledgeModel -%}
{%- set repliesMap = ctx.questionnaireReplies -%}
<!DOCTYPE html>
<html>
<head>
<title>Resume</title>
<meta charset="utf-8">
</head>
<body>
<h1>Test</h1>
</body>
</html>
- Using KM inside (see another guide) populate uuids.j2 file. TODO: change the link to another wiki page. This step is not needed if you are going to use a generic template at step 6.
- Setup Preview. You should see the word “Test”.
- Use the index file to create the content of the doc template. You can use the following video to guide you.
- If your model is simple (a simple list of questions), you might want to check “Creating generic template” part of the video.
- If your answers are a big block of text, they might have several paragraphs. The following code to split them might be useful:
- Optional: In the style.css file, you can format the layout of your doc template with CSS. An example is shown below: