Skip to content

Commit

Permalink
Merge pull request #278 from laws-africa/intro-wrapup
Browse files Browse the repository at this point in the history
intro and wrapUp are block elements
  • Loading branch information
longhotsummer authored Jul 3, 2024
2 parents 1fc71bb + c9f7b20 commit 83693d9
Show file tree
Hide file tree
Showing 18 changed files with 213 additions and 135 deletions.
4 changes: 2 additions & 2 deletions law-widget-styles/jest-puppeteer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
launch: {
defaultViewport: {
width: 1024,
height: 1024,
height: 1500,
}
}
}
};
3 changes: 2 additions & 1 deletion law-widget-styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
],
"scripts": {
"build": "sass --style compressed scss/law-widget-styles.scss css/law-widget-styles.min.css && sass scss/law-widget-styles.scss css/law-widget-styles.css",
"test-images": "jest"
"build-tests": "sass --style compressed tests/structure.scss tests/structure.css",
"test-images": "npm run build-tests && jest"
},
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion law-widget-styles/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ $akn-elements-list-like: (

// AKN block and block-like elements
$akn-elements-block: (
"blockContainer", "block", "blockList", "conclusions", "coverPage", "foreign", "item",
"blockContainer", "block", "blockList", "conclusions", "coverPage", "foreign", "intro", "item",
"listIntroduction", "listWrapUp", "ol", "p", "preamble", "preface", "tblock", "toc", "ul",
"wrapUp",
// speech blocks
"from", "narrative", "scene", "summary"
);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions law-widget-styles/tests/primary-styling-structure.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../css/law-widget-styles.css">
<link rel="stylesheet" href="structure.css">
</head>
<body>

<div class="akoma-ntoso show-structure">

<span class="akn-akomaNtoso">
<span class="akn-act" data-name="act">

<section class="akn-preface" id="preface">
<span class="akn-p" id="preface__p_1" data-eId="preface__p_1">Text in the preface.</span>
</section>
<section class="akn-preamble" id="preamble">
<span class="akn-p" id="preamble__p_1" data-eId="preamble__p_1">Text in the preamble.</span>
</section>
<span class="akn-body">
<section class="akn-chapter" id="chp_1" data-eId="chp_1"><h2>Chapter 1<br>A Chapter Heading</h2>
<section class="akn-section" id="chp_1__sec_1" data-eId="chp_1__sec_1"><h3>1. Section One</h3>
<section class="akn-subsection" id="chp_1__sec_1__subsec_1" data-eId="chp_1__sec_1__subsec_1"><span class="akn-num">(1)</span><span class="akn-intro">
<span class="akn-p" id="chp_1__sec_1__subsec_1__intro__p_1" data-eId="chp_1__sec_1__subsec_1__intro__p_1">Subsection 1 with a list of sub-paragraphs:</span>
</span><section class="akn-paragraph" id="chp_1__sec_1__subsec_1__para_a" data-eId="chp_1__sec_1__subsec_1__para_a"><span class="akn-num">(a)</span><span class="akn-content">
<span class="akn-p" id="chp_1__sec_1__subsec_1__para_a__p_1" data-eId="chp_1__sec_1__subsec_1__para_a__p_1">sub 1(1)(a)</span>
</span></section><section class="akn-paragraph" id="chp_1__sec_1__subsec_1__para_b" data-eId="chp_1__sec_1__subsec_1__para_b"><span class="akn-num">(b)</span><span class="akn-content">
<span class="akn-p" id="chp_1__sec_1__subsec_1__para_b__p_1" data-eId="chp_1__sec_1__subsec_1__para_b__p_1">sub 1(1)(a)</span>
</span></section></section><section class="akn-subsection" id="chp_1__sec_1__subsec_2" data-eId="chp_1__sec_1__subsec_2"><span class="akn-num">(2)</span><span class="akn-content">
<span class="akn-p" id="chp_1__sec_1__subsec_2__p_1" data-eId="chp_1__sec_1__subsec_2__p_1">Subsection 2 with plain text.</span>
</span></section></section></section>
<span class="akn-hcontainer" data-name="hcontainer" id="hcontainer_1" data-eId="hcontainer_1">
<h3 class="akn-crossHeading" id="hcontainer_1__crossHeading_1" data-eId="hcontainer_1__crossHeading_1">A crossheading</h3>
</span>
<section class="akn-section" id="sec_2" data-eId="sec_2"><h3>2. Section Two</h3>
<span class="akn-content">
<span class="akn-p" id="sec_2__p_1" data-eId="sec_2__p_1">Text without sub-paragraphs.</span>
</span></section>
<section class="akn-section" id="sec_3" data-eId="sec_3"><h3>3. Section three</h3>
<span class="akn-intro">
<span class="akn-p" id="sec_3__intro__p_1" data-eId="sec_3__intro__p_1">Intro text.</span>
</span><section class="akn-subsection" id="sec_3__subsec_1" data-eId="sec_3__subsec_1"><span class="akn-num">(1)</span><span class="akn-content">
<span class="akn-blockList" id="sec_3__subsec_1__list_1" data-eId="sec_3__subsec_1__list_1">
<span class="akn-listIntroduction" id="sec_3__subsec_1__list_1__intro_1" data-eId="sec_3__subsec_1__list_1__intro_1">Subsection 1 with a list of items:</span>
<span class="akn-item" id="sec_3__subsec_1__list_1__item_a" data-eId="sec_3__subsec_1__list_1__item_a">
<span class="akn-num">(a)</span>
<span class="akn-p" id="sec_3__subsec_1__list_1__item_a__p_1" data-eId="sec_3__subsec_1__list_1__item_a__p_1">sub 1(1)(a)</span>
</span>
<span class="akn-item" id="sec_3__subsec_1__list_1__item_b" data-eId="sec_3__subsec_1__list_1__item_b">
<span class="akn-num">(b)</span>
<span class="akn-p" id="sec_3__subsec_1__list_1__item_b__p_1" data-eId="sec_3__subsec_1__list_1__item_b__p_1">sub 1(1)(a)</span>
</span>
</span>
</span></section><span class="akn-wrapUp">
<span class="akn-p" id="sec_3__wrapup__p_1" data-eId="sec_3__wrapup__p_1">Wrap-up text.</span>
</span></section>
<section class="akn-section" id="sec_4" data-eId="sec_4"><h3>4. Inlines</h3>
<span class="akn-content">
<span class="akn-p" id="sec_4__p_1" data-eId="sec_4__p_1">An <span class="akn-remark" data-status="editorial">[editorial remark]</span>.</span>
</span></section>
<section class="akn-section" id="sec_5" data-eId="sec_5"><h3>5. Alinea</h3>
<section class="akn-alinea akn--no-indent" id="sec_5__al_nn_1" data-eId="sec_5__al_nn_1"><span class="akn-content">
<span class="akn-p" id="sec_5__al_nn_1__p_1" data-eId="sec_5__al_nn_1__p_1">an alinea</span>
</span></section><section class="akn-alinea" id="sec_5__al_n" data-eId="sec_5__al_n"><span class="akn-num">n</span><span class="akn-content">
<span class="akn-p" id="sec_5__al_n__p_1" data-eId="sec_5__al_n__p_1">a numbered alinea</span>
</span></section><section class="akn-alinea akn--no-indent" id="sec_5__al_nn_2" data-eId="sec_5__al_nn_2"><span class="akn-heading">Heading</span><span class="akn-content">
<span class="akn-p" id="sec_5__al_nn_2__p_1" data-eId="sec_5__al_nn_2__p_1">an alinea with a heading</span>
</span></section><section class="akn-alinea" id="sec_5__al_num" data-eId="sec_5__al_num"><span class="akn-num">num</span><span class="akn-heading">Heading</span><span class="akn-content">
<span class="akn-p" id="sec_5__al_num__p_1" data-eId="sec_5__al_num__p_1">an alinea with a num and a heading</span>
</span></section><section class="akn-alinea" id="sec_5__al_num_2" data-eId="sec_5__al_num_2"><span class="akn-num">num</span><span class="akn-heading">Heading</span><h4 class="akn-subheading">Subheading</h4>
<span class="akn-content">
<span class="akn-p" id="sec_5__al_num_2__p_1" data-eId="sec_5__al_num_2__p_1">an alinea with a num and a heading, and a subheading</span>
</span></section></section>
</span>
</span>
</span>

</div>
</body>
</html>
166 changes: 55 additions & 111 deletions law-widget-styles/tests/primary-styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,126 +9,70 @@
<div class="akoma-ntoso">

<span class="akn-akomaNtoso">
<article class="akn-act" data-contains="originalVersion" data-name="act">
<span class="akn-act" data-name="act">

<section class="akn-preface" id="preface">
<span class="akn-p">Text in the preface.</span>
<span class="akn-p" id="preface__p_1" data-eId="preface__p_1">Text in the preface.</span>
</section>
<section class="akn-preamble" id="preamble">
<span class="akn-p">Text in the preamble.</span>
<span class="akn-p" id="preamble__p_1" data-eId="preamble__p_1">Text in the preamble.</span>
</section>
<span class="akn-body">
<section class="akn-chapter" id="chp_1" data-eId="chp_1">
<h2>Chapter 1<br>A Chapter Heading</h2>
<section class="akn-section" id="sec_1" data-eId="sec_1">
<h3>1. Section One</h3>
<section class="akn-subsection" id="sec_1__subsec_1" data-eId="sec_1__subsec_1">
<span class="akn-num">(1)</span>
<span class="akn-content">
<span class="akn-blockList" id="sec_1__subsec_1__list_1" data-eId="sec_1__subsec_1__list_1">
<span class="akn-listIntroduction">Subsection 1 with a list of sub-paragraphs:</span>
<span class="akn-item" id="sec_1__subsec_1__list_1__item_a" data-eId="sec_1__subsec_1__list_1__item_a">
<span class="akn-num">(a)</span>
<span class="akn-p">sub 1(1)(a)</span>
</span>
<span class="akn-item" id="sec_1__subsec_1__list_1__item_b" data-eId="sec_1__subsec_1__list_1__item_b">
<span class="akn-num">(b)</span>
<span class="akn-p">sub 1(1)(a)</span>
</span>
<section class="akn-chapter" id="chp_1" data-eId="chp_1"><h2>Chapter 1<br>A Chapter Heading</h2>
<section class="akn-section" id="chp_1__sec_1" data-eId="chp_1__sec_1"><h3>1. Section One</h3>
<section class="akn-subsection" id="chp_1__sec_1__subsec_1" data-eId="chp_1__sec_1__subsec_1"><span class="akn-num">(1)</span><span class="akn-intro">
<span class="akn-p" id="chp_1__sec_1__subsec_1__intro__p_1" data-eId="chp_1__sec_1__subsec_1__intro__p_1">Subsection 1 with a list of sub-paragraphs:</span>
</span><section class="akn-paragraph" id="chp_1__sec_1__subsec_1__para_a" data-eId="chp_1__sec_1__subsec_1__para_a"><span class="akn-num">(a)</span><span class="akn-content">
<span class="akn-p" id="chp_1__sec_1__subsec_1__para_a__p_1" data-eId="chp_1__sec_1__subsec_1__para_a__p_1">sub 1(1)(a)</span>
</span></section><section class="akn-paragraph" id="chp_1__sec_1__subsec_1__para_b" data-eId="chp_1__sec_1__subsec_1__para_b"><span class="akn-num">(b)</span><span class="akn-content">
<span class="akn-p" id="chp_1__sec_1__subsec_1__para_b__p_1" data-eId="chp_1__sec_1__subsec_1__para_b__p_1">sub 1(1)(a)</span>
</span></section></section><section class="akn-subsection" id="chp_1__sec_1__subsec_2" data-eId="chp_1__sec_1__subsec_2"><span class="akn-num">(2)</span><span class="akn-content">
<span class="akn-p" id="chp_1__sec_1__subsec_2__p_1" data-eId="chp_1__sec_1__subsec_2__p_1">Subsection 2 with plain text.</span>
</span></section></section></section>
<span class="akn-hcontainer" data-name="hcontainer" id="hcontainer_1" data-eId="hcontainer_1">
<h3 class="akn-crossHeading" id="hcontainer_1__crossHeading_1" data-eId="hcontainer_1__crossHeading_1">A crossheading</h3>
</span>
<section class="akn-section" id="sec_2" data-eId="sec_2"><h3>2. Section Two</h3>
<span class="akn-content">
<span class="akn-p" id="sec_2__p_1" data-eId="sec_2__p_1">Text without sub-paragraphs.</span>
</span></section>
<section class="akn-section" id="sec_3" data-eId="sec_3"><h3>3. Section three</h3>
<span class="akn-intro">
<span class="akn-p" id="sec_3__intro__p_1" data-eId="sec_3__intro__p_1">Intro text.</span>
</span><section class="akn-subsection" id="sec_3__subsec_1" data-eId="sec_3__subsec_1"><span class="akn-num">(1)</span><span class="akn-content">
<span class="akn-blockList" id="sec_3__subsec_1__list_1" data-eId="sec_3__subsec_1__list_1">
<span class="akn-listIntroduction" id="sec_3__subsec_1__list_1__intro_1" data-eId="sec_3__subsec_1__list_1__intro_1">Subsection 1 with a list of items:</span>
<span class="akn-item" id="sec_3__subsec_1__list_1__item_a" data-eId="sec_3__subsec_1__list_1__item_a">
<span class="akn-num">(a)</span>
<span class="akn-p" id="sec_3__subsec_1__list_1__item_a__p_1" data-eId="sec_3__subsec_1__list_1__item_a__p_1">sub 1(1)(a)</span>
</span>
</span>
</section>
<section class="akn-subsection" id="sec_1__subsec_2" data-eId="sec_1__subsec_2">
<span class="akn-num">(2)</span>
<span class="akn-content">
<span class="akn-p">Subsection 2 with plain text.</span>
</span>
</section>
<div class="akn-crossHeading" id="sec_1__crossHeading_1" data-eId="sec_1__crossHeading_1">
<h3 id="sec_1__crossHeading_1" data-eId="sec_1__crossHeading_1">A crossheading</h3>
</div>
</section>
<section class="akn-section" id="sec_2" data-eId="sec_2">
<h3>2. Section Two</h3>
<span class="akn-hcontainer" id="sec_2__hcontainer_1" data-eId="sec_2__hcontainer_1" data-name="hcontainer">
<span class="akn-content">
<span class="akn-p">Text without sub-paragraphs.</span>
</span>
</span>
</section>
<section class="akn-section" id="sec_3" data-eId="sec_3">
<h3>3. Section three</h3>
<span class="akn-hcontainer" id="sec_3__hcontainer_1" data-eId="sec_3__hcontainer_1" data-name="hcontainer">
<span class="akn-content">
<span class="akn-p">Intro text.</span>
</span>
</span>
<section class="akn-subsection" id="sec_3__subsec_1" data-eId="sec_3__subsec_1">
<span class="akn-num">(1)</span>
<span class="akn-content">
<span class="akn-blockList" id="sec_3__subsec_1__list_1" data-eId="sec_3__subsec_1__list_1">
<span class="akn-listIntroduction">Subsection 1 with a list of sub-paragraphs:</span>
<span class="akn-item" id="sec_3__subsec_1__list_1__item_a" data-eId="sec_3__subsec_1__list_1__item_a">
<span class="akn-num">(a)</span>
<span class="akn-p">sub 1(1)(a)</span>
</span>
<span class="akn-item" id="sec_3__subsec_1__list_1__item_b" data-eId="sec_3__subsec_1__list_1__item_b">
<span class="akn-num">(b)</span>
<span class="akn-p">sub 1(1)(a)</span>
</span>
<span class="akn-item" id="sec_3__subsec_1__list_1__item_b" data-eId="sec_3__subsec_1__list_1__item_b">
<span class="akn-num">(b)</span>
<span class="akn-p" id="sec_3__subsec_1__list_1__item_b__p_1" data-eId="sec_3__subsec_1__list_1__item_b__p_1">sub 1(1)(a)</span>
</span>
<span class="akn-p">Wrap-up text.</span>
</span>
</section>
<section class="akn-subsection" id="sec_3__subsec_2" data-eId="sec_3__subsec_2">
<span class="akn-num">(2)</span>
<span class="akn-content">
<span class="akn-p">Subsection 2 with plain text.</span>
</span>
</section>
</section>
<section class="akn-section" id="sec_4" data-eId="sec_4">
<h3>4. Inlines</h3>
<span class="akn-hcontainer" id="sec_4__hcontainer_1" data-eId="sec_4__hcontainer_1" data-name="hcontainer">
<span class="akn-content">
<span class="akn-p">An <span class="akn-remark" data-status="editorial">[editorial remark]</span>.</span>
</span>
</span>
</section>
</section>
<section class="akn-alinea akn--no-indent" id="al_nn_1" data-eid="al_nn_1">
<span class="akn-content">
<span class="akn-p" id="al_nn_1__p_1" data-eid="al_nn_1__p_1">an alinea</span>
</span>
</section>
<section class="akn-alinea" id="al_n" data-eid="al_n">
<span class="akn-num">n</span>
<span class="akn-content">
<span class="akn-p" id="al_n__p_1" data-eid="al_n__p_1">a numbered alinea</span>
</span>
</section>
<section class="akn-alinea akn--no-indent" id="al_nn_2" data-eid="al_nn_2">
<span class="akn-heading">Heading</span>
<span class="akn-content">
<span class="akn-p" id="al_nn_2__p_1" data-eid="al_nn_2__p_1">an alinea with a heading</span>
</span>
</section>
<section class="akn-alinea" id="al_num" data-eid="al_num">
<span class="akn-num">num</span>
<span class="akn-heading">Heading</span>
<span class="akn-content">
<span class="akn-p" id="al_num__p_1" data-eid="al_num__p_1">an alinea with a num and a heading</span>
</span>
</section>
<section class="akn-alinea" id="al_num_2" data-eid="al_num_2">
<span class="akn-num">num</span>
<span class="akn-heading">Heading</span>
<h4 class="akn-subheading">Subheading</h4>
<span class="akn-content">
<span class="akn-p" id="al_num_2__p_1" data-eid="al_num_2__p_1">an alinea with a num and a heading, and a subheading</span>
</span>
</section>
</span></section><span class="akn-wrapUp">
<span class="akn-p" id="sec_3__wrapup__p_1" data-eId="sec_3__wrapup__p_1">Wrap-up text.</span>
</span></section>
<section class="akn-section" id="sec_4" data-eId="sec_4"><h3>4. Inlines</h3>
<span class="akn-content">
<span class="akn-p" id="sec_4__p_1" data-eId="sec_4__p_1">An <span class="akn-remark" data-status="editorial">[editorial remark]</span>.</span>
</span></section>
<section class="akn-section" id="sec_5" data-eId="sec_5"><h3>5. Alinea</h3>
<section class="akn-alinea akn--no-indent" id="sec_5__al_nn_1" data-eId="sec_5__al_nn_1"><span class="akn-content">
<span class="akn-p" id="sec_5__al_nn_1__p_1" data-eId="sec_5__al_nn_1__p_1">an alinea</span>
</span></section><section class="akn-alinea" id="sec_5__al_n" data-eId="sec_5__al_n"><span class="akn-num">n</span><span class="akn-content">
<span class="akn-p" id="sec_5__al_n__p_1" data-eId="sec_5__al_n__p_1">a numbered alinea</span>
</span></section><section class="akn-alinea akn--no-indent" id="sec_5__al_nn_2" data-eId="sec_5__al_nn_2"><span class="akn-heading">Heading</span><span class="akn-content">
<span class="akn-p" id="sec_5__al_nn_2__p_1" data-eId="sec_5__al_nn_2__p_1">an alinea with a heading</span>
</span></section><section class="akn-alinea" id="sec_5__al_num" data-eId="sec_5__al_num"><span class="akn-num">num</span><span class="akn-heading">Heading</span><span class="akn-content">
<span class="akn-p" id="sec_5__al_num__p_1" data-eId="sec_5__al_num__p_1">an alinea with a num and a heading</span>
</span></section><section class="akn-alinea" id="sec_5__al_num_2" data-eId="sec_5__al_num_2"><span class="akn-num">num</span><span class="akn-heading">Heading</span><h4 class="akn-subheading">Subheading</h4>
<span class="akn-content">
<span class="akn-p" id="sec_5__al_num_2__p_1" data-eId="sec_5__al_num_2__p_1">an alinea with a num and a heading, and a subheading</span>
</span></section></section>
</span>
</article>
</span>
</span>

</div>
Expand Down
Loading

0 comments on commit 83693d9

Please sign in to comment.