### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
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.
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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.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
```
--------------------------------
### 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
```
--------------------------------
### 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
```
--------------------------------
### 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