انتقل إلى المحتوى الرئيسي
الوصفة رقم 159

دليل الوصفات · الفصل 12 · الكتب المدرسية

كراسة أنشطة بإطارات تطول مع نصها

كراسة علوم مبنية على قوالب الصفحات: إطارات مجموعة في عمود تطول مع نصها، وأسطر الإجابة على إطارات فارغة، والمشروع الطويل يستمر في صفحة مضافة.

في هذه الصفحة
  • نموذج باللغة الإنجليزية: لا توجد طبعة عربية بعد
  • مقاس القص 210 × 280 مم
  • عمود واحد
  • Andika 11.5/16
  • Baloo 2
  • Lexend
  • 5 صفحات
  • المستوى
  • Postext 1.65.0
  • أُخرجت في 84 ms
  • أسطر الشيفرة: 220

باختصار

خمس صفحات من كراسة علوم للأطفال عن الماء. كل سؤال في إطار ملوّن تحته أسطر للكتابة. إذا طال السؤال طال إطاره ودفع ما تحته إلى الأسفل. والمشروع الطويل يكمل في الصفحة التالية.

ما الذي ستنضده

خمس صفحات من Water on the move، الوحدة الثالثة من كراسة علوم متخيّلة للصف الرابع، بقياس 210 × 280 ملم. على الغلاف لوحة لدورة الماء مولّدة بنموذج انتشار تمتد حتى منطقة النزف وتذوب في الورق عند أسفلها، وفوقها خمسة أسهم متجهية، فوق عنوان بحجم 54 نقطة وسطر للاسم. كل ورقة عمل تخرج من قالب الصفحة نفسه: سطر الوحدة، وشريط أزرق للعنوان، ونص قصير بجانب لوحة صغيرة، ثم ثلاثة إطارات أنشطة زرقاء فاتحة لكل منها لسان مرقّم. تحت الإطار الأول والثالث أسطر للإجابة. طول كل إطار بطول نصه، لذا تنزل أسطر الورقة الفرنسية، وهي أطول بسطر هنا وهناك، أكثر مما تنزل أسطر الورقة الإنجليزية، من غير أن يتغير أي موضع في القالب. والمشروع، وهو مقياس مطر يُصنع من قارورة، فيه خطوات أكثر مما تتسع له صفحة واحدة: يتوقف إطاره في أسفل الصفحة عند Continued ويستمر في أعلى صفحة مضافة، تليه ستة أسطر لملاحظات التلميذ. كل الكلمات، ومنها كلمات الألسنة وعنوان الملاحظات، مكتوبة في Markdown.

تجيب هذه الوصفة عن

  • كيف أجعل إطارات الصفحة تطول مع نصها وتدفع الإطارات التي تحتها إلى الأسفل؟
  • كيف أجعل نشاطًا لا يتسع يستمر في الصفحة التالية مع علامة «يتبع»؟
  • كيف أبني صفحة ورقة عمل: أسطر للتعبئة، وإطارات إجابات، وبنوك كلمات، وقوائم تحقق؟

الجواب المختصر

script.js · الأسطر 49–75في الشيفرة الكاملة
// An empty frame is an answer space: the Markdown sends it nothing (optional: no slotEmpty).
// Its `rules` draw a line at the foot of every LINE mm of its height, so the lines are part
// of the frame and move with it when a box above grows. minHeight too: a box that runs out of
// room may not take the lines away from the child.
const answer = (name, lines) => ({ name, optional: true, width: mm(W), height: mm(LINE * lines),
  minHeight: mm(LINE * lines),
  rules: { every: mm(LINE), color: col('rule'), width: pt(0.75) } });
// A box is as tall as its text, never less than drawn: a longer text makes it taller and
// pushes everything after it in the group down the page.
const box = (name, style, minHeight) => ({ name, style, width: mm(W), minHeight: mm(minHeight) });
const sheet = {
  id: 'ficha',
  decoration: { elements: [kicker] },
  frames: [
    ...opening,
    // The group starts where its first box is placed: under the text, and runs down from there.
    { ...box('act-1', 'actividad', 22), placement: at('#texto', 'below', 0, 6) },
    answer('lineas-1', 3),
    box('act-2', 'actividad', 22),
    // The last box goes on overleaf, with the answer space after it, when its text outgrows
    // the page; the other two push it down instead.
    { ...box('act-3', 'actividad', 22), overflow: { continueIn: 'next-page' } },
    answer('lineas-3', 2),
  ],
  groups: [{ name: 'actividades', kind: 'stack', gap: mm(4.5),
    frames: ['act-1', 'lineas-1', 'act-2', 'act-3', 'lineas-3'] }],
};

