[examples/openspending] - openspending v0.2 (#907)

* [examples/openspending] - openspending v0.2

* [examples/openspending][m] - fix build

* [examples/openspending][xs] - fix build

* [examples/openspending][xs] - add prebuild step

* [examples/openspending][m] - fix requested by demenech

* [examples/openspending][sm] - remove links + fix bug
This commit is contained in:
Luccas Mateus
2023-05-30 20:22:58 -03:00
committed by GitHub
parent cb7d801968
commit 14974edcbf
474 changed files with 25289 additions and 116 deletions

View File

@@ -0,0 +1,48 @@
---
title: Adding a resource to the library
authors:
- Mor Rubinstein
lang: en
section: meta
---
<p>Our resource library is a curated collection open data reosurces from across the community. Everyone can add a resource to the library. This is how to do so.</p>
<h2>1. Add a folder</h2>
<p>Log in to github and head to the following <a href=https://github.com https://github.com/{{ site.github_username }}/tree/gh-pages/resources> link: </a></p>
Every resource has a slug number. To add your resource, you need to give it a number. Look at the list and give you resource the number that follows the current last number in the list (e.g - if the number is 056, your resource should be named 057).
Click on the + sign in the directory line and add the number and a “/”. For example: 060/.
<h2>2. Add an index file</h2>
<p>Click on the + sign again. Add a file named index.md to your new folder.</p>
<h2>3. Add the resource</h2>
<p>In the text editor, add the front matter fields in this pattern:</p>
<pre>
---
section: resources
lang: //Two first letters of the language, according to language code in this table.//
Author: //The name(s) of the person(s) who wrote the text//
Country: //One or more country by full name separated with a comma: “,”. If there is no specific country, write global//
Description: //1-5 lines that summarizes the text. //
Keywords: //Important descriptors of the text, separated with a comma, “,”.//
Link: //The link to the resource online//
MediaType: // List one out of these four types: Presentation, Article, / Publication, Video//
Notes: //Any notes or comments.//'
Publishing_date: //The year the resource was published, e.g. 2015.//
Publishing_entity: //The organisation(s) which publish the resource//
Region: North America,Latin America,Asia,Europe,Africa,Mena,Global
Title: //The name of the resource//
Topic: //Choose one out of these nine : The Basics,Advocacy,Privacy,civic engagement,Right for information,Data training,PolicyStandards.
---
</pre>
<h2>4. Make a pull request</h2>
<p>Click on “Create a new branch for this commit and start a pull request.” This will allow us to review your changes.</p>
Thank you! All done!

View File

@@ -0,0 +1,47 @@
---
lang: en
title: Adding a term to the glossary
authors:
- Mor Rubinstein
section: meta
---
<p>Each glossary (meaning, each translated instance of the glossary), has three components:
<ul>
<li> A layout template for the glossary homepage: 'glossary.html'</li>
<li> A layout template for the glossary in each language: 'glossary/{lang}/index.md'</li>
<li> A directory of the glossary terms. Each term in the directory is listed as the url slug (In English, all lower case letters, and hyphens instead of white spaces).</li>
</ul>
<p></p>Currently, the English glossary has been updated and organized. Other languages please follow these <a href=http://new.opendatahandbook.org/contribute/translate-glossary/>instructions</a>
To add a new term, all you need is to have a Github account.</p>
<h3>1: Create a folder for the term</h3>
<p>Log - in to Github and go to this <a href="https://github.com/{{ site.github_repo }}tree/gh-pages/glossary/en/terms">link</a></p>
<p>You will see a the branch name (“gh-pages”) and a directory. You will also see the breadcrumb <code>{{ site.github_repo }} / glossary / en / terms / + </code>. Click on the "+" to create a new folder.<p/>
<p> Write the name of the term that you want to add in a new slug (In English, all lower case letters, and hyphens instead of white spaces) and add a “/” at the end of the terms name. This will create a new folder name. </p>
<h3>2: Create a file for your term</h3>
<p> Now you will see the breadcrumb - <code>{{ site.github_repo }} / glossary / en / terms / your-new-term / + </code> Click on the “+” sign again. Now write in the path “index.md”. This will save the whole file as a markdown file. </p>
<h3>3: Write the term definition </h3>
<p> In the text editor below, add the front matter (Jekyll way to mark the page) - </p>
<pre>
---
section: terms
lang: en
title: // the term name //
---
</pre>
Write the term definition after the front matter as usual.
<h3>4: Make a pull request</h3>
<p> Click on “Create a new branch for this commit and start a pull request.” This will allow us to review your changes. <p/>
<p>Thank you! All done! If the handbook editors are happy with your term, it will be added to the glossary. </p>

View File

@@ -0,0 +1,126 @@
---
lang: en
title: Adding a page
authors:
- Sam Smith
section: meta
---
<p class="lead">Most of what you need to know to add a new page is covered under <a href="{{ "/meta/contribute/editing/" | prepend: site.baseurl }}">Editing a page</a>, so make sure you have first read through that section.</p>
<p>Adding a page follows a similar process to editing. Instead of locating your page, your first step is to locate your new pages parent directory.</p>
<h2>1: Create the page</h2>
<p>First locate the parent directory, or folder, in which your file will live. If you are adding a page to the "Get Involved" section, for example, you should be in the '<strong>get-involved</strong>' directory, where youll see a list of all the pages related to contributions.</p>
<p>Above the list of pages is a breadcrumb trail <code>{{ site.github_repo }} / get-involved / </code>, to the right of which is a plus symbol <code><strong>+</strong></code>. Click the plus symbol to create your new page.</p>
<h2>2: Name your file</h2>
<p>You should now have a new file editor page open. The first editable section you are presented with is the <em>Name your file</em> field. As we touched upon when looking at <a href="{{ "/meta/contribute/editing/" | prepend: site.baseurl }}">editing files</a>, the file name corresponds to the URL of the page on the site. There are a few of rules to follow here:</p>
<ul>
<li>The file name should reflect the title of the new page</li>
<li>Must be unique</li>
<li>Should be all lowercase</li>
<li>Words should be separated by hyphens (-)</li>
<li>File name should end with the extension '<em>.md</em>' (the .md extension indicates a markdown file)</li>
</ul>
<p>As an example, if you were creating a page titled '<em>My Cool Page</em>', you would use a file name of:</p>
<pre>
<code>my-cool-page.md</code>
</pre>
<p>Assuming you are creating this in the '<em>get-involved</em>' directory, this would result in a URL of <em>{{ site.url }}/get-involved/my-cool-page</em></p>
<div class="note">
<h6>Note</h6>
<p>The actual words used in your file name are not crucial. Its fine to use a more succinct version of your page title, for example.</p>
</div>
<h2>3: Formatting your content</h2>
<p>This step is the same as when editing a page. You need to start your file with the Front Matter, then add your content, formatting it using Markdown. Here is a template to get you started:</p>
<pre>
<code>---
title: My Cool Page
authors:
- Fred Bloggs
---
##A large introductory paragraph.
Regular paragraphs, separated by empty lines.
###A heading
Another paragraph.
* Maybe
* a
* list</code>
</pre>
<p>When youre done, click <em>Propose new file</em>.</p>
<h2>4: Make a pull request</h2>
<p>Once you have created your page(s) and updated the contents document, you're ready to make your pull request. Click the pull request icon to the right of the screen <code class="icon-git-pull-request"><span>[git pull-request icon]</span></code>, then click <em>New pull request</em>.</p>
<p>At the top of the resulting comparison screen, youll see a row of select boxes. You want to make sure these are configured like so:</p>
</article>
<div class="github panel">
<div class="range-editor">
<span class="icon-git-compare range-editor-icon"></span>
<div class="range">
<div class="range-cross-repo-pair">
<div class="select-menu js-menu-container js-select-menu fork-suggester">
<span class="minibutton select-menu-button js-menu-target" role="button" aria-label="Choose a Base Repository" aria-haspopup="true">
<i>base fork:</i>
<span class="js-select-button css-truncate css-truncate-target" title="base: ckan/ckan">{{ site.github_username }}/{{ site.github_repo }}</span>
</span>
</div>
<div class="select-menu js-menu-container js-select-menu commitish-suggester">
<span class="minibutton select-menu-button js-menu-target branch" role="button" aria-label="Choose a base branch" aria-haspopup="true">
<i>base:</i>
<span class="js-select-button css-truncate css-truncate-target" title="base: master">gh-pages</span>
</span>
</div>
</div>
<span class="dots">...</span>
<div class="range-cross-repo-pair">
<div class="select-menu js-menu-container js-select-menu fork-suggester">
<span class="minibutton select-menu-button js-menu-target" role="button" aria-label="Choose a Head Repository" aria-haspopup="true">
<i>head fork:</i>
<span class="js-select-button css-truncate css-truncate-target" title="head: mintcanary/ckan"><em>username</em>/{{ site.github_repo }}</span>
</span>
</div>
<div class="select-menu js-menu-container js-select-menu commitish-suggester">
<span class="minibutton select-menu-button js-menu-target branch" role="button" aria-label="Choose a head branch" aria-haspopup="true">
<i>compare:</i>
<span class="js-select-button css-truncate css-truncate-target" title="compare: master"><em>branch</em></span>
</span>
</div>
</div>
</div>
</div>
</div>
<article class="post-content">
<p><em><strong>username</strong> being your github username, <strong>branch</strong> being the branch you have been working on.</em></p>
<p>You should now be able to see listed below, all the changes that you wish to contribute. If everything looks as it should, click <em>Create pull request</em>.</p>
<p>Give your pull request a title and description, then click <em>Create pul request</em>. You have now contributed your pages to the OpenSpending Community site :)</p>

