Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Commit d2a92bb

Browse files
author
Andrei
committed
Rearranging the example sections
1 parent e7144ba commit d2a92bb

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -452,17 +452,6 @@ The easiest way to separate these different app functionalities, is to separate
452452

453453
Another important step we need to do right now is to add the required dependencies. These are [rdflib.js](https://github.com/linkeddata/rdflib.js) and [Solid.js](https://github.com/solid/solid.js).
454454

455-
**Picking the vocabularies**
456-
457-
For this particular app, we can go with two very common vocabularies, `SIOC` and `Dublin Core Terms`. Using them is just a matter of defining the rdflib.js namespaces.
458-
459-
```Javascript
460-
// common RDF vocabs
461-
var RDF = $rdf.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
462-
var DCT = $rdf.Namespace("http://purl.org/dc/terms/");
463-
var SIOC = $rdf.Namespace("http://rdfs.org/sioc/ns#");
464-
```
465-
466455
**Local data structure**
467456

468457
Next, we can define how we want to structure our bins. For example, a bin could have a title and body (content), but also a URI (useful later for updates).
@@ -476,14 +465,45 @@ var bin = {
476465
};
477466
```
478467

479-
**Default container for new bins**
468+
**Picking the vocabularies**
469+
470+
For this particular app, we can go with two very common vocabularies, `SIOC` and `Dublin Core Terms`. Using them is just a matter of defining the rdflib.js namespaces.
471+
472+
```Javascript
473+
// common RDF vocabs
474+
var RDF = $rdf.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
475+
var DCT = $rdf.Namespace("http://purl.org/dc/terms/");
476+
var SIOC = $rdf.Namespace("http://rdfs.org/sioc/ns#");
477+
```
478+
479+
**Deciding where to store new bins**
480480

481481
To create bins we have to define a default container to which we POST the bin. For now we can create a global variable called `defaultContainer`. The value of this variable can be a `bins`container on your account, which you have created with Warp.
482482

483483
```Javascript
484484
var defaultContainer = 'https://user.databox.me/Public/bins/';
485485
```
486486

487+
**UI/HTML**
488+
489+
The UI is quite minimalistic. A couple of divs, one for the viewer and one for the editor. The current example lacks CSS definitions for some classes (e.g. `hidden`), which you can get from the Github repo (link below).
490+
491+
```html
492+
<div class="content center-text" id="view" class="hidden">
493+
<h1 id="view-title"></h1>
494+
<br>
495+
<div id="view-body"></div>
496+
</div>
497+
498+
<div class="content center-text" id="edit" class="hidden">
499+
<input type="text" id="edit-title" class="block" placeholder="Title...">
500+
<br>
501+
<textarea id="edit-body" class="block" placeholder="Paste text here..."></textarea>
502+
<br>
503+
<button id="submit" class="btn">Publish</button>
504+
</div>
505+
```
506+
487507
Now let's prepare a few functions that make the bread and butter of our app.
488508

489509
**Creating new bins**
@@ -681,26 +701,6 @@ function init() {
681701

682702
This function will be called at the bottom of our app, after all the other functions have been defined.
683703

684-
**UI/HTML**
685-
686-
The UI is quite minimalistic. A couple of divs, one for the viewer and one for the editor. The current example lacks CSS definitions for some classes (e.g. `hidden`), which you can get from the Github repo (link below).
687-
688-
```html
689-
<div class="content center-text" id="view" class="hidden">
690-
<h1 id="view-title"></h1>
691-
<br>
692-
<div id="view-body"></div>
693-
</div>
694-
695-
<div class="content center-text" id="edit" class="hidden">
696-
<input type="text" id="edit-title" class="block" placeholder="Title...">
697-
<br>
698-
<textarea id="edit-body" class="block" placeholder="Paste text here..."></textarea>
699-
<br>
700-
<button id="submit" class="btn">Publish</button>
701-
</div>
702-
```
703-
704704
This is it, you're all set! You can use the following link for the source files of the full example app - [https://github.com/solid/solid-tutorial-pastebin/](https://github.com/solid/solid-tutorial-pastebin/)
705705

706706
See also ["user posts a note" example](https://github.com/solid/solid-spec#example).

0 commit comments

Comments
 (0)