### Install Dependencies (Ruby) Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/README.md Installs all project dependencies defined in the Gemfile for the laws.africa website, ensuring the local development environment is correctly configured. ```Shell bundle install ``` -------------------------------- ### Install Bundler (Ruby) Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/README.md Installs the Bundler gem, a dependency manager for Ruby projects, which is required for local development of the laws.africa website. ```Shell gem install bundler ``` -------------------------------- ### Policy Document Example - Laws Africa Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown Demonstrates a 'Policy' document type with its example link and FRBR URI. This entry showcases a specific legal document within the 'doc' doctype. ```HTML Policy SADC Regional Water Policy policy /akn/aa-sadc/doc/policy/2005/water ``` -------------------------------- ### Study Document Example - Laws Africa Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown Presents an example of a 'Study' document type, including its hyperlink and FRBR URI. This entry is for documents classified under the 'study' subtype within the 'doc' doctype. ```HTML Study Study on Transitional Justice and Human and Peoples’ Rights in Africa study /akn/aa-au/doc/study/achpr/2018/transitional-justice-and-human-and-peoples-rights ``` -------------------------------- ### Policy Framework Document Example - Laws Africa Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown Illustrates 'Policy Framework' documents, showing two examples with their respective links and FRBR URIs. It highlights the 'policy-framework' subtype and includes a note about potential subtype adjustments. ```HTML Policy Framework Policy Framework for Pastoralism in Africa policy-framework /akn/aa-au/doc/policy-framework/auc-department-of-rural-economy-and-agriculture/2010/pastoralism Framework and Guidelines* on Land Policy in Africa
* While the phrase ‘policy framework’ does appear in the document, we stand to be corrected on whether this document should fall under a different subtype, potentially ‘statement/framework-and-guidelines’. We hesitate to create subtypes that only include one document, but this may be an instance where it makes sense to do so. /akn/aa-au/doc/policy-framework/auc-uneca-afdb-consortium/2010/land ``` -------------------------------- ### Namibia Constitution Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of the Constitution document type from Namibia, 'Namibian Constitution'. It includes a link and FRBR URI. ```HTML Constitution Namibian Constitution (Namibia) /akn/na/act/1990/constitution ``` -------------------------------- ### South Africa Board Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a Board Notice document type from South Africa, 'Directions Regarding Livestock Auctions (Board Notice 85 of 2020)'. It provides a link and FRBR URI. ```HTML Board Notice Directions Regarding Livestock Auctions (Board Notice 85 of 2020) (South Africa) bn /akn/za/act/bn/2020/85 ``` -------------------------------- ### Run Jekyll Server (Ruby) Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/README.md Starts the Jekyll development server with live reloading enabled, allowing developers to preview local changes to the laws.africa website. ```Shell jekyll server --watch ``` -------------------------------- ### Yearbook Document Example - Laws Africa Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown Details a 'Yearbook' document type with its associated example link and FRBR URI. This entry represents documents categorized as 'yearbook' under the 'doc' doctype. ```HTML Yearbook African Human Rights Yearbook Volume 3 (2019) yearbook /akn/aa-au/doc/yearbook/achpr/2019/3 ``` -------------------------------- ### Attribution Example for Websites Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/api/detail.md Provides a recommended format for attributing Laws.Africa and its contributors on a website or application, adhering to the CC-BY-NC-SA license terms. ```HTML

Legislation provided by Laws.Africa and their contributors under a CC-BY-NC-SA license.