View File

@@ -0,0 +1,103 @@
---
lang: en
title: Editing a page
authors:
- Sam Smith
section: meta
---
<p class="lead">If you havent done so already, the first thing you need to do is head over to <a href="https://github.com/" rel="external">Github</a> and create your free account.</p>
<p>There are three steps to editing a page. First you need to locate the page you wish to edit. There are a couple of ways to do this. <strong>Method A</strong> is probably the simplest, and most likely way youll do it. <strong>Method B</strong> will serve as a primer for the next section: <em>Adding a page</em>.</p>
<h2>1: Locate the page</h2>
<h4>Method A: Browse the website</h4>
<p>While reading any section of the Handbook youll see an '<em>Edit this page</em>' link in the bottom left of the page. Following this link will take you directly to an editable version of that page. Easy huh?</p>
<div class="note">
<h6>Note</h6>
<p>When the editable page opens it will (most likely) contain a message saying <em>“You're editing a file in a project you don't have write access to”</em>. If this is your first edit to The Open Data Handbook it will say <em>“We've created a fork of this project for you to commit your proposed changes to”</em>. This is normal and part of the workflow.</p>
</div>
<h4>Method B: Browse the Github repository</h4>
<p>The entire file structure of this site can be browsed on Github. For example, the root of the site is <a href="https://github.com/{{ site.github_username }}/{{ site.github_repo }}" rel="external">here</a>, and the English language handbook section is <a href="https://github.com/{{ site.github_username }}/{{ site.github_repo }}/tree/gh-pages/en" rel="external">here</a>. Its helpful to understand that the page URLs correspond to the file structure you see here. So, if you wanted to edit the Handbook introduction page, given that its URL is <code>{{ site.url }}/<strong>en</strong>/<strong>introduction</strong>/</code> we know this file can be found in the <code><strong>en</strong></code> directory with the filename <code><strong>introduction</strong>.md</code> <em>Note: the extension (.md) is stripped from the URL.</em> Following these links you should see a preview of the page you wish to edit. From here click the edit icon <code class="icon-pencil"><span>[pencil icon]</span></code> to start editing.</p>
<div class="note">
<h6>Pro Tip!</h6>
<p>Press <code>t</code> on any tree or blob page to launch the file finder.</p>
</div>
<h2>2: Make your changes</h2>
With the editable content in front of you, youre probably either thinking “great, lets get editing”, or “hang on, this looks a bit weird”. In case its the latter, lets have a closer look.
The first thing to recognise is the Front Matter, which will look like this:
<pre>
<code>---
title: Introduction
---</code>
</pre>
<p>The front matter must be the first thing in the file, must adhere to the above syntax, and must be set between triple-dashed lines. Numerous variables can be set here, but youll usually just need <code>title</code>. The title set here will be used as the main heading for the page, as well as in the browser tab.</p>
<p>The other important thing to recognise is the Markdown syntax. For example, where you see a line commencing with two hash marks:</p>
<pre>
<code>##Do you know exactly how much of your tax money is spent on street lights?</code>
</pre>
<p>This is the Markdown way of creating a level two heading. On the site it will be outputted like so:</p>
<h2>Do you know exactly how much of your tax money is spent on street lights?</h2>
<p>Another common formatting requirement is bullet points, or lists. These are achieved in Markdown by using asterisks, like so:</p>
<pre>
<code>* civil servants
* journalists
* politicians</code>
</pre>
<p>giving you:</p>
<ul>
<li>civil servants</li>
<li>journalists</li>
<li>politicians</li>
</ul>
<br>
<p>Links are created like so:</p>
<pre>
<code>Give your data a home at the [Datahub](http://datahub.io/).</code>
</pre>
<p>result:</p>
<p>Give your data a home at the <a href="http://datahub.io/">Datahub</a>.</p>
<div class="note">
<h6>Pro Tip!</h6>
<p>To get a link to a specific heading on this site, hover over it then click the section icon <code class="icon-section"><span>[section icon]</span></code>. This will put the URL into your address bar.</p>
</div>
<p>More Markdown examples can be found <a href="{{ "/meta/contribute/markdown-examples/" | prepend: site.baseurl }}">here</a>, and a more detailed overview <a href="http://daringfireball.net/projects/markdown/syntax" rel="external">here</a>.</p>
<p>If you are unsure of your markup while editing, you can switch to the preview tab <code class="icon-eye"><span>[eye icon]</span> Preview changes</code> to see how it will be rendered.</p>
<div class="note">
<h6>Note</h6>
<p>The Github previews will look stylistically different from the live site. A different font will be used for example.</p>
</div>
<p>Once you are happy with your changes, add a summary of what you've changed in the field below the editable text. Then click <em>Propose file change</em>.</p>
<h2>3: Make a pull request</h2>
<p>You will now be presented with a pull request form. So far, the changes you have made are to your own copy, or fork of the handbook. A pull request simply sends a request to the authors/maintainers of the live handbook, asking them to include your changes - and put them live! Add any comments you have for the handbook team, then press <em>Create pull request</em>.</p>
<p>Your work here is done :) If you need to make related changes though, any new commits pushed to your branch will automatically be added to the pull request.</p>

