Перейти к содержимому
Mineforgian

Guidebook.md

Add Markdown guides to BTA, allowing modders to efficiently create and format guides. Markdown books were added to BTA, allowing users to create, edit, and organize complete, structured Markdown-compatible documents.

Загрузки
114
Подписчики
0
Обновлён
1 августа 2025 г.
Лицензия
CC0-1.0

Опубликован 1 августа 2025 г.

Guidebook.md

Helps BTA modders create mod guides quickly and easily using Markdown with extra features

How to Use?
Create a MDBookScreen inherited class. Load config from asset path, include .md files.
Use as a normal screen, opened from a trigger.

Formats

Use < & > chars for color codes:

- 0 = &0Black
- 1 = &1Dark Blue
- 2 = &2Dark Green
- 3 = &3Dark Aqua
- 4 = &4Dark Red
- 5 = &5Dark Purple
- 6 = &6Gold
- 7 = &7Gray
- 8 = &8Dark Gray
- 9 = &9Blue
- a = &aGreen
- b = &bAqua
- c = &cRed
- d = &dLight Purple
- e = &eYellow
- f = &fWhite
- s = &sShadow
- r = Reset

Syntax

Regular &3Markdown syntax adapted for &6BTA Guidebook format:
# H1
## H2
### H3
#### H4
##### H5
###### H6
* Unordered List
- Unordered List
1. Ordered List

Specials

**Images**
- [text](/assets/modid/textures/path/to/img.png)(width,height,type)
- ![slot](modid:item/name)
- ![workbench](empty,empty,empty,empty,empty,empty,empty,empty,empty, empty)
  • Width & Height in pixels
  • type = default | icon or (no text) to use default option
  • The workbench last slot it's for output item

How to use?

Markdown guidebook

public class MyBook extends MarkdownGuidebook<MDPage> {

    public IntroBook() {
        String path = "/assets/modid/markdown/mybook/";
        config = BookConfig.fromJsonResource(getClass(), path + "config.json");

        DecimalFormat formatter = new DecimalFormat("000");
        for (int i = 0; i<11; i++) {
            String fileName = "page_" + formatter.format(i + 1) + ".md";

            loadMarkdownPages(path + fileName);
        }
    }
}

Display markdown

Check superclass for more info.

public class MyMDScreen extends MDScreen {
    public MyMDScreen() {
        currentPage = MarkdownCompiler.compile("/assets/modid/markdown/path/to/your/file.md", getClass());
    }
}

In-Game Markdown Editor

Use the editable book in-game and export the Markdown content to use in your project! Or use it to share information with your friends in your world!

imageimage

Commands

Export or load markdown books.

  • Use: /guidebook export </p> <ul> <li>to export to: btafolder/guidebook/exported/<title></li> </ul> </li> <li><p>Use: /guidebook load <title></p> <ul> <li>Load from: btafolder/guidebook/load/<title></li> </ul> </li> </ul> <h3>Showcase</h3> <p>Download the zip with the files in the release page <img width="1464" height="879" alt="image" src="https://github.com/user-attachments/assets/d87392c0-9c10-44e0-878c-a8926bffca7f" /></p> <p><a href="https://github.com/user-attachments/assets/d2f9fe57-74f7-433e-8f00-0848fc137571">https://github.com/user-attachments/assets/d2f9fe57-74f7-433e-8f00-0848fc137571</a></p>

Ченджлог

1.1.0Релизb1.7.3 · 1 августа 2025 г.

Full Changelog: https://github.com/Garkatron/BTA-Guidebook.md/compare/1.0.0...1.1.0

New Features

Editable Book

  • Craft an editable book using one charged paintbrush and one book.
  • Write and edit content, set a title, and clone or export the book (consumes one book from your inventory).
    • Clone: Drops an editable copy of the book.
    • Export: Drops a read-only version of the book.
    • Added toolbars for locking/unlocking, deleting, moving a page left or right, and in the book, adding a page, cloning, and exporting.
  • The text area supports common shortcuts for easier Markdown editing (more and improved shortcuts planned for future updates).
image imageimageimage

Export and Load Commands

  • Export Markdown files to btafolder/guidebookmd/exported using the command:
    /guidebook export <title>
    
  • Load Markdown files from btafolder/guidebookmd/load using the command:
    /guidebook load <title>
    
  • The <title> corresponds to the folder name within the respective directories.

Other Changes

  • Added page numbers to books for improved navigation.
  • More stuff, I don't remember which ones

Bug Fixes

Fixes, I don't remember which ones

Комментарии

Загружаем…