Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
76c6d39
Added to avoid a Jekyll issue.
sustained Jul 3, 2019
994bbbf
Ignore vendor directory.
sustained Jul 3, 2019
2202064
Add nav link to examples.
sustained Jul 3, 2019
60e1e3e
Add lightbox component.
sustained Jul 4, 2019
d25a52a
Add slidenav component.
sustained Jul 4, 2019
b1998de
Add slider component.
sustained Jul 4, 2019
c0cd12c
Ignore bundle config.
sustained Jul 4, 2019
8e1c320
Add very-WIP examples page.
sustained Jul 4, 2019
6274a1d
Register example collection.
sustained Jul 5, 2019
7dfbbb0
Add example component.
sustained Jul 5, 2019
c1dfc86
Add notice component.
sustained Jul 5, 2019
9d5e428
Add example collection documentation.
sustained Jul 5, 2019
01807f3
Add distribution type example skeletons.
sustained Jul 5, 2019
bd8996f
Add feature type example skeletons.
sustained Jul 5, 2019
beddb16
Switch to the new collections + templates.
sustained Jul 5, 2019
36dfa6e
Add some temporary testing images.
sustained Jul 5, 2019
0275b2c
Remove headers.
sustained Jul 7, 2019
96840f4
Add embedded code + style adjustments.
sustained Jul 7, 2019
e87b529
Update distribution type links.
sustained Jul 7, 2019
814fd4c
Fix embed links.
sustained Jul 7, 2019
400b4db
Hide "show/hide code" when JS is disabled.
sustained Jul 7, 2019
8bbb3de
Allow to hide elements if JS is disabled.
sustained Jul 7, 2019
782202e
Update feature type links.
sustained Jul 7, 2019
1e11c48
Override the CSS that is making our button text non-blue.
sustained Jul 7, 2019
de3311b
Highlight the newfound existence of the examples.
sustained Jul 7, 2019
e2e0d60
Rename to .md; conditionally display buttons/embed; move title within.
sustained Jul 7, 2019
d3b8a0c
Update example include extension (html -> md); remove title.
sustained Jul 7, 2019
dab6e28
Add missing primary: true.
sustained Jul 7, 2019
f02b6ff
Chore: Add examples include to all feature/distribution type pages.
sustained Jul 7, 2019
c81e321
Use new examples include on main examples page also.
sustained Jul 7, 2019
3a63f6a
Add examples include.
sustained Jul 7, 2019
4b2e90b
Pretty sure I already did this alas.
sustained Jul 7, 2019
9c8054e
Fix another typo (in a CSS class name).
sustained Jul 7, 2019
a88ce63
Set rouge as the highlighter.
sustained Jul 8, 2019
845c7d2
Implement page-specific styles and scripts.
sustained Jul 8, 2019
93b86e0
Add code highlighting CSS.
sustained Jul 8, 2019
bda26df
Add examples for common formats.
sustained Jul 8, 2019
deb9e17
Add examples include on common formats pages.
sustained Jul 8, 2019
8299017
Add common formats examples to main examples page.
sustained Jul 8, 2019
6617d11
Change wording slightly to reflect addition of common formats examples.
sustained Jul 8, 2019
1e6e9a8
Instruct docs layout to include code highlighting CSS.
sustained Jul 8, 2019
7091599
More layout adjustments.
sustained Jul 8, 2019
36f99a3
Fix path to example images.
sustained Jul 8, 2019
87d6d36
Fix margins when there are more than 3 images.
sustained Jul 9, 2019
f6ae5bf
Add primary boulder example + images.
sustained Jul 9, 2019
6938140
Add primary cluster example + images.
sustained Jul 9, 2019
e48b3e8
Add primary decoration example + images.
sustained Jul 9, 2019
2b00ac9
Add primary geode example + images.
sustained Jul 9, 2019
7603c53
Add primary lake example + images.
sustained Jul 9, 2019
5552129
Add primary large-vein example + images.
sustained Jul 9, 2019
a8785f3
Add primary plate example + images.
sustained Jul 9, 2019
894864c
Add primary small-tree example + images.
sustained Jul 9, 2019
2042059
Add primary sparse-cluster example + images.
sustained Jul 9, 2019
f9cdde2
Add primary spike example + images.
sustained Jul 9, 2019
d33629c
Fix incorrect title.
sustained Jul 9, 2019
f9cd2cd
Add consecutive example + images.
sustained Jul 11, 2019
1b33a5e
Update titles.
sustained Jul 11, 2019
4cd0f89
Update more titles.
sustained Jul 11, 2019
e35ae6c
Add sequential example + images
sustained Jul 11, 2019
76289f6
Remove (now) unused banners.
sustained Jul 11, 2019
4af7a32
Add spout example + images.
sustained Jul 12, 2019
5ef0dab
Improve some of the descriptions.
sustained Jul 12, 2019
92b3ac8
Add stalactite example + images.
sustained Jul 12, 2019
f76dfaa
Update stalactite example image paths.
sustained Jul 12, 2019
f00eb36
Add stalagmite example + images.
sustained Jul 12, 2019
5acda45
Adjust margin.
sustained Jul 12, 2019
0387b6c
Add structure example + images.
sustained Jul 12, 2019
7a2829d
Add example structure NBT file.
sustained Jul 12, 2019
7b8423c
Display a notice if there are no images.
sustained Jul 12, 2019
f3d4c0e
Remove references to the now-removed images.
sustained Jul 12, 2019
9d09d43
Rename the group!
sustained Jul 12, 2019
344ab5d
Cleanup + fix docs links showing on docs pages.
sustained Jul 12, 2019
678854c
Highlight primary examples.
sustained Jul 12, 2019
7413e81
More changes relating to "primary" examples.
sustained Jul 12, 2019
a6c7a36
Improve titles.
sustained Jul 12, 2019
f98098b
Specify to show docs buttons on main examples page.
sustained Jul 12, 2019
85c4667
Show primary examples above and all others below on all docs pages.
sustained Jul 12, 2019
6d99f47
Add second spout example + images.
sustained Jul 12, 2019
ae36f27
From Jekyll 3 layout vars are stored on "layout", not "page".
sustained Jul 12, 2019
11567ef
Only load relevant scripts/styles for docs layout, not globally.
sustained Jul 12, 2019
d86fe9e
I sure did *absolutely* mess up those paths.
sustained Jul 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
_site/
vendor/
Thumbs.db
.jekyll-metadata
Gemfile.lock
.bundle/config
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@ defaults:
values:
layout: docs

