diff --git a/content/terms/how-to/track-new-terms.md b/content/terms/how-to/track-new-terms.md index 157e2ce6..98e13cb8 100644 --- a/content/terms/how-to/track-new-terms.md +++ b/content/terms/how-to/track-new-terms.md @@ -6,13 +6,30 @@ aliases: /contributing-terms/ # How to track new terms -Tracking terms is done by _declaring_ them and the service they are associated with. Such a declaration is achieved by editing JSON files in the [`declarations`](https://github.com/OpenTermsArchive/contrib-declarations/tree/main/declarations) folder. +This is a step by step guide to help you add declarations to the [contrib-declaration](https://github.com/OpenTermsArchive/contrib-declarations) repository. This repository is dedicated for volunteer contribution of declarations to Open Terms Archive. -Before adding new terms, open the [`declarations`](https://github.com/OpenTermsArchive/contrib-declarations/tree/main/declarations) folder and check if the service you want to track terms for is already declared. If a JSON file with the name of the service is already present, you can jump straight to the [Terms reference]({{< relref "terms/reference" >}}). Otherwise, keep reading! +Having understood briefly how a declaration is structured in JSON format, we need to look at concrete steps on how you can add these JSON files to the repository. -## Declaring a new service +## Prerequisites -Before declaring a service, you will need to choose the service name and service ID. The service ID will be the name of the JSON file in which the service will be declared. It is a normalised version of the service name. +In order to add declarations: + +1. You need to have [Node.js](https://nodejs.org/en/) installed on your machine. If you don't have it, you can download it from the official website [here](https://nodejs.org/en/download/). +2. You need to have git installed on your machine. If you don't have it, you can download it from the official website [here](https://git-scm.com/downloads). + +## Adding a declaration + +To add a declaration, you need to follow these steps: + +1. Clone the [contrib-declaration](https://github.com/OpenTermsArchive/contrib-declarations) repository to your local machine. +2. Create a branch that describes your contribution e.g. `add-Open-Terms-Archive-ToS` or `add-firefox-privacy-policy` +3. Run `npm install`. This is to install all the dependencies including the Open Terms Archive engine which will allow you to test and validate your declaration to make sure it is ok. +4. Create a JSON file with the name of the service you are adding the declaration for. This JSON file should be in the `declarations` folder of the repository. To learn more about selecting the right service name, please read the [Service name](#service-name) section below. +5. Visit the declaration URL and use [browser developer tools](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Tools_and_setup/What_are_browser_developer_tools) to inspect the page and find the right selectors for the significant section containing the terms you want to declare. +6. After you've properly added your selectors and structured your JSON file, you need to test and validate your JSON file to make sure it is ok. To do this, you need to run `npx ota validate --services [service name]` from the root of the repository. This will run a validation on the declaration, highlighting any changes required. +7. If all tests are good, make a pull request to the main repository. + +> If you have a hard time finding the service name, check out the [practical guidelines to find the service name]({{< relref "/terms/guidelines/declaring" >}}), and feel free to mention your uncertainties in the pull request! We will help you improve the service name if necessary 🙂 ## Service name diff --git a/themes/opentermsarchive/assets/css/components/aside.css b/themes/opentermsarchive/assets/css/components/aside.css index b44c0e5e..cc305d3e 100644 --- a/themes/opentermsarchive/assets/css/components/aside.css +++ b/themes/opentermsarchive/assets/css/components/aside.css @@ -1,112 +1,170 @@ .aside { flex-shrink: 0; - margin-right:var(--mXL); + margin-right: var(--mXL); @mixin grid 3, 2; - border:1px solid var(--colorBlack200); - border-radius:4px; + border: 1px solid var(--colorBlack200); + border-radius: 4px; } @media (--tabletSmall) { .aside { max-width: 100%; - margin-bottom:var(--m2XL); + margin-bottom: var(--m2XL); } } -.aside_nav{ - ul{ - color:var(--colorBlack600); - display:flex; - flex-direction:column; +.aside_nav { + > ul > li > details > ul > li:last-child, + > ul > li > details > ul > li:not(:last-child) > ul { + margin-bottom: var(--mS); + } + + ul { + color: var(--colorBlack600); + display: flex; + flex-direction: column; - li{ - border-bottom:1px solid var(--colorBlack200); + li { + position: relative; + border-bottom: 1px solid var(--colorBlack200); + + &:last-child { + border: none; + } - a{ + a { padding: var(--mXS) var(--mS); - display:inline-block; - width:100%; + display: inline-block; + width: 100%; + } + + .aside_item-current { + color: var(--colorBlack800); + + &::before { + content: ''; + position: absolute; + left: 0; + width: 4px; + background-color: var(--colorPrimary); + border-radius: 0 10px 10px 0; + z-index: 1; + top: var(--m2XS); + bottom: var(--m2XS); + } - &:hover{ - background-color:var(--colorBlack200); + &::after { + content: ''; + position: absolute; + background-color: var(--colorBlack200); + border-radius: 4px; + z-index: -1; + left: var(--mXS); + right: var(--m2XS); + top: var(--m2XS); + bottom: var(--m2XS); } } - &:last-child{ - border:none; + &.aside_item-current-section { + &::before { + content: ''; + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 1px; + background-color: var(--colorPrimary); + border-radius: 0; + } + + & .aside_item-current { + &::before { + top: 2px; + bottom: 2px; + } + + &::after { + top: 0; + bottom: 0; + right: var(--mXS); + } + } } - details{ + details { position: relative; - summary{ + summary { padding: var(--mXS) var(--mS); list-style: none; cursor: pointer; - &:hover{ - background-color:var(--colorBlack200); - } - &::marker, - &::-webkit-details-marker{ + &::-webkit-details-marker { display: none; } - - & svg{ + + & svg { position: absolute; right: 10px; - top:14px; - font-size:0.8em; - color:var(--colorBlack400); + top: 14px; + font-size: 0.8em; + color: var(--colorBlack400); transition: transform 0.2s ease; } - } - &[open]{ - summary > svg{ - transform: rotate(180deg); + &:hover::after { + content: ''; + position: absolute; + inset: 0; + background-color: var(--colorBlack100); + z-index: -1; } } + + &[open] summary > svg { + transform: rotate(180deg); + } } - span{ - display:inline-block; + span { + display: inline-block; } } - ul{ - padding-left:var(--mS); - padding-top:var(--m2XS); - padding-bottom:var(--m2XS); + ul { + li { + border: none; - li{ - border:none; - padding-top:var(--m3XS); - padding-bottom:var(--m3XS); + a { + padding: var(--p3XS) var(--mL); + border-radius: 4px; + } - a{ - padding: 0; + > span, + a { + padding-left: var(--mS); + } - &:hover{ - background-color: transparent; - } + > a { + padding-top: var(--p3XS); + padding-bottom: var(--p3XS); } - ul{ - padding-top:0; - padding-bottom:0; + ul { + padding-top: 0; + + li { + padding: 0; - li{ - padding:0; + a { + padding: var(--p3XS) var(--mL); + border-radius: 4px; + } } } } } } } - -.aside_item-current{ - border-left:2px solid var(--colorPrimary); -} - diff --git a/themes/opentermsarchive/assets/css/custom-properties.css b/themes/opentermsarchive/assets/css/custom-properties.css index 28582788..344486fc 100644 --- a/themes/opentermsarchive/assets/css/custom-properties.css +++ b/themes/opentermsarchive/assets/css/custom-properties.css @@ -26,6 +26,7 @@ --colorBlack400: #999; --colorBlack300: #d6d6d6; --colorBlack200: #f5f5f5; + --colorBlack100: #fafafa; --colorWhite: #fefffd; /* Padding & margin */ diff --git a/themes/opentermsarchive/layouts/partials/aside.html b/themes/opentermsarchive/layouts/partials/aside.html index 232d3f49..c4dd6ae0 100644 --- a/themes/opentermsarchive/layouts/partials/aside.html +++ b/themes/opentermsarchive/layouts/partials/aside.html @@ -4,9 +4,9 @@