2024-10-23 02:41:04 +03:00
|
|
|
# Luanti Modding Book
|
2014-12-11 22:38:46 +03:00
|
|
|
|
2020-04-27 03:07:31 +03:00
|
|
|
[![Build status](https://gitlab.com/rubenwardy/minetest_modding_book/badges/master/pipeline.svg)](https://gitlab.com/rubenwardy/minetest_modding_book/pipelines)<br>
|
2018-07-16 01:37:14 +03:00
|
|
|
[Read Online](https://rubenwardy.com/minetest_modding_book/)
|
2014-12-11 22:38:46 +03:00
|
|
|
|
2021-01-25 11:57:13 +03:00
|
|
|
Book written by rubenwardy.
|
2014-12-12 23:04:24 +03:00
|
|
|
License: CC-BY-SA 3.0
|
2014-12-11 22:38:46 +03:00
|
|
|
|
2015-02-16 20:29:05 +03:00
|
|
|
## Finding your way around
|
2014-12-12 11:49:10 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
* `_data/` - Contains list of languages
|
|
|
|
* `_layouts/` - Layouts to wrap around each page.
|
2017-08-26 18:40:30 +03:00
|
|
|
* `static/` - CSS, images, scripts.
|
2018-07-16 01:37:14 +03:00
|
|
|
* `_<lang>/`
|
|
|
|
* `<section>/` - Markdown files for each chapter.
|
2017-08-26 18:40:30 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
## Contributing chapters
|
2017-08-26 18:40:30 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
* Create a pull request with a new chapter in markdown.
|
|
|
|
* Write a new chapter in the text editor of your choice and
|
|
|
|
[send them to me](https://rubenwardy.com/contact/).
|
2014-12-12 11:49:10 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
I'm happy to fix the formatting of any chapters. It is
|
|
|
|
the writing which is the hard bit, not the formatting.
|
2014-12-11 11:56:37 +03:00
|
|
|
|
2021-01-25 11:57:13 +03:00
|
|
|
### Chapter and Writing Guide
|
2014-12-11 22:38:46 +03:00
|
|
|
|
2021-01-25 11:57:13 +03:00
|
|
|
Grammar and such:
|
|
|
|
|
|
|
|
* British English, except when referring common code words like `color` and
|
|
|
|
`initialize`.
|
2018-07-16 01:37:14 +03:00
|
|
|
* Prefer pronounless text, but `you` if you must. Never `we` nor `I`.
|
2021-01-25 11:57:13 +03:00
|
|
|
* Titles and subheadings should be in Title Case.
|
|
|
|
* References to code (such as function names) should be formatted as \`inline-code`.
|
|
|
|
* Italics used for emphasis, not necessarily for technical words.
|
|
|
|
* Full stops and correct punctionation, except for lists without full sentences.
|
|
|
|
|
|
|
|
Formatting:
|
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
* Do not rely on anything that isn't printable to a physical book.
|
|
|
|
* Any links must be invisible - ie: if they're removed, then the chapter must
|
|
|
|
still make sense.
|
|
|
|
* Table of contents for each chapter with anchor links.
|
|
|
|
* Add `your turn`s to the end of a chapter when relevant.
|
2014-12-12 11:49:10 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
### Making a Chapter
|
2015-02-16 20:29:05 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
To create a new chapter, make a new file in _en/section/.
|
|
|
|
Name it something that explains what the chapter is about.
|
|
|
|
Replace spaces with underscores ( _ )
|
2015-02-16 20:29:05 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
```markdown
|
|
|
|
---
|
|
|
|
title: Chapter Name
|
|
|
|
layout: default
|
|
|
|
root: ..
|
|
|
|
idx: 4.5
|
2018-07-20 21:50:19 +03:00
|
|
|
long_notice:
|
|
|
|
level: tip
|
|
|
|
title: This is a long tip!
|
|
|
|
message: This is a very long tip, so it would be unreadable if
|
|
|
|
placed in the main body of the chapter. Therefore,
|
|
|
|
it is a good idea to put it in the frontmatter instead.
|
2018-07-16 01:37:14 +03:00
|
|
|
---
|
2015-02-16 20:29:05 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
## Chapter Name
|
2015-02-16 20:29:05 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
Write a paragraph or so explaining what will be covered in this chapter.
|
|
|
|
Explain why/how these concepts are useful in modding
|
2014-12-12 11:49:10 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
* [List the](#list-the)
|
|
|
|
* [Parts in](#parts-in)
|
|
|
|
* [This Chapter](#this-chapter)
|
2014-12-12 11:49:10 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
## List the
|
2015-02-16 20:29:05 +03:00
|
|
|
|
2018-07-20 21:50:19 +03:00
|
|
|
{% include notice.html notice=page.long_notice %}
|
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
Paragraphs
|
2015-02-16 20:29:05 +03:00
|
|
|
|
2020-04-19 23:47:11 +03:00
|
|
|
\```lua
|
2018-07-16 01:37:14 +03:00
|
|
|
code
|
2020-04-19 23:47:11 +03:00
|
|
|
\```
|
2015-02-16 20:29:05 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
## Parts in
|
2015-02-16 20:29:05 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
## This Chapter
|
|
|
|
```
|
2015-02-16 20:29:05 +03:00
|
|
|
|
|
|
|
## Commits
|
2014-12-11 22:38:46 +03:00
|
|
|
|
|
|
|
If you are editing or creating a particular chapter, then use commit messages like this:
|
|
|
|
|
|
|
|
```
|
|
|
|
Getting Started - corrected typos
|
|
|
|
Entities - created chapter
|
|
|
|
```
|
|
|
|
|
|
|
|
Just use a normal style commit message otherwise.
|
2014-12-12 11:58:48 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
## Adding a new language
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
1. Copy `_en/` to your language code
|
|
|
|
2. Add entry to `_data/languages.yml`
|
|
|
|
3. Add entry to `collections` in `_config.yml`
|
|
|
|
4. Add your language to the if else in `layouts/default.html`
|
|
|
|
5. Translate your language code folder (that you made in step 1)
|
|
|
|
You can translate the file paths, just make sure you keep any ids the same.
|
2017-08-26 21:01:51 +03:00
|
|
|
|
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
## Using Jeykll
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
I use [Jekyll](http://jekyllrb.com/) 3.8.0
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
# For Debian/Ubuntu based:
|
|
|
|
sudo apt install ruby-dev
|
|
|
|
gem install jekyll github-pages
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
### Building as a website
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
You can build it as a website using [Jekyll](http://jekyllrb.com/)
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
$ jekyll build
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
Goes to _site/
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
### Webserver for Development
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
You can start a webserver on localhost which will automatically
|
|
|
|
rebuild pages when you modify their markdown source.
|
2017-08-26 21:01:51 +03:00
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
$ jekyll serve
|
2017-08-26 21:01:51 +03:00
|
|
|
|
|
|
|
|
2018-07-16 01:37:14 +03:00
|
|
|
This serves at <http://localhost:4000> on my computer, but the port
|
|
|
|
may be different. Check the console for the "server address"
|