Skip to content

Commit 8fb5f3b

Browse files
authored
Create README.md
1 parent 7c3850b commit 8fb5f3b

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Open SDG Config Form
2+
3+
This repository holds the code for the configuration forms used in Open SDG. It also hosts the built JavaScript files which are used by Open SDG.
4+
5+
These forms use the excellent [JSONForms](https://jsonforms.io/) open-source library.
6+
7+
## Dependencies
8+
9+
* Node.js
10+
11+
## Development
12+
13+
To build the project:
14+
15+
```
16+
npm install
17+
npm run build
18+
```
19+
20+
## Usage
21+
22+
Include the built JavaScript files on your page. Open SDG uses the Github-hosted files like so:
23+
24+
```
25+
<script src="https://open-sdg.org/open-sdg-config-form/bundle.js"></script>
26+
```
27+
28+
This code expects a certain JavaScript object to exist. Here is a rundown of what it is expecting:
29+
30+
```
31+
var opensdg = opensdg || {};
32+
opensdg.configForm = {
33+
schema: null, // The JSONSchema for the form
34+
uiSchema: null, // The UI Schema according to JSONForms
35+
initialData: null, // Existing data to populate the form
36+
configFilename: null, // The name of file that will be generated by the form
37+
configFolder: null, // The path to the folder in a target repository that the file will be uploaded to
38+
githubClientId: null, // ClientID if using a direct connection to Github
39+
githubProxyUrl: null, // Proxy URL if using a direct connection to Github
40+
githubRepo: null, // The name of the Github repo that the file will be uploaded to
41+
githubOwner: null, // The owner (organization) of the Github repo that the file will be uploaded to
42+
repositoryLink: null, // The full link to the repository that the file will be uploaded to
43+
};
44+
```

0 commit comments

Comments
 (0)