المكونات

الخطوط
Andika, Baloo 2, Lexend (SIL OFL 1.1)
الأصول
  • estados-960.jpg
  • planeta-960.jpg
  • pluviometro-960.jpg
  • portada-1440.jpg
  • The water cycle in a landscape: snowy mountains, a river, a coast and the sea, under sun and rain clouds. (Generated With Diffusion Models, أصلي)
  • The Earth seen from space, with a drop of water. (Generated With Diffusion Models, أصلي)
  • An ice cube melting, a glass of water and a steaming cup. (Generated With Diffusion Models, أصلي)
  • A rain gauge made from a cut bottle, with a ruler and stones. (Generated With Diffusion Models, أصلي)

طريقة التحضير

#1 · اصبب كل نشاط في إطاره باسمه

القالب هو الجواب المختصر أعلاه. في Markdown، كل ورقة كتلة ‎::::page‎ واحدة: يذهب العنوان الأول إلى الإطار الذي له ‎takes: 'h1'‎، والفقرة إلى إطار التدفق، وكل ‎:::frame{slot="…"}‎ إلى الإطار الذي له ذلك الاسم، وكلمات اللسان في ‎label‎. إطارات الإجابة لا تستقبل شيئًا، ولذلك فيها ‎optional: true‎، وإلا أطلق الإطار الفارغ التحذير ‎slotEmpty‎. ونشاط الرسم يحتفظ بمساحته البيضاء داخل إطاره بـ ‎:::space{lines=3}‎، لأن المساحة التي يحتاجها الرسم جزء من السؤال.

:::frame{slot="act-1" label="1 · Read and answer"}
Tom lives in Leeds. The water from his tap comes from a reservoir in the hills…
:::

#2 · دع الرصّة تحرّك الأسطر مع الإطارات

لكل إطار ‎minHeight‎ قدره 22 ملم، وهو الارتفاع الذي رُسم به، وفوق ذلك ارتفاع ‎auto‎. تضع المجموعة إطاراتها الخمسة بعضها تحت بعض بفاصل 4.5 ملم، بدءًا من الموضع الذي يوضع فيه ‎act-1‎ تحت النص، فإذا طال إطار نزل كل ما بعده. والأسطر جزء من الإطار الفارغ نفسه: يرسم ‎rules‎ فيه خطًا عند أسفل كل 8 ملم من ارتفاعه، تحت النص، فتتحرك الأسطر مع الإطار، ويصير موضع الإجابة الأطول إطارًا أطول. اجعل ‎minHeight‎ لإطارات الإجابة مساويًا لارتفاعها: حين تضيق المساحة في مجموعة، يسترد سُلّم إعادة الترتيب المساحة من إطارات المجموعة حتى حدها الأدنى، والحد الأدنى للإطار الفارغ صفر، فتقع الأسطر فوق الإطار التالي. وآخر إطار في الورقة، ‎act-3‎، يتابع في الصفحة التالية (‎overflow.continueIn: 'next-page'‎) إذا زاد نصه عن الصفحة، وتنتقل معه أسطر الإجابة التي تحته.

#3 · انقل المشروع إلى الصفحة التالية