``` -------------------------------- ### South Africa By-law Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a By-law document type from Mbizana Municipality, South Africa, 'Control of Temporary Advertisements By-law'. Includes a link and FRBR URI. ```HTML By-law Control of Temporary Advertisements By-law (Mbizana Municipality, South Africa) by-law /akn/za-ec443/act/by-law/2017/temporary-advertisements ``` -------------------------------- ### South Africa Board Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown This snippet provides an example of a South African 'Board Notice', specifically 'Directions Regarding Livestock Auctions (Board Notice 85 of 2020)'. It details the document type, a link to the English version, and its FRBR URI. ```HTML Board Notice Directions Regarding Livestock Auctions (Board Notice 85 of 2020) (South Africa) bn /akn/za/act/bn/2020/85 ``` -------------------------------- ### South Africa Municipal Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a Municipal Notice document type from eThekwini Municipality, South Africa, 'Electricity Supply By-law (Durban Transitional Metropolitan Council): Correction'. Includes a link and FRBR URI. ```HTML Municipal Notice Electricity Supply By-law (Durban Transitional Metropolitan Council): Correction (Municipal Notice 7 of 1999) (eThekwini Municipality, South Africa) mn ``` -------------------------------- ### South Africa Municipal Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown This snippet provides an example of a South African 'Municipal Notice' from eThekwini Municipality, concerning 'Electricity Supply By-law (Durban Transitional Metropolitan Council): Correction'. It includes the document type, a link to the English version, and its FRBR URI. ```HTML Municipal Notice Electricity Supply By-law (Durban Transitional Metropolitan Council): Correction (Municipal Notice 7 of 1999) (eThekwini Municipality, South Africa) mn /akn/za-eth/act/mn/1999/7 ``` -------------------------------- ### Namibia Constitution Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown This snippet shows the 'Namibian Constitution' as an example of a Constitution document type from Namibia. It includes the document type and its FRBR URI. ```HTML Constitution Namibian Constitution (Namibia) /akn/na/act/1990/constitution ``` -------------------------------- ### Ghana Legislative Instrument Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a Legislative Instrument document type from Ghana, 'Labour Regulation, 2007'. Includes a link and FRBR URI. ```HTML Legislative Instrument Labour Regulation, 2007 (Legislative Instrument 1833 of 2007) (Ghana) li /akn/gh/act/li/2007/1833 ``` -------------------------------- ### Akomando Project Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-10-04-machine-friendly-legislation-whos-doing-what.markdown Information about the Akomando project. ```HTML http://www.akomando.bitnomos.eu/ ``` -------------------------------- ### Lesotho Legal Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a Legal Notice document type from Lesotho, 'Public Health (COVID-19) Regulations, 2020'. It provides a link and FRBR URI. ```HTML Legal Notice Public Health (COVID-19) Regulations, 2020 (Legal Notice 38 of 2020) (Lesotho) ln /akn/ls/act/ln/2020/38 ``` -------------------------------- ### Uganda Decree Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a Decree document type from Uganda, 'Interpretation Act (Chapter 3, Decree 18 of 1976)'. It provides a link and FRBR URI. ```HTML Decree Interpretation Act (Chapter 3, Decree 18 of 1976) (Uganda) decree /akn/ug/act/decree/1976/18 ``` -------------------------------- ### BungeniX and BungeniEd Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-10-04-machine-friendly-legislation-whos-doing-what.markdown Bungeni Consulting offers BungeniX for conversion to Akoma Ntoso and BungeniEd for legislative drafting and editing. ```HTML https://www.bungeni.com/text_to_akomantoso.html ``` ```HTML https://www.bungeni.com/legislative_drafting.html ``` -------------------------------- ### Ghana Legislative Instrument Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown This snippet shows an example of a Ghanaian 'Legislative Instrument', the 'Labour Regulation, 2007'. It includes the document type, a link to the English version, and its FRBR URI. ```HTML Legislative Instrument Labour Regulation, 2007 (Legislative Instrument 1833 of 2007) (Ghana) li /akn/gh/act/li/2007/1833 ``` -------------------------------- ### List Publication Versions (Liquid) Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_layouts/publication.html Retrieves and lists all versions of a publication, sorted by date in descending order. It iterates through publications matching the current page's key and displays them with links, highlighting the current version. ```liquid {% assign versions = site.publications | where: "key", page.key | sort: "date" | reverse %} {% if versions.size > 1 %} * Versions: {% for ver in versions %}* {% if ver.date == page.date %} {{ ver.date|date:"%e %b %Y" }} {% else %} [{{ ver.date|date:"%e %b %Y" }}]({{ ver.url }}) {% endif %} {% endfor %} {% endif %} ``` -------------------------------- ### Akoma Ntoso URI Resolver Demo Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-10-04-machine-friendly-legislation-whos-doing-what.markdown This tool helps resolve references to legislation, accounting for different versions and languages. It makes informed guesses when information is incomplete and allows users to switch between versions. ```HTML http://akresolver.cs.unibo.it/ ``` -------------------------------- ### Indigo Platform Technology Stack Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/indigo/index.html Indigo Platform is built using Python for its backend logic, with the Django framework providing a robust structure for web development. PostgreSQL is used as the database management system to store and manage legislative data. ```Python import django # Django settings are typically configured in settings.py # Example of accessing a setting: # print(django.conf.settings.DATABASES['default']['ENGINE']) # Example of a Django model (conceptual) # from django.db import models # class Legislation(models.Model): # title = models.CharField(max_length=255) # content = models.TextField() # publication_date = models.DateField() print("Indigo Platform built with Python and Django.") ``` ```SQL -- Example PostgreSQL table structure (conceptual) CREATE TABLE legislation ( id SERIAL PRIMARY KEY, title VARCHAR(255) NOT NULL, content TEXT, publication_date DATE ); ``` -------------------------------- ### Lesotho Legal Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown This snippet provides an example of a Lesotho 'Legal Notice', the 'Public Health (COVID-19) Regulations, 2020'. It includes the document type, a link to the English version, and its FRBR URI. ```HTML Legal Notice Public Health (COVID-19) Regulations, 2020 (Legal Notice 38 of 2020) (Lesotho) ln /akn/ls/act/ln/2020/38 ``` -------------------------------- ### Uganda Decree Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown This snippet presents an example of a Ugandan 'Decree', the 'Interpretation Act (Chapter 3, Decree 18 of 1976)'. It includes the document type, a link to the version on ULI, and its FRBR URI. ```HTML Decree Interpretation Act (Chapter 3, Decree 18 of 1976) (Uganda) decree /akn/ug/act/decree/1976/18 ``` -------------------------------- ### Preprocessing Definition Text Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-09-02-how-we-built-an-automated-glossary-for-namibian-legislation.markdown Extracts plain text from definition elements, removes punctuation and numbers, and normalizes whitespace. It prepares text data for further analysis by cleaning and standardizing it. ```Python import sys import unicodedata import re num_re = re.compile(r'[0-9]+') def defn_text(element): """ Extract plain text (without punctuation and numbers) from definition XML elements. """ # join text elements with spaces, strip punctuation, and convert to lowercase text = remove_punctuation(' '.join(element.itertext()) or '').lower() # replace numbers with N text = num_re.sub(r'[0-9]+', 'N', text) return text def remove_punctuation(text): # strip punctuation in unicode # https://stackoverflow.com/questions/11066400/remove-punctuation-from-unicode-formatted-strings punct_table = dict.fromkeys(i for i in range(sys.maxunicode) if unicodedata.category(chr(i)).startswith('P')) return text.translate(punct_table) # map a list of definition elements to plain text # Assuming 'definitions' is a list of XML elements # texts = [defn_text(e) for e in definitions] ``` -------------------------------- ### South Africa Ministerial Order Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a Ministerial Order document type from South Africa, 'Ministerial Order: South African Civil Aviation Authority'. Includes a link and FRBR URI. ```HTML Ministerial Order Ministerial Order: South African Civil Aviation Authority (Unnumbered Ministerial Order, 2020) (South Africa) mo /akn/za/act/mo/2020/civil-aviation-authority-covid-19 ``` -------------------------------- ### Ghana Executive Instrument Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of an Executive Instrument document type from Ghana, 'Imposition of Restrictions (Coronavirus Disease (COVID-19) Pandemic) (No. 5) Instrument, 2020'. Includes a link and FRBR URI. ```HTML Executive Instrument Imposition of Restrictions (Coronavirus Disease (COVID-19) Pandemic) (No. 5) Instrument, 2020 (Executive Instrument 68 of 2020) (Ghana) ei /akn/gh/act/ei/2020/68 ``` -------------------------------- ### Sankofa Project Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-10-04-machine-friendly-legislation-whos-doing-what.markdown Details about the Sankofa project, likely related to legal text processing. ```HTML https://gitlab.com/CIRSFID/un-challange-2019/blob/master/documents/project.md ``` -------------------------------- ### LIME - Language-Independent Markup Editor Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-10-04-machine-friendly-legislation-whos-doing-what.markdown LIME is an editor that allows human annotators to mark up legal text without manual XML coding. It features an 'Automatic markup' function to suggest elements, which can then be refined by the user. ```HTML http://sinatra.cirsfid.unibo.it/lime-lex/ ``` -------------------------------- ### Document Collection Texts Example - Laws Africa Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown Showcases an example of 'Texts' within a 'documentCollection' doctype, providing the document title, subtype, and FRBR URI. This entry illustrates a collection of regulatory and institutional texts. ```HTML Texts Regulatory and Institutional Texts for the Implementation of the Yamoussoukro Decision and Framework Towards the Establishment of a Single African Air Transport Market texts /akn/aa-au/documentCollection/texts/austc-transport-infrastructure-energy-tourism/nd/implementation-of-the-yamoussoukro-decision ``` -------------------------------- ### Displaying Partner Logos and Links Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/index.html This snippet demonstrates how to iterate through a list of portals (partners) and display their logos with corresponding links. It's a common pattern for showcasing affiliated organizations or services. ```Jekyll/Liquid {% for portal in page.portals %} [![{{ portal.name }}](/img/{{ portal.logo }})]({{ portal.url }}) {% endfor %} ``` -------------------------------- ### Malawi Government Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a Government Notice document type from Malawi, 'Public Health (Corona Virus and COVID-19) (Prevention, Containment and Management) Rules, 2020'. Includes a link and FRBR URI. ```HTML Government Notice Public Health (Corona Virus and COVID-19) (Prevention, Containment and Management) Rules, 2020 (Government Notice 48 of 2020) (Malawi) gn /akn/mw/act/gn/2020/48 ``` -------------------------------- ### Xcential LegisPro Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-10-04-machine-friendly-legislation-whos-doing-what.markdown LegisPro is an XML technology solution provided by Xcential for legislative work. ```HTML https://xcential.com/legispro-xml-tech/ ``` -------------------------------- ### FRBR URI Example: South African Municipalities Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Provides an example of FRBR URI construction for municipal by-laws in South Africa, utilizing the country code 'za' and a specific locality code assigned to the municipality. ```URI /akn/za-ec443/… ``` -------------------------------- ### South Africa Ministerial Order Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation.markdown This snippet shows an example of a South African 'Ministerial Order' related to the Civil Aviation Authority and COVID-19. It includes the document type, a link to the English version, and its FRBR URI. ```HTML Ministerial Order Ministerial Order: South African Civil Aviation Authority (Unnumbered Ministerial Order, 2020) (South Africa) mo /akn/za/act/mo/2020/civil-aviation-authority-covid-19 ``` -------------------------------- ### Indigo-Web CSS Library Usage Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2021-11-16-best-practices-legislation-online.md This snippet details how to integrate the indigo-web CSS library into a website to automatically style online legislation according to Laws.Africa's best practices. It is particularly relevant for users of the Indigo Legislation Platform or the Legislation Content API. ```CSS /* Include the indigo-web CSS into your website */ ``` -------------------------------- ### Responsive Image Width CSS Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/best-practices-online-legislation.markdown Ensures images are responsive by setting their width to 100% of their container. This allows images to scale appropriately across different screen sizes, preventing them from being too large on small screens or too small on large screens. ```CSS img { width: 100%; height: auto; } ``` -------------------------------- ### South Africa Local Authority Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a Local Authority Notice document type from Johannesburg Municipality, South Africa, 'Rights of Way for Electronic Communications Facilities'. Includes a link and FRBR URI. ```HTML Local Authority Notice Rights of Way for Electronic Communications Facilities (Local Authority Notice 1628 of 2008) (Johannesburg Municipality, South Africa) lan /akn/za-jhb/act/lan/2008/1628 ``` -------------------------------- ### Laws.Africa Indigo Editor Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-10-04-machine-friendly-legislation-whos-doing-what.markdown The Indigo editor from Laws.Africa is a tool for working with legislative text. ```HTML https://github.com/laws-africa/indigo/ ``` -------------------------------- ### Mauritius General Notice Example Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_publications/akn4africa-recommendation-2021-06-18.markdown Example of a General Notice document type from Mauritius, 'Order under Section 3(1)(a) of the Quarantine Act 2020: Prohibition of Aircraft and Ships into Mauritius'. Includes a link and FRBR URI. ```HTML General Notice Order under Section 3(1)(a) of the Quarantine Act 2020: Prohibition of Aircraft and Ships into Mauritius (General Notice 1937 of 2020) (Mauritius) genn /akn/mu/act/genn/2020/1937 ``` -------------------------------- ### JavaScript Chart for Glossary Entries Source: https://github.com/laws-africa/laws-africa.github.io/blob/master/_posts/2019-09-02-how-we-built-an-automated-glossary-for-namibian-legislation.markdown This JavaScript code uses the Chart.js library to create a bar chart visualizing the number of glossary entries per letter of the alphabet for Namibian legislation. It configures chart type, data labels, datasets, and display options for a clean, informative presentation. ```JavaScript $(function() { var canvas = document.getElementById('glossary-chart'), ctx = canvas.getContext('2d'), labels = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'Y', 'Z'], values = [1, 235, 100, 293, 200, 143, 138, 76, 53, 136, 17, 8, 124, 171, 100, 79, 341, 10, 228, 295, 173, 53, 49, 59, 3, 1]; new Chart(ctx, { type: 'bar', data: { labels: labels, datasets: [{ label: 'Entries', data: values, borderWidth: 0, backgroundColor: '#D04242', }] }, options: { maintainAspectRatio: false, legend: {display: false}, title: { display: true, text: 'Number of Glossary Entries', }, scales: { yAxes: [{ ticks: { precision: 0, beginAtZero: true, }, }], xAxes: [{ gridLines: { display: false, } }], }, } }); }); ```