collections:
- world_examples

exclude:
- README.md
- /*.pdn
- /*.xcf
- /Thumbs.db
- /.unused
- vendor

plugins:
- jekyll-paginate
- jekyll-sitemap
- jekyll-feed
- jekyll-redirect-from

highlighter: rouge

permalink: '/posts/:year/:month/:day/:title/'
paginate: 5
paginate_path: "/posts/page-:num/"
Expand Down
2 changes: 2 additions & 0 deletions _data/docnav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ cofh-world:
items:
- title: Commands
url: commands/
- title: Examples
url: examples/

thermal-foundation:
title: Thermal Foundation 2
Expand Down
60 changes: 60 additions & 0 deletions _includes/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{% if include.primary %}
{% assign classes="uk-panel uk-panel-box-primary uk-panel-box" %}
{% else %}
{% assign classes="uk-panel uk-panel-box" %}
{% endif %}

### {{ include.title }}

<div class="uk-grid">
<div class="uk-width-1">
<div class="{{ classes }}">
{{ include.content | markdownify }}

{% if include.link.code.embed %}
<script src="{{ include.link.code.embed }}"></script>
{% endif %}

{% if include.images.size == 0 %}
{% include notice.html notice="There are no images for this example!" %}
{% endif %}

<div class="uk-grid uk-margin-top">
{% for image in include.images %}
<div class="uk-width-medium-1-3 uk-margin-bottom">
<a
href="/assets/images/examples/{{ image.href }}"
data-uk-lightbox="{group: '{{ include.title | slugify }}'}"
title="{{ image.title }}">
<img class="uk-thumbnail" src="/assets/images/examples/{{ image.href }}">
</a>
</div>
{% endfor %}
</div>

<div class="uk-flex uk-flex-right">
{% if include.showDocs %}
<a
class="uk-button uk-button-primary uk-button-small uk-border-rounded uk-margin-left"
href="{{ include.link.docs }}">
View documentation
</a>
{% endif %}

<!-- <a
class="cofh-js-required uk-button uk-button-success uk-button-small uk-border-rounded uk-margin-right"
href="#">
Show/hide code
</a> -->

{% if include.link.code.download %}
<a
class="uk-button uk-button-success uk-button-small uk-border-rounded uk-margin-left"
href="{{ include.link.code.download }}">
Download code
</a>
{% endif %}
</div>
</div>
</div>
</div>
38 changes: 38 additions & 0 deletions _includes/examples.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@


{% if include.group %}

{% assign examples = site.world_examples
| where: "group", include.group
%}

{% else if include.type %}

{% assign examples = site.world_examples
| where: "type", include.type
%}

{% endif %}

{% assign examples = examples
| where: "primary", include.primary
%}

{% if examples.size == 0 %}

{% include notice.html notice="There are currently no examples!" %}

{% endif %}

{% for example in examples %}

{% include example.md
type=example.type
link=example.link
title=example.title
images=example.images
primary=example.primary
showDocs=include.showDocs
content=example.content %}

{% endfor %}
3 changes: 3 additions & 0 deletions _includes/notice.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="uk-alert uk-margin-bottom">
<p><i class="uk-icon-info-circle"></i> {{ include.notice }}</p>
</div>
11 changes: 10 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,26 @@
<link rel="stylesheet" href="/assets/css/uikit/components/progress.min.css" />
<link rel="stylesheet" href="/assets/css/uikit/components/sticky.min.css" />
<link rel="stylesheet" href="/assets/css/uikit/components/tooltip.min.css" />
<link rel="stylesheet" href="/assets/css/highlight/vs.css" />
<link rel="stylesheet" href="/assets/css/cofh.css{{cache_buster}}" />

{% for style in layout.styles %}
<link rel="stylesheet" href="{{ style }}" />
{% endfor %}

<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/uikit/uikit.min.js"></script>
<script src="/assets/js/uikit/components/autocomplete.min.js"></script>
<script src="/assets/js/uikit/components/sticky.min.js"></script>
<script src="/assets/js/uikit/components/tooltip.min.js"></script>
<script src="/assets/js/cofh.js{{cache_buster}}"></script>

{% for script in layout.scripts %}
<script src="{{ script }}"></script>
{% endfor %}
</head>

<body>
<body class="cofh-no-js">
{% if page.show_banner %}
<div class="cofh-banner uk-hidden-small">
<div class="uk-container uk-container-center">
Expand Down
7 changes: 7 additions & 0 deletions _layouts/docs.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
layout: default
styles:
- /assets/css/highlight/vs.css
- /assets/css/uikit/components/slidenav.min.css
- /assets/css/uikit/components/slider.min.css
scripts:
- /assets/js/uikit/components/lightbox.min.js
- /assets/js/uikit/components/slider.min.js
---

<div id="cofh-docs-content" class="uk-width-1-1 uk-width-medium-3-4 uk-container-center">
Expand Down
34 changes: 34 additions & 0 deletions _world_examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
link:
# An absolute internal link to the corresponding documentation page.
docs: /foo/bar/baz/
# An absolute (internal or external) link to the example JSON file.
file: https://gist.github/user/f83og0247gh078h0327hgs30972th087
# Can be either distribution or feature.
type: feature
# The group is important since we can't group things by directory/Jekyll doesn't
# support "sub-collections". The group allows us to use the groupBy Liquid filter
# on the examples collection. TL;DR: EVERY example for each INDIVIDUAL
# distribution and feature type all belong to the same group.
group: my-group
# Self-explanatory.
title: My lovely title.
# Can be either true or false. If true, this is regarded as the primary example
# which for now just means that it shows up on the big examples page. Otherwise
# it will show up on the actual documentation page for the feature/distribution type.
primary: true | false
# Self-explanatory. Note that for now the images must be in assetse/examples/ and
# external images are not supported.
images:
-
href: example1.png
title: I am the first example.
-
href: example2.png
title: I am the second title.
-
href: example3.png
title: I am the third title.
---

The description goes here. You can use arbitrary markdown, should you desire.
14 changes: 14 additions & 0 deletions _world_examples/common-formats/block-id/block-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: docs/cofh-world/world-generator-configuration/common-formats/block-id/
code:
embed:
download:
type: common-format
group: block-id
title: Block ID
primary: true
images: []
---

This is an example for the Block ID common format.
14 changes: 14 additions & 0 deletions _world_examples/common-formats/number-provider/number-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: docs/cofh-world/world-generator-configuration/common-formats/number-provider/
code:
embed:
download:
type: common-format
group: number-provider
title: Number Provider
primary: true
images: []
---

This is an example for the Number Provider common format.
17 changes: 17 additions & 0 deletions _world_examples/common-formats/weighted-string/weighted-string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
link:
docs: docs/cofh-world/world-generator-configuration/common-formats/weighted-string
type: common-format
group: weighted-string
title: Weighted String
primary: true
images: []
---

This is an example for the Weighted String common format.

```json
{
"enabled": true
}
```
14 changes: 14 additions & 0 deletions _world_examples/distribution-types/cave/cave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: /docs/cofh-world/world-generator-configuration/distribution-types/cave/
code:
embed: https://gist.github.com/sustained/fd95551c9e89d06c3d7678ad5240a98f.js
download: https://gist.github.com/sustained/fd95551c9e89d06c3d7678ad5240a98f/archive/f18a680038d5d89cbbe3bd048fd7cea095912af8.zip
type: distribution
group: cave
title: Cave
primary: true
images: []
---

This is an example of distributing in caves.
14 changes: 14 additions & 0 deletions _world_examples/distribution-types/custom/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: /docs/cofh-world/world-generator-configuration/distribution-types/custom/
code:
embed: https://gist.github.com/sustained/20c67f174a3bd1902f9f13d40cc93098.js
download: https://gist.github.com/sustained/20c67f174a3bd1902f9f13d40cc93098/archive/7bfbc131a87411c3ff81c91ccb9a5ef702526d0e.zip
type: distribution
group: custom
title: Custom
primary: true
images: []
---

This is an example of distributing in a custom manner.
13 changes: 13 additions & 0 deletions _world_examples/distribution-types/fractal/fractal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
link:
docs: /docs/cofh-world/world-generator-configuration/distribution-types/fractal/
code:
embed: https://gist.github.com/sustained/e8d231aca94d14a68892eddfb5d94d7e.js
download: https://gist.github.com/sustained/e8d231aca94d14a68892eddfb5d94d7e/archive/5be68cc6df9135e27edab94f802c5e062b53de99.zip
type: distribution
group: fractal
title: Fractal
images: []
---

This is an example of distributing fractally.
14 changes: 14 additions & 0 deletions _world_examples/distribution-types/gaussian/gaussian.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: /docs/cofh-world/world-generator-configuration/distribution-types/gaussian/
code:
embed: https://gist.github.com/sustained/51e74927ca127d40b6aa6648eeb44a4b.js
download: https://gist.github.com/sustained/51e74927ca127d40b6aa6648eeb44a4b/archive/d9ceaa413c6569590db1a0f8749a81f5f1405682.zip
type: distribution
group: gaussian
title: Gaussian
primary: true
images: []
---

This is an example of distributing via a gaussian method.
14 changes: 14 additions & 0 deletions _world_examples/distribution-types/sequential/sequential.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: /docs/cofh-world/world-generator-configuration/distribution-types/sequential/
code:
embed: https://gist.github.com/sustained/32b76d4c171e484b2e6343ed02e812c6.js
download: https://gist.github.com/sustained/32b76d4c171e484b2e6343ed02e812c6/archive/6997ab96fc5e176a7d68aa185d32eff09c2b3407.zip
type: distribution
group: sequential
title: Sequential
primary: true
images: []
---

This is an example of distributing sequentially.
14 changes: 14 additions & 0 deletions _world_examples/distribution-types/surface/surface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: /docs/cofh-world/world-generator-configuration/distribution-types/surface/
code:
embed: https://gist.github.com/sustained/3b00a7c9dc3743d59da6948006badc4d.js
download: https://gist.github.com/sustained/3b00a7c9dc3743d59da6948006badc4d/archive/fa185bd33ab859e498860c8323dc3c60ee8109b7.zip
type: distribution
group: surface
title: Surface
primary: true
images: []
---

This is an example of distributing on the surface.
14 changes: 14 additions & 0 deletions _world_examples/distribution-types/underfluid/underfluid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: /docs/cofh-world/world-generator-configuration/distribution-types/underfluid/
code:
embed: https://gist.github.com/sustained/ed670beea25c122c37c7e75cf73c8172.js
download: https://gist.github.com/sustained/ed670beea25c122c37c7e75cf73c8172/archive/2b59874cb68979e33c55a2c029a90edad5c0088f.zip
type: distribution
group: underfluid
title: Underfluid
primary: true
images: []
---

This is an example of distributing underfluid.
14 changes: 14 additions & 0 deletions _world_examples/distribution-types/underwater/underwater.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
link:
docs: /docs/cofh-world/world-generator-configuration/distribution-types/underwater/
code:
embed: https://gist.github.com/sustained/ffcb2b9ee40925d52c06ff2ec301de05.js
download: https://gist.github.com/sustained/ffcb2b9ee40925d52c06ff2ec301de05/archive/4bc6b18052b66452e41e9a5a830ee75e98ed000c.zip
type: distribution
group: underwater
title: Underwater
primary: true
images: []
---

This is an example of distributing underwater.
Loading