script.js · الأسطر 79–106في الشيفرة الكاملة
const project = {
  id: 'proyecto',
  overflowTemplate: 'proyecto-sigue',
  decoration: { elements: [kicker] },
  frames: [
    ...opening,
    { ...box('material', 'material', 20), placement: at('#texto', 'below', 0, 9) },
    // As tall as its text, never past the foot of the page, at full size: the rest ends
    // with the language's mark (Continúa, Continued, À suivre) and goes on on an added page.
    { name: 'pasos', style: 'proyecto', width: mm(W), overflow: { continueIn: 'next-page' } },
  ],
  groups: [{ name: 'trabajo', kind: 'stack', gap: mm(9), frames: ['material', 'pasos'] }],
};
// The added page: the rest of the steps at the head, then lines for the child's notes,
// under a heading the page fence names (notas="…").
const projectGoesOn = {
  id: 'proyecto-sigue',
  decoration: { elements: [kicker,
    { kind: 'text', id: 'notas-titulo', content: '{attr.notas}', fontFamily: DISPLAY,
      fontSize: pt(15), fontWeight: 700, color: col('sea'),
      placement: { ...at('#notas', 'top-left', 0, -3), size: { width: mm(W) } } }] },
  frames: [
    { name: 'pasos', style: 'proyecto', width: mm(W),
      placement: at('container', 'top-left', 0, 9) },
    answer('notas', 6),
  ],
  groups: [{ name: 'trabajo', kind: 'stack', gap: mm(16), frames: ['pasos', 'notas'] }],
};

ليس لإطار الخطوات ارتفاع ثابت: يطول بطول نصه ويتوقف عند أسفل منطقة النص. الإطار الذي يستطيع المتابعة في صفحة أخرى يتابع قبل أن يُصغَّر نصه، فيُقطع الإطار بين سطرين بحجمه الكامل، وينتهي بعلامة الاستمرار بلغة الوثيقة (Continúa أو Continued أو À suivre بحسب ‎locale‎)، ويستمر في الإطار الذي له الاسم نفسه في صفحة من القالب ‎proyecto-sigue‎ (حين يستمر النص في صفحات مضافة). وترسم الصفحة المضافة أسطر الملاحظات تحت بقية الإطار، بالعنوان الذي تحدّده كتلة الصفحة في ‎notas="What I noticed"‎، فتبقى الكلمات في Markdown وتتغير مع كل طبعة.

#4 · ارسم الغلاف حتى منطقة النزف

script.js · الأسطر 110–131في الشيفرة الكاملة
// and a line for the child's name
const cover = {
  id: 'portada', header: false, footer: false,
  decoration: { elements: [
    { kind: 'image', id: 'cielo', resourceId: 'portada', decorative: true,
      placement: { ...at('bleed', 'top-left'), size: { width: 'fill', height: mm(178) } } },
    // The arrows are vector, over the painting: the same frame, so they stay on its features.
    { kind: 'image', id: 'ciclo', resourceId: 'ciclo', decorative: true,
      placement: { ...at('bleed', 'top-left'), size: { width: 'fill', height: mm(178) } } },
    { kind: 'rule', id: 'nombre-linea', direction: 'horizontal', thickness: pt(1),
      color: col('sea'), placement: { ...at('#nombre', 'bottom-left', 0, 1),
        size: { width: mm(W) } } },
  ] },
  frames: [
    { name: 'titulo', takes: 'h1', width: mm(W), placement: at('container', 'top-left', 0, 162) },
    { name: 'subtitulo', flow: true, width: mm(W) },
    { name: 'nombre', style: 'campo', width: mm(W), minHeight: mm(12) },
    { name: 'colofon', style: 'colofon', width: mm(W), placement: at('container', 'bottom-left') },
  ],
  groups: [{ name: 'portada', kind: 'stack', gap: mm(4),
    frames: ['titulo', 'subtitulo', 'nombre'] }],
};

