Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cofh World - Add Examples #86

Open
wants to merge 81 commits into
base: master
Choose a base branch
from

Conversation

sustained
Copy link

@sustained sustained commented Jul 12, 2019

Overview

Main Examples Page

The way I have things set up there is a concept of "primary" examples. Every single feature type, distribution type and common format has ONE primary example.

Then there is a master "examples" page which lists all of these primary examples.

The intention is that this page provides a great overview of the mod, complete with example JSON files, images and all. Furthermore, the intent is that these primary examples will be kept nice and simple, so as to not overwhelm people early on.

The link to this new examples page is displayed in the footer.

image

The existence of this new examples page is also alluded to on the main CoFH World page.

image

Docs Pages

On the actual docs pages for feature types, distribution types and common formats the primary example is always the first one displayed (and is highlighted in blue).

Any further examples will be displayed below.

How it works

Examples are defined by markdown files, primarily via YAML front matter.

An example of a minimal example definition file.
---
link:
  docs: /docs/cofh-world/world-generator-configuration/feature-types/boulder/
type: feature
group: boulder
title: "My Boulder Example"
primary: false
images: []
---

This is my boulder example.

\`\`\`json
{
  "some": "json"
}
\`\`\`

The example files are organised into directories but this is not necessary, it is the type and the group that matters.

Unfortunately Jekyll/Liquid doesn't support any concept of "sub-collections" so I had to use the front matter instead.

Instead of inlining the code like in the above example, it's also possible to use Github Gist. Simply additionally define link.code.embed and link.code.download.

Progress

Primary Examples

  • Boulder
  • Cluster
  • Consecutive
  • Decoration
  • Geode
  • Lake
  • Large Vein
  • Plate
  • Sequential
  • Small Tree
  • Sparse Cluster
  • Spike
  • Spout
  • Stalactite
  • Stalagmite
  • Structure
  • Cave
  • Custom
  • Gaussian
  • Sequential
  • Surface
  • Underfluid
  • Underwater
  • Uniform
  • Block ID
  • Number Provider
  • Weighted String

Screenshots

How an individual example looks.

image

One of the docs pages showing how it looks when there are multiple examples.

image

The examples page as it currently stands.

image

sustained added 30 commits July 3, 2019 23:31
TODO: Only include JS on pages that need it?
Required by lightbox.
Perhaps there is a better way to handle this but as it stands I don't really understand why that CSS is there/why it is targetting things in the way that it is.
@sustained
Copy link
Author

sustained commented Jul 12, 2019

Note that this isn't what I would call complete, I am just sending in the PR as it is approaching completion. I'll keep working on it in the coming days.

Please let me know if there's anything wrong or that needs to change and I'll get it done.

I'm brand new to Jekyll/Liquid and it's possible I've done something stupid. It's also fairly likely that my code is ugly or dumb.

As I said, just let me know; I'll fix it.

@sustained
Copy link
Author

I plan to try to get this finished soon but I'd appreciate a bit of input from the web guy on the work so far because if there are major issues with anything I've done here then I need to know about them so that I can make the necessary changes.

@Tonius

@Tonius
Copy link
Member

Tonius commented Aug 11, 2019

I tooked around and I quite like how it looks so far. Nice job! When merging I will probably do some finishing touches myself, but nothing really big.

I did notice most of the pages that have examples also have the 'no examples' message at the bottom.

@sustained
Copy link
Author

Excellent, I'll try to get this finished soon then.

Huh okay... odd, I'll have to look into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants