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

Commit 8034c11

Browse files
committed
Expose examples from old docs site
Instead of linking to the old docs site like we used to, expose the same examples here. These are still really out of date and need auditing (see #76), but this at least allows us to keep the content maintained here instead of linking to a site we are deprecating. Note: this does away with the old example viewer and the example JS apps! I think this is OK: the viewer was another thing to maintain and that nobody was working on; the example JS apps didn't do anything that was special to IPFS or to the distributed web, so they weren't especially relevant here. License: MIT Signed-off-by: Rob Brackett <[email protected]>
1 parent bef3dfa commit 8034c11

35 files changed

+53
-123
lines changed

content/guides/examples.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

content/guides/examples/_index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Basic Examples
3+
layout: examples
4+
menu:
5+
guides:
6+
parent: examples
7+
weight: 2
8+
---
9+
10+
These are a few examples that cover various ways to use IPFS.

content/guides/viewer/api/demoapp/readme.md renamed to content/guides/examples/api/demoapp/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
draft: true
3+
---
4+
15
## Ipfs Demo Application
26
Lets take a look at making an application that uses ipfs. Lets say that our
37
fictional application needs to read in a file, and count all the letters in

content/guides/viewer/api/randobj/readme.md renamed to content/guides/examples/api/randobj/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
draft: true
3+
---
4+
15
## Random Ipfs Objects
26
During the development, ive frequently found the need to just get a hash of some
37
random ipfs object. At first, I would just ask in irc "can someone give me a

content/guides/viewer/api/readme.md renamed to content/guides/examples/api/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
draft: true
3+
---
4+
15
## Basic API usage
26
using ipfs within your code is really quite simple!
37

content/guides/viewer/api/service/readme.md renamed to content/guides/examples/api/service/readme.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: Making Your Own IPFS Service
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
ipfs has a few default services that it runs by default, such as the dht,
@@ -13,6 +9,7 @@ handler on the ipfs PeerHost, and listens on it for new connections. The
139
try building an easy demo service to try this out!
1410

1511
Lets start by building the service host:
12+
1613
```
1714
package main
1815

content/guides/viewer/blocks.md renamed to content/guides/examples/blocks.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: Dealing with Blocks
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
The `ipfs add` command will create a Merkle DAG out of the data in the files you

content/guides/viewer/bootstrap.md renamed to content/guides/examples/bootstrap.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
2-
title: Bootstrap
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
2+
title: Modifying the bootstrap peers list
73
---
84

95
The IPFS bootstrap list is a list of peers with which the IPFS daemon learns about other peers on the network. IPFS comes with a default list of trusted peers, but you are free to modify the list to suit your needs. One popular use for a custom bootstrap list is to create a personal IPFS network.

content/guides/viewer/config.md renamed to content/guides/examples/config.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: Configuring Your Node
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
ipfs is configured through a json formatted text file, located by default at

content/guides/viewer/git.md renamed to content/guides/examples/git.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: Git, Even More Distributed
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
Have you ever said to yourself: "Man, my git server isn't distributed enough" or

content/guides/viewer/graphmd/index.md renamed to content/guides/examples/graphmd/index.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
---
22
title: Visualizing objects with graphmd
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

9-
![](/ipfs/QmbefthRKDReojALJi8nGPwvUVPqe1aXdoD9ysX44aUfvG/graph.png)
5+
![](output/graph.png)
106

117
When using ipfs for storing files, or writing more complex datastructures,
128
it is often very useful to visualize the merkledag being created. For this,
@@ -39,7 +35,7 @@ use it with dot:
3935

4036
## Example
4137

42-
Given this [demo](/ipfs/QmRCJXG7HSmprrYwDrK1GctXHgbV7EYpVcJPQPwevoQuqF) directory:
38+
Given this [demo](https://ipfs.io/ipfs/QmRCJXG7HSmprrYwDrK1GctXHgbV7EYpVcJPQPwevoQuqF) directory:
4339

4440
```sh
4541
> tree demo
@@ -107,20 +103,20 @@ graphmd QmRCJXG7HSmprrYwDrK1GctXHgbV7EYpVcJPQPwevoQuqF | dot -Tpdf >output/graph
107103
graphmd QmRCJXG7HSmprrYwDrK1GctXHgbV7EYpVcJPQPwevoQuqF | dot -Tpng >output/graph.png
108104
```
109105

110-
Et voilà: [svg](/ipfs/QmbefthRKDReojALJi8nGPwvUVPqe1aXdoD9ysX44aUfvG/graph.svg), [pdf](/ipfs/QmbefthRKDReojALJi8nGPwvUVPqe1aXdoD9ysX44aUfvG/graph.pdf), [png](/ipfs/QmbefthRKDReojALJi8nGPwvUVPqe1aXdoD9ysX44aUfvG/graph.png)
106+
Et voilà: [svg](output/graph.svg), [pdf](output/graph.pdf), [png](output/graph.png)
111107

112-
![](/ipfs/QmbefthRKDReojALJi8nGPwvUVPqe1aXdoD9ysX44aUfvG/graph.png)
108+
![](output/graph.png)
113109

114110
## File blocks
115111

116112
`graphmd` is particularly useful to inspect file blocking algorithms.
117113
For example, here is what the `ipfs` binary looks like with the default
118114
semi-balanced indirect block chunking:
119115

120-
- [dot output](/ipfs/QmQ8yWC1SGn73P1SPSw8iqSBGEscve1N6sQpzd1xzD5EV1/graph.dot)
121-
- [svg render](/ipfs/QmQ8yWC1SGn73P1SPSw8iqSBGEscve1N6sQpzd1xzD5EV1/graph.svg)
122-
- [pdf render](/ipfs/QmQ8yWC1SGn73P1SPSw8iqSBGEscve1N6sQpzd1xzD5EV1/graph.pdf)
116+
- [dot output](ipfsbin/graph.dot)
117+
- [svg render](ipfsbin/graph.svg)
118+
- [pdf render](ipfsbin/graph.pdf)
123119

124-
![](/ipfs/QmQ8yWC1SGn73P1SPSw8iqSBGEscve1N6sQpzd1xzD5EV1/graph.svg)
120+
![](ipfsbin/graph.svg)
125121

126122
by [Juan Benet](https://github.com/jbenet)

content/guides/viewer/ipns.md renamed to content/guides/examples/ipns.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: The Inter-Planetary Naming System
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
ipns is a way to add a small amount of mutability to the permanent immutability

content/guides/viewer/network.md renamed to content/guides/examples/network.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: Playing with the Network
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
IPFS is all about networking! Included are a useful set of commands

content/guides/viewer/pinning.md renamed to content/guides/examples/pinning.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
2-
title: Pinning
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
2+
title: Pinning Files
73
---
84

95
Pinning is a very important concept in ipfs. ipfs semantics try

content/guides/viewer/snapshots.md renamed to content/guides/examples/snapshots.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: Snapshots
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
Lets take a quick look at how ipfs can be used to take basic snapshots.

content/guides/viewer/videos.md renamed to content/guides/examples/videos.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: Playing Videos
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
ipfs can be used to store and play videos. Suppose we add a video:

content/guides/viewer/websites.md renamed to content/guides/examples/websites.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
22
title: IPFS for Websites
3-
draft: true
4-
menu:
5-
guides:
6-
parent: guides
73
---
84

95
### A short guide to hosting your site on ipfs

layouts/guides/examples.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{ define "main" }}
2+
<!--
3+
This is a custom list template for the examples section. We don’t want big
4+
summaries here, so we have a short, custom front-matter field named
5+
`description` instead.
6+
-->
7+
<h1>{{ .Title }} {{ if .IsDraft }} (Draft){{ end }}</h1>
8+
{{ .Content }}
9+
10+
<ul>
11+
{{ range .Paginator.Pages.ByWeight }}
12+
<li>
13+
<a href="{{ .URL }}">{{ .Title }}</a>
14+
{{ with .Params.Description }}
15+
<p class="example-description">{{ . }}</p>
16+
{{ end }}
17+
</li>
18+
{{ end }}
19+
</ul>
20+
{{ end }}

0 commit comments

Comments
 (0)