الغلاف أيضًا صفحة مركّبة: رسمه زخرفة مربوطة بمنطقة النزف، والعنوان وسطر السلسلة وخانة الاسم مجموعة في عمود تبدأ على بعد 162 ملم من أعلى منطقة النص. خط الاسم مربوط بأسفل إطاره، فإذا شغلت التسمية سطرين في لغة أخرى بقي الخط تحت الكلمات. ويُبعد ‎header: false‎ و‎footer: false‎ رقم الصفحة عن الغلاف.

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 159 · Activity book with boxes that grow ══════════════
// https://postext.dev/en/cookbook/activity-book-growing-boxes
// Code: MIT · Text: original (CC BY 4.0) · Pictures: generated with diffusion models
// Fonts: Andika, Baloo 2, Lexend (SIL OFL 1.1) · Needs postext ≥ 1.65.0
import {
  buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es' | 'fr')
const RECIPE = 'activity-book-growing-boxes';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: one ink, the water blue, the sun, and the pale fields of the boxes
const palette = {
  ink: '#1f2d38', // text
  sea: '#1d659c', // titles, tabs, list numbers
  sky: '#e2f0f9', // activity boxes
  sun: '#f0a531', // the project's box
  sand: '#fcf0d8', // the materials box
  rule: '#93bcd8', // answer lines, blanks
  paper: '#ffffff',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
  ...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
  { id: 'main-color', name: 'sea (defaults)', value: { hex: palette.sea, model: 'hex' } },
];
// #endregion

const [TEXT, DISPLAY, LABEL] = ['Andika', 'Baloo 2', 'Lexend']; // Andika: for early readers
const W = 174; // mm: the width of the type area, and of every box
const LINE = 8; // mm between two answer lines: room for a child's handwriting
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });

// The head every sheet shares: the unit over the title band, the text with its drawing.
const kicker = { kind: 'text', id: 'tema', content: '{attr.tema}', fontFamily: LABEL,
  fontSize: pt(8.5), fontWeight: 600, color: col('sea'), textTransform: 'uppercase',
  letterSpacing: pt(1.4), placement: at('container', 'top-left') };
const opening = [
  { name: 'titulo', takes: 'h1', style: 'banda', width: mm(W),
    placement: at('container', 'top-left', 0, 6) },
  { name: 'texto', flow: true, width: mm(W - 52), minHeight: mm(36),
    placement: at('#titulo', 'below', 0, 4) },
  { name: 'dibujo', width: mm(44), placement: at('#titulo', 'below', W - 44, 4) },
];

// #region answer: boxes in a stack grow with their text; empty ruled frames hold the answers

يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)

تنويعات

#أعطِ نشاطًا أسطرًا أكثر

عدد الأسطر هو ارتفاع إطار الإجابة: يرسم ‎rules‎ فيه ما يتسع من الأسطر. غيّره في القالب فتحصل كل ورقة تستخدمه على هذه الأسطر.

-    answer('lineas-1', 3),
+    answer('lineas-1', 5),

#دع الخطوات تصغر قبل أن تستمر

الإطار الذي يستطيع المتابعة في صفحة أخرى يتابع قبل أن يُصغَّر نصه. مع ‎fit.preferContinue: false‎ يصغّر السُّلّم الخطوات أولًا حتى ‎fit.minScale‎ (90 %)، ولا ينقلها إلى صفحة أخرى إلا إذا لم يكفِ ذلك. وفي كتاب للأطفال يهمّ حجم الحرف أكثر من صفحة نوفّرها، لذلك تبقي الوصفة على القيمة الافتراضية.

-      overflow: { continueIn: 'next-page' } },
+      fit: { preferContinue: false }, overflow: { continueIn: 'next-page' } },

أخطاء شائعة

  • الإطار الذي لا يستقبل شيئًا يطلق ‎slotEmpty‎ ما لم تكن فيه ‎optional: true‎. وكل إطارات الإجابة هنا فيها هذه الخاصية.
  • في المجموعة من نوع stack تضع المجموعة إطاراتها ولا يُعتدّ بـ ‎placement‎ الخاص بكل منها، إلا الأول: حدّد موضع الإطار الأول في المجموعة، وإلا بدأت المجموعة من أعلى منطقة النص فوق العنوان.

الحقوق

الوصفة
Ignacio Ferro
النص
نص أصلي, CC BY 4.0
الصور
  • The water cycle in a landscape: snowy mountains, a river, a coast and the sea, under sun and rain clouds. · Generated With Diffusion Models · أصلي
  • The Earth seen from space, with a drop of water. · Generated With Diffusion Models · أصلي
  • An ice cube melting, a glass of water and a steaming cup. · Generated With Diffusion Models · أصلي
  • A rain gauge made from a cut bottle, with a ruler and stones. · Generated With Diffusion Models · أصلي
الخطوط
Andika (SIL OFL 1.1) · Baloo 2 (SIL OFL 1.1) · Lexend (SIL OFL 1.1)
الشيفرة
MIT، مثل Postext
SandboxPDF