Kozea / WeasyPrint

The awesome document factory
https://weasyprint.org
BSD 3-Clause "New" or "Revised" License
7.11k stars 678 forks source link

Add support for ol start attribute #2158

Closed dmint789 closed 4 months ago

dmint789 commented 4 months ago

The ol HTML element has a start attribute that can be used to specify the starting number for the counters in the ordered list. This is does not appear to be supported currently, as the HTML file does respect this attribute, but the corresponding weasyprint-rendered PDF does not. Attached is a rendered PDF file with the issue and below it is the source HTML.

competition-templates.pdf

   <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <title>WCA Competition Templates</title>
  <style>
    code{white-space: pre-wrap;}
    span.smallcaps{font-variant: small-caps;}
    div.columns{display: flex; }
    div.column{flex: auto; }
    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
    /* The extra [class] is a hack that increases specificity enough to
       override a similar rule in reveal.js */
    ul.task-list[class]{list-style: none;}
    ul.task-list li input[type="checkbox"] {
      font-size: inherit;
      width: 0.8em;
      margin: 0 0.8em 0.2em -1.6em;
      vertical-align: middle;
    }
    .display.math{display: block; text-align: center; margin: 0.5rem auto;}
  </style>
  <link rel="stylesheet" href="/home/app/wca-documents/assets/style.css" />
  <link rel="stylesheet" href="/home/app/wca-documents/assets/edudoc-style.css" />