View File

@@ -0,0 +1,76 @@
---
title: Contributing to this site
authors:
- Sam Smith
lang: en
section: meta
---
Thank you for your interest in in helping to build the OpenSpending
community site. We warmly welcome comments, corrections and additions,
as well as suggestions for additional sections and areas to
examine. For general discussion about
[OpenSpending](https://openspending.org/), please visit
[our forums](https://discuss.okfn.org/c/openspending). To jump in with
improvements and additions, read on.
## How this site works
In order to contribute, you need a little insight of how things work
under the hood. Were not going to go into too much detail here, but
these are the three components you need some understanding of:
- GitHub
- Jekyll
- Markdown
### GitHub
#### What is it?
GitHub is a web-based repository hosting service, which amongst other
things offers revision control and source code management via a
web-based graphical interface.
#### Why should I care?
Any changes you wish to make, whether they be edits to an existing
page, or creating a new one, will most likely be done via the GitHub
website (it is also possible to download and edit the files on your
local machine, instructions for this method will be added in the
future). All the files for this site can be browsed and edited the
GitHub website. You will need to [sign up](https://github.com/) for a
(free) GitHub account. For full instructions, see
[Editing a page](./editing/).
### Jekyll
#### What is it?
Jekyll is a static site generator, which allows us to host websites
based on our GitHub repositories. Jekyll takes the content, renders
Markdown, and produces a complete, static website ready to be viewed
on the web.
#### Why should I care?
All you really need to know about Jekyll is the method it uses to
include metadata (ie. page title). Each page needs to start with a
section it calls Front Matter, containing the page title. An example
is provided in the [Adding a page](./adding/) section.
### Markdown
#### What is it?
Markdown is a markup language with plain text formatting, designed so
that it can be converted to HTML. Markdown can be used to create rich
text using a plain text editor.
#### Why should I care?
Markdown is your key to formatting the text your provide for this
site. By learning a few intuitive rules youll be able to ensure your
text is formatted with headings, list, quotes etc, without writing any
HTML. For examples, head to the
[Markdown]({{site.baseurl}}/meta/contribute/markdown-examples/) section.

View File

@@ -0,0 +1,213 @@
---
lang: en
title: Markdown Examples
section: meta
---
* TOC
{:toc}
* TOC
{:toc}
This is a paragraph.
This is a paragraph.
Header 1
========
Header 2
--------
Header 1
========
Header 2
--------
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> ## This is a header.
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> Markdown.generate();
> ## This is a header.
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> Markdown.generate();
* Red
* Green
* Blue
~~~
* Red
* Green
* Blue
~~~
1. Buy flour and salt
1. Mix together with water
1. Bake
~~~
1. Buy flour and salt
1. Mix together with water
1. Bake
~~~
Paragraph:
Code
<!-- -->
Paragraph:
Code
* * *
***
*****
- - -
---------------------------------------
* * *
***
*****
- - -
---------------------------------------
This is [an example](http://datahub.io/) link.
[This link](/about/) is internal.
This is [an example] [ok] reference-style link.
[ok]: https://okfn.org/
This is [an example](http://datahub.io/) link.
[This link](/about/) is internal.
This is [an example] [ok] reference-style link.
[ok]: https://okfn.org/
*single asterisks*
_single underscores_
**double asterisks**
__double underscores__
*single asterisks*
_single underscores_
**double asterisks**
__double underscores__
This paragraph has some `code` in it.
This paragraph has some `code` in it.
![Alt Text](http://placehold.it/200x50 "Image Title")
![Alt Text](http://placehold.it/200x50 "Image Title")
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
I bet you'd like more information about this sentence [^1].
[^1]: Well lucky for you, I've included more information in a footnote.
~~~
I bet you'd like more information about this sentence [^1].
[^1]: Well lucky for you, I've included more information in a footnote.
~~~

View File

@@ -0,0 +1,65 @@
---
lang: en
title: Translating the glossary
authors:
- Mor Rubinstein
section: meta
---
<h2> What's new in the glossary</h2>
<p>In the old version of the handbook, the glossary was one page with all of the term in it. In the new version, we gave each glossary a webpage for better referencing and linking.<\p>
Glossaries that were translated in the old version of the handbook have been transfered to the new site. Please checkCheck if your language has an old version of the glossary -
. You can find them <a href=https://github.com https://github.com/{{ site.github_username }}/tree/gh-pages/glossary> here </a>
<h3><b>If you do have an old version translated, follow these steps:</b></h3>
<p> The old glossary format does not allow linking from the new version of the guide, and you will need to transfer the term to the new format.</p>
<h3> 1. Create a new folder for the term</h3>
<p>Under your language folder, Follow the breadcrumb trail <code>{{ site.github_repo }} / glossary / es /</code>, to the right of which is a plus symbol <code><strong>+</strong></code>. create a folder for each term by pressing on the '+' sign and type the term name in English. The folder names should be in lower-case letters with dashes - instead of white spaces. Add a / in the end of the name to create a new folder.</p>
<h3> 2. Translate the term</h3>
<p> open a new index.md file by clicking on the '+'. </p>
In the text editor below add the front matter:
<pre>
---
section: terms
lang: en
title: Bulk
---
</pre>
<p> Change the 'lang' field to your language code. Change the title to the term title in YOUR language.</p>
<p>Below the front matter copy the term from the old glossary.</p>
<h3> 3. Make a pull request.</h3>
<p>All done! Keep doing this until all terms got their own folder and page.</p>
<h2><b>If you have never translated the glossary before, follow the these steps:</b></h2>
<h3> Copy the English Glossary</h3>
<p> Copy the English terms directory into your target language directory in the glossary folder. This step can not be done through the Github website and you will have to fork the handbook for you machine. Information about forking and cloning can be find <a href=https://help.github.com/articles/fork-a-repo/>here</a> . Notice, some languages have already been moved and translated. Check the folder to make sure you are not overwriting someones work.</p>
<h3>Edit the term</h3>
<p>Choose a term and open the index.md file.</p>
<p>The front matter looks as follows:</p>
<pre>
---
section: terms
lang: en
title: Bulk
---
</pre>
<p>Change the lang field to your language code.</p>
<p>Change the title to the term title in YOUR language.</p>
<p>In the text editor, below the front matter, enter your translation to the term.</p>
<h3>3. Submit changes through a pull request.</h3>
<p> All done! Thank you for your help! </p>

View File

@@ -0,0 +1,41 @@
---
lang: en
title: Translating the guide
authors:
- Mor Rubinstein
section: meta
---
Translating the guide is easy, no need to any other software, all you need is a github account!
Some languages already have translated version of the guide. If you don't have a version in your language, here is how to do it.
<h3> 1. Create a new language folder </h3>
In github, under the breadcrumb - <code>{{ site.github_repo }} / guide/</code> there will be a '+' sign. Click on it and enter your <a http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes >your two letter languages code</a>. Add a dash ('/') after the two letter to create a folder.
<h3> 2. Create a page folder</h3>
Now you will see you languages code and a '+' sign on the breadcrumb. Add a the page name that you want to translate in __English__ and add a dash at the end.
<h3> 3. translate the content</h3>
You will now see a new '+' sign. Add the file name 'index.md'.
In the text editor add the following front matter:
<pre>
---
section: guide
lang: Your language two letter code
title: The title in your language
---
</pre>
Translate as usual.
<h3> 4. Create a pull request</h3>
If all good, we will add it to the site.
Repeat for other parts of the guide if needed.
That's it, you are all done!
Thank you for helping us to make the guide accessiable to others!