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

Commit e6533c2

Browse files
authored
Merge pull request #68 from ipfs/reorganize-for-minimal-docs-site
Gather and link existing docs and resources
2 parents 802b90f + ada8aa9 commit e6533c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+15574
-549
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[*]
2+
insert_final_newline = true
3+
indent_size = 2
4+
indent_style = space
5+
trim_trailing_whitespace = true
6+
7+
[*.{md,yaml,yml,toml}]
8+
indent_size = 4
9+
10+
[Makefile]
11+
indent_style = tab

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
.vscode
2+
13
node_modules/
24
public/
35
tmp/
46
themes/material/original/
7+
8+
# Generated source files
59
content/reference/pkg/*/
10+
src/styles/constants.less
11+
static-build

Makefile

+34-8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ NPM=npm
77
NPMBIN=./node_modules/.bin
88
OUTPUTDIR=public
99
PKGDIR=content/reference/pkg
10+
PORT=1313
1011

1112
ifeq ($(DEBUG), true)
1213
PREPEND=
@@ -16,23 +17,47 @@ else
1617
APPEND=1>/dev/null
1718
endif
1819

20+
node_modules:
21+
$(PREPEND)$(NPM) install $(APPEND)
22+
23+
ipfs-theme:
24+
$(PREPEND)[ -d static-build/assets/fonts ] || mkdir -p static-build/assets/fonts
25+
$(PREPEND)cp ./node_modules/ipfs-css/fonts/Montserrat* ./static-build/assets/fonts/ $(APPEND)
26+
$(PREPEND)cp ./node_modules/ipfs-css/fonts/Inter-UI* ./static-build/assets/fonts/ $(APPEND)
27+
$(PREPEND)node scripts/ipfs-css-constants.js $(APPEND)
28+
1929
packages:
20-
$(PREPEND)scripts/pkg2md.sh github.com/ipfs/js-ipfs-api master $(PKGDIR) pkg
21-
$(PREPEND)scripts/pkg2md.sh github.com/ipfs/js-ipfs master $(PKGDIR) pkg
22-
$(PREPEND)scripts/pkg2md.sh github.com/ipfs/go-ipfs-api master $(PKGDIR) pkg
23-
$(PREPEND)scripts/pkg2md.sh github.com/ipfs/go-ipfs/core/coreapi master $(PKGDIR) pkg
30+
# The JS packages don't actually generate useful docs right now, so skip them
31+
# $(PREPEND)scripts/pkg2md.sh github.com/ipfs/js-ipfs-api master $(PKGDIR) pkg
32+
# $(PREPEND)scripts/pkg2md.sh github.com/ipfs/js-ipfs master $(PKGDIR) pkg
33+
$(PREPEND)scripts/pkg2md.sh github.com/ipfs/go-ipfs-api v1.2.1 $(PKGDIR) go/pkg
34+
$(PREPEND)scripts/pkg2md.sh github.com/ipfs/go-ipfs/core/coreapi v0.4.15 $(PKGDIR) go/pkg
35+
$(PREPEND)scripts/pkg2md.sh github.com/ipfs/go-ipfs/core/coreapi/interface v0.4.15 $(PKGDIR) go/pkg
36+
$(PREPEND)scripts/pkg2md.sh github.com/ipfs/go-ipfs/core/coreapi/interface/options v0.4.15 $(PKGDIR) go/pkg
37+
38+
resources: ipfs-theme packages
39+
40+
install: node_modules resources
2441

25-
build: clean packages
42+
css:
43+
# Dual calls to less because there seems to be a bug with multiple plugins in v3 :(
44+
# https://github.com/less/less.js/issues/3187
45+
$(PREPEND)$(NPMBIN)/lessc -clean-css --autoprefix src/styles/main.less static-build/assets/main.css $(APPEND)
46+
47+
build: clean install css
2648
$(PREPEND)hugo && \
2749
echo "" && \
2850
echo "Site built out to ./$(OUTPUTDIR)"
2951

52+
dev: css
53+
$(PREPEND)( \
54+
$(NPMBIN)/nodemon --watch src/styles --ext less,css --exec "$(NPMBIN)/lessc -clean-css --autoprefix src/styles/main.less static-build/assets/main.css" & \
55+
hugo server -w --port $(PORT) \
56+
)
57+
3058
serve:
3159
$(PREPEND)hugo server
3260

33-
node_modules:
34-
$(PREPEND)$(NPM) i $(APPEND)
35-
3661
deploy:
3762
export hash=`ipfs add -r -Q $(OUTPUTDIR)`; \
3863
echo ""; \
@@ -47,5 +72,6 @@ deploy:
4772
clean:
4873
$(PREPEND)[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
4974
$(PREPEND)[ ! -d $(PKGDIR) ] || rm -rf $(PKGDIR)/*/
75+
$(PREPEND)[ ! -d static-build/assets ] || rm -rf static-build/assets/*
5076

5177
.PHONY: packages build help deploy publish-to-domain clean

README.md

+35-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
11
# IPFS Docs
22

3-
> Documentation website for the IPFS project
3+
This repo is used to:
44

5-
For now: ipns://beta.docs.ipfs.io and https://beta.docs.ipfs.io
5+
1. Organize documentation work across the IPFS project
6+
2. Host a documentation website for IPFS meant to replace what is currently at https://ipfs.io/docs
67

7-
Read the Captain's Log for updates: [ipfs/docs#47](https://github.com/ipfs/docs/issues/47)
8-
9-
- Overview
10-
- Contributing content
11-
- Developing the site
12-
- Automatic builds
13-
- FAQ
14-
- Why is it critical this is a static site?
15-
- License
8+
Read the Captain's Log or check the [issues](https://github.com/ipfs/docs/issues) for updates: [ipfs/docs#47](https://github.com/ipfs/docs/issues/47)
169

1710

1811
## Overview
1912

20-
TODO
13+
IPFS documentation currently has several acute problems:
14+
15+
- There is **no clear introduction to the overall idea of exactly how IPFS works and what it’s doing.**
16+
- IPFS has **lots of new concepts** (whether you are knowledgeable about things like graphs or not) that are just very different from the web technologies people know today.
17+
- **Docs are inconsistently located** and spread across a number of repos people have to hunt through.
18+
- Clear, **standard API docs** are not always available.
19+
- **Hunting through GitHub is hard.** (Which repos have docs? Where in the repo are they? Which projects are important and how do they relate to the others? Which repos and docs are up-to-date?)
20+
21+
We aim to solve some of these problems through a documentation site (the source of which is in this repo) and others through organizing work, conventions, and practices across project repos (managed in the issues here).
2122

2223

2324
## Contributing content
2425

25-
TODO
26+
The documentation site contains several different kinds of content:
27+
28+
1. **Introductory overviews.** This lives in `content/introduction`. If you spot a problem or have improvements, please post an issue or PR. Please also take a look at [#60](https://github.com/ipfs/docs/issues/60) for planning and ongoing work in this area.
29+
30+
2. **Guides, examples, and tutorials.** Most examples currently live in other repos, like [js-ipfs examples](https://github.com/ipfs/js-ipfs/tree/master/examples). If you have thoughts on how to better integrate them, please file an issue here. If you have feedback on individual examples or want to add a new one, please file an issue or PR on the relevant repo. If you have ideas for guides or tutorials, they belong here! Please propose them in an issue here before creating a PR.
31+
32+
3. **Reference Documentation.** Please see the issues in this repo for current activity around reference/API documentation.
33+
34+
4. **Community.** If there are important missing community links, file an issue or PR here!
35+
36+
Before posting a PR with documentation changes, please also check [out styleguide](https://github.com/ipfs/community/blob/master/docs-styleguide.md).
2637

2738

2839
## Developing the site
@@ -35,28 +46,32 @@ TODO
3546
```sh
3647
npm install -g aegir
3748
```
38-
49+
3950
3. Download IPFS libraries and tools (e.g. go-ipfs, js-ipfs) and generate their documentation:
4051

4152
```sh
42-
make packages
53+
make install
4354
```
44-
45-
(Repeat this step anytime a package with autogenerated documentation has a new release.)
55+
56+
This installs dependencies and generates source files from other projects (e.g. API documentation; theme resources from the `ipfs-css`, etc).
57+
58+
When dependencies or external packages (like `go-ipfs`) have new releases, regenerate files based on them by running `make resources`.
4659

4760

4861
### Build and Run the Site
4962

50-
* In the root directory, run `make serve`
63+
* In the root directory, run `make dev`
5164
* Load http://localhost:1313 in your web browser
5265
* Edit and add things!
5366

67+
To create a production build, run `make build` instead. You’ll find the final static site in the `public` directory.
68+
5469

5570
## FAQ
5671

57-
### Why is it critical this is a static site?
72+
### Why is this is a static site?
5873

59-
TODO
74+
We believe in hosting IPFS’s documentation on IPFS, and that’s much easier when the content is static.
6075

6176

6277
## License

0 commit comments

Comments
 (0)