</head>
<body>
<div id="header_title">
WCA Competition Templates
</div>
<img id="header_logo" src="/home/app/wca-documents/assets/WCAlogo_notext.svg" alt="WCA logo" />
<div id="header_date">
Last update: 2024-05-18
</div>
<h1 id="wca-competition-templates">WCA Competition Templates</h1>
<div class="box important">
<p>DO NOT use any templates before reading this entire document!</p>
</div>
<p>Here you can find the following printable templates that can be used
for WCA competitions:</p>
<ul>
<li>Cube covers and Clock covers, both stackable</li>
<li>3D-printable cover designs for Square-1, Clock, and Skewb
puzzles</li>
<li>Results boxes for scorecards: one that can be put on a table and
another that can be hung on a wall</li>
<li>Square-1 inserts (21 per page)</li>
<li>Competitor guide infographic with illustrations of the most
important rules</li>
<li>Multi-Blind scrambling infographic, with illustrations that show
best practices</li>
<li>Sheets with cube outlines for tracking Multi-Blind scrambles (14
cubes per page)</li>
</ul>
<p><img src="images/results_boxes_and_cube_cover.jpg" class="centered"
style="width:70.0%" /></p>
<h2 id="instructions">Instructions</h2>
<ol type="1">
<li>If you would like to use the WCA designs, use the files in the
folder for the language used in your region, if available. If you would
like to make custom designs, use the files in the
<code>Editable Files</code> folder. <strong>DO NOT</strong> make Clock
cover designs that use a lot of ink, because that makes the paper more
rigid, which can affect Clock pins. It is preferable to have a minimal
design in Black and White (BW).</li>
<li>The template for paper Clock covers, the infographics, and the
Multi-Blind cube outlines sheet can be printed on a home printer. The
infographics need to be printed in color, and the other two files need
to be printed in BW. All other templates <strong>MUST</strong> be
printed using an industry-grade printer, so you will have to find a
printing service in your area. They will require <code>.pdf</code> files
to make your prints.</li>
</ol>
<p><img src="images/paper_clock_covers.jpg" class="centered"
style="width:50.0%" /></p>
<ol start="3" type="1">
<li>If you are making <strong>custom Clock covers</strong>, you will
need to copy your finished design to a new A4-sized document (210*297mm
/ 8.27*11.69in), rotate the whole design 12 degrees counterclockwise and
save the file as <code>.pdf</code>. If you are printing them on a
regular office printer that can’t print all the way to the edges, try
selecting the setting “fit to printable area”.</li>
</ol>
<p><img src="images/clock_in_3d_cover.jpg" class="centered"
style="width:50.0%" /></p>
<div class="text-center">
<p>3D Clock cover</p>
</div>
<p><img src="images/sq1_in_3d_cover.jpg" class="centered"
style="width:50.0%" /></p>
<div class="text-center page-break-after">
<p>3D multipurpose cover</p>
</div>
<ol start="4" type="1">
<li><p>There are two 3D-printable cover designs: one for Clock and one
that fits Square-1, Clock and Skewb puzzles. Both are stackable. The
multipurpose cover fits any Clock ≤ 24mm (0.94in) in thickness and any
Square-1/Skewb ≤ 57mm (2.24in), and prevents accidental turns being
applied to the puzzle during transit. 3D-printed covers last much longer
and work better than the paper/card alternatives, but are more expensive
to produce. It is recommended that you look for a 3D printing service in
your area or try to find a 3D printing enthusiast who could print them
for you.</p></li>
<li><p>Make sure you print all templates <strong>STRICTLY</strong>
within the following specifications:</p></li>
</ol>
<table>
<colgroup>
<col style="width: 53%" />
<col style="width: 13%" />
<col style="width: 19%" />
<col style="width: 13%" />
</colgroup>
<thead>
<tr class="header">
<th>Template</th>
<th style="text-align: center;">Paper size</th>
<th style="text-align: left;">Paper density</th>
<th style="text-align: center;">Color / BW</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Cube cover</td>
<td style="text-align: center;">A3</td>
<td style="text-align: left;">350-400 gsm *</td>
<td style="text-align: center;">Color</td>
</tr>
<tr class="even">
<td>Paper Clock cover **</td>
<td style="text-align: center;">A4</td>
<td style="text-align: left;">60-90 gsm</td>
<td style="text-align: center;">BW</td>
</tr>
<tr class="odd">
<td>Results box (table)</td>
<td style="text-align: center;">A3</td>
<td style="text-align: left;">350-400 gsm *</td>
<td style="text-align: center;">Color</td>
</tr>
<tr class="even">
<td>Results box (wall)</td>
<td style="text-align: center;">A4</td>
<td style="text-align: left;">250-400 gsm</td>
<td style="text-align: center;">Color</td>
</tr>
<tr class="odd">
<td>Square-1 inserts</td>
<td style="text-align: center;">A4</td>
<td style="text-align: left;">250-400 gsm</td>
<td style="text-align: center;">Color</td>
</tr>
<tr class="even">
<td>Competitor/Multi-Blind scrambling guide</td>
<td style="text-align: center;">A4</td>
<td style="text-align: left;">Any</td>
<td style="text-align: center;">Color</td>
</tr>
<tr class="odd">
<td>Multi-Blind cube outlines sheet</td>
<td style="text-align: center;">A4</td>
<td style="text-align: left;">Any</td>
<td style="text-align: center;">BW</td>
</tr>
</tbody>
</table>
<p>“gsm” stands for grams per square meter. This is the standard unit of
measurement for paper density.</p>
<p>* Thicker is better.<br/> ** Clock covers are printed on standard
printing paper used for regular BW office printers. 80 gsm is the best
option.</p>
<table>
<thead>
<tr class="header">
<th>Template</th>
<th style="text-align: center;">Resolution</th>
<th style="text-align: center;">Infill</th>
<th style="text-align: center;">Filament</th>
<th style="text-align: center;">Supports</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>3D multipurpose cover</td>
<td style="text-align: center;">0.2-0.3mm</td>
<td style="text-align: center;">15%</td>
<td style="text-align: center;">PLA / PETG</td>
<td style="text-align: center;">None</td>
</tr>
<tr class="even">
<td>3D Clock cover</td>
<td style="text-align: center;">0.4mm</td>
<td style="text-align: center;">15% *</td>
<td style="text-align: center;">PLA / PETG</td>
<td style="text-align: center;">None</td>
</tr>
</tbody>
</table>
<p>* If needed.</p>
<ol start="6" type="1">
<li>You will need the following tools in order to assemble the paper
prints:</li>
</ol>
<ul>
<li>Scissors</li>
<li>Ruler</li>
<li>Paper glue (only for Clock covers)</li>
<li>Double-sided tape up to 1cm in width (only for results boxes and
cube covers)</li>
<li>Blade (knife, box cutter, etc.) (only for results boxes and cube
covers)</li>
</ul>
<div class="page-break-after">
<ol start="7" type="1">
<li>On all templates except for the Clock covers, make all cuts on the
<strong>INNER</strong> side of the black lines, leaving no black color
visible after the cuts are done. On the Clock cover the cuts need to be
made <strong>THROUGH</strong> the black lines.</li>
</ol>
</div>
<ol start="8" type="1">
<li>The Multi-Blind cube outlines file has multiple pages, each of them
with numbered spots for 14 cubes (two TNoodle scramble sets). The first
page is for scrambles 1-14, the second is for 15-28, and so on, all the
way up to scramble 84. You can print out as many of these as you require
for your competition. Consider how many scramblers you will have, and
how many cubes your competitors will be attempting. You can continue
reusing these sheets for future competitions so as not to waste
paper.</li>
</ol>
<p>When scrambling a Multi-Blind attempt, place each cube on the number
of the scramble that was applied to it. Also make sure you never have
two people scrambling cubes using the same cube outlines sheet (remember
that one of these sheets corresponds to two TNoodle scramble sheets,
since those have 7 scrambles per page). All of this greatly reduces the
risk of applying the same scramble twice, which could result in the
competitor receiving an extra, which is a big hindrance to the flow of a
competition.</p>
<div class="box warning">
<p><a
href="https://drive.google.com/drive/folders/1EVqEWSqruZ8_vEJpUmqhFUqaikzgUkkP">Link
to the templates folder</a></p>
<p>Please only share the link to THIS page and not the direct link to
the folder.</p>
</div>
<h2 id="credits">Credits</h2>
<p>Paper/card templates - Deni Mintsaev<br/> 3D multipurpose cover -
Brendan Bakker, Patrick Dwyer, YouBeen Lee, and KCCU<br/> 3D Clock cover
- Francisco Montañés Barbudo and Mitchell Lane<br/> Competitor guide and
Multi-Blind scrambling guide illustrations - Tom Nelson<br/> Multi-Blind
cube outlines sheet - Callum Goodyear</p>
<h2 id="translations">Translations</h2>
<p>Below you can find translations of this document. Contact
quality@worldcubeassociation.org for instructions on how to add your own
translation.</p>
<ul>
<li><a
href="https://documents.worldcubeassociation.org/edudoc/competition-templates/competition-templates-pl.pdf">Polski
(Polish)</a> - translated by Stanislaw Ulbrych and Tomasz Stawowy</li>
<li><a
href="https://documents.worldcubeassociation.org/edudoc/competition-templates/competition-templates-ru.pdf">Русский
(Russian)</a> - translated by Deni Mintsaev</li>
<li><a
href="https://documents.worldcubeassociation.org/edudoc/competition-templates/competition-templates-es.pdf">Español
(Spanish)</a> - translated by Gennaro Monetti</li>
</ul>
</body>
</html>
grewn0uille commented 4 months ago

Hi!

You can use the --presentational-hints option if you want to handle HTML presentational hints such as start.

Duplicate of #2003.

dmint789 commented 4 months ago

@grewn0uille thank you! That works