Skip to content

Commit

Permalink
Module Readme Jam (#873)
Browse files Browse the repository at this point in the history
* Kyrkis README text

Co-Authored-By: kyrkis <44133389+kyrkis@users.noreply.github.com>

* Apple Trees Readme

* Rope Ladders Readme

Co-Authored-By: MichaelMiner <64754592+MichaelMiner137@users.noreply.github.com>

* Create phantom_scarecrows.webp

Co-Authored-By: Denniss <47228146+Dennis-0@users.noreply.github.com>

* Images in Readmes and Alt Text

* Live Catch and Rope Ladders pack icons

Co-Authored-By: BluePsychoRanger <mcbluepsychoranger@gmail.com>

* Live Catch and Rope Ladders pack icon svgs

Co-Authored-By: BluePsychoRanger <mcbluepsychoranger@gmail.com>

* Credit BPR for icon design

* Remove Readme Boilerplate

Moves insertion of links, credits and gm4 about-us fully into the generator, not requiring any replacement tags in the source readmes

* Readme Boilerplate cleanup 2

* Publish some packs to Modrinth and Smithed

* Bugfixes to BBCode conversion

* add ink spitting squid readme

---------

Co-authored-by: kyrkis <44133389+kyrkis@users.noreply.github.com>
Co-authored-by: Misode <misoloo64@gmail.com>
Co-authored-by: MichaelMiner <64754592+MichaelMiner137@users.noreply.github.com>
Co-authored-by: Denniss <47228146+Dennis-0@users.noreply.github.com>
Co-authored-by: BluePsychoRanger <mcbluepsychoranger@gmail.com>
Co-authored-by: Thanathor <thethanathor@gmail.com>
  • Loading branch information
7 people authored Jun 6, 2023
1 parent 22fddc3 commit 8c51e57
Show file tree
Hide file tree
Showing 34 changed files with 334 additions and 134 deletions.
79 changes: 41 additions & 38 deletions gm4/plugins/readme_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,59 +20,62 @@ def beet_default(ctx: Context):
running_readme_gen = ctx.meta.get("readme-gen", False) # used to disable pmc replacements on normal release
global_replacements: dict[str, str] = {}

# Local Images to raw.githubusercontent URLs
global_replacements.update({
r"([!<].*?[\"(])(.*?)([\")].*) *<!-- *\$localAssetToURL[ -]+?>":
f"\\1https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/{ctx.project_id}/\\2\\3"
})
# Append standard footer content
footer = "\n### More Info\n"
# Youtube Info
if (vid_url:=ctx.meta['gm4']['video']) is not None:
footer += (
f"[<img src=\"https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/base/images/youtube_logo.png\" "
f"alt=\"Youtube Logo\" width=\"40\" align=\"center\"/> "
f"**Watch on Youtube**]({vid_url})"
"\n\n"
)

# Wiki Info
footer += (
f"[<img src=\"https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/base/images/gm4_wiki_logo.png\" "
f"alt=\"Gamemode 4 Wiki Logo\" width=\"40\" align=\"center\"/> "
f"**Read the Wiki**]({ctx.meta['gm4']['wiki']})"
"\n\n"
)

# Credits
footer += "### Credits\n"

# Credits
ctx.require(write_credits) # requires data from traversing credits files
linked_credits = ctx.meta['linked_credits']
credits_text = ""
for title in linked_credits:
credits_text += f"- {title}: {', '.join(linked_credits[title])}\n"
global_replacements.update({r'<!-- *\$creditsInsert.+>' : credits_text})

# Youtube Info
global_replacements.update({
r'<!-- *\$youtubeLinkInsert.+>' : (
f"[<img src=\"https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/base/images/youtube_logo.png\" "
f"alt=\"Youtube Logo\" width=\"40\" align=\"center\"/> "
f"**Watch on Youtube**]({ctx.meta['gm4']['video']})"
)
})

# Wiki Info
footer += credits_text

# Info Blurb
footer += (
"\n---\n"
"## About Gamemode 4 <img src=\"https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/base/images/gm4_logo.png\""
" alt=\"Gamemode 4 Logo\" width=\"20\"/>\n"
"Gamemode 4 is a series of command-powered creations that are designed to change and enhance the survival experience. "
"All of our modules are designed to work together flawlessly, and are balanced for usage in a survival setting. "
"Pick and choose your favorites from our [website](https://gm4.co), or wherever you get datapacks."
)

global_contents += footer

# Local Images to raw.githubusercontent URLs
global_replacements.update({
r'<!-- *\$wikiLinkInsert.+>' : (
f"[<img src=\"https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/base/images/gm4_wiki_logo.png\" "
f"alt=\"Gamemode 4 Wiki Logo\" width=\"40\" align=\"center\"/> "
f"**Read the Wiki**]({ctx.meta['gm4']['wiki']})"
)
r"([!<].*?[\"(])(.*?)([\")].*) *<!-- *\$localAssetToURL[ -]+?>":
f"\\1https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/{ctx.project_id}/\\2\\3"
})

# Header Title
global_replacements.update({
r'#? *(.+?) *<!-- *\$headerTitle.+>' : (
r'#? *(.+?) *<!-- *\$headerTitle.+?>' : (
"# <img src=\"https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/base/images/gm4_logo.png\""
" alt=\"GM4 Logo\" width=\"32\" />"
r" \1 by Gamemode 4"
)
})

# Footer
global_replacements.update({
r'<!-- *\$footerInsert.+>' : (
"---\n"
"## About Gamemode 4 <img src=\"https://raw.githubusercontent.com/Gamemode4Dev/GM4_Datapacks/master/base/images/gm4_logo.png\""
" alt=\"Gamemode 4 Logo\" width=\"20\"/>\n"
"Gamemode 4 is a series of command-powered creations that are designed to change and enhance the survival experience. "
"All of our modules are designed to work together flawlessly, and are balanced for usage in a survival setting. "
"Pick and choose your favorites from our [website](https://gm4.co), or wherever you get datapacks."
)
})

# Recommended modules dynamic linking; to gm4.co, serves as fallback link if modrinth post does not exist
rec_modules = re.findall(r"\[(.+)\]\(\$dynamicLink:(\w+)\)", global_contents)
for m in [m for _, m in rec_modules]:
Expand Down Expand Up @@ -161,11 +164,11 @@ def beet_default(ctx: Context):
r"(.+)<!-- *\$pmc:headerSize.+>": r"[size=14px]\1[/size]",
r"#{2,3} (.+)": r"[style b size=14px]\1[/style]",
r"!\[(?!size|style|img|url)(.+)\]\((.+)\)": r"[img=\1]\2[/img]",
r"\[(?!size|style|img|url)(.+)\]\((.+)\)": r"[url=\2]\1[/url]",
r"\[(?!size|style|img|url)(.+?)\]\((.+?)\)": r"[url=\2]\1[/url]",
r"<img src=\"(.+?)\" alt=(\".+?\") width=\"(.+?)\".+>": r"[img title=\2 width=\3]\1[/img]",
r"\*\*(.+)\*\*": r"[b]\1[/b]",
r"\*(.+)\*": r"[i]\1[/i]",
r"_([^_\n]+?)_(?![\w])": r"[i]\1[/i]",
r"_((?:https[^_\n])+?)_(?![\w])": r"[i]\1[/i]",
r"__(.+)__": r"[u]\1[/u]",
r"~~(.+)~~": r"[s]\1[/s]",
r"`(.+)`": r"\1", # BBCode has no inline code blocks
Expand Down
12 changes: 12 additions & 0 deletions gm4_apple_trees/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Apple Trees <!--$headerTitle--><!--$pmc:delete-->

Apples don't grow on oak trees, silly Mojang! This datapack adds actual apple trees. Find them in forests or buy a sapling from a Wandering Trader.

<img src="images/apple_tree.png" alt="Apple Tree in a Forest" width="500"/><!--$localAssetToURL--> <!--$modrinth:replaceWithVideo--> <!--$pmc:delete-->

### Features:
- Apple trees naturally generate in Forests
- Pick fully grown apples, or wait for them to fall on their own
- Apples regrow every three 3 days
- Apple Saplings drop from chopped down trees, or can be bought from Wandering Traders
- If you're lucky, you might even find an ultra-rare golden apple tree in the wild
4 changes: 4 additions & 0 deletions gm4_apple_trees/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ meta:
- SpecialBuilder32
Icon Design:
- BluePsychoRanger
modrinth:
project_id: Afacz65w
smithed:
pack_id: gm4_apple_trees
Binary file added gm4_apple_trees/images/apple_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions gm4_bat_grenades/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,3 @@ Tired of the uselessness of bats? Need something to spice up your caving adventu
- Bats explode with about 1/3 the strength of a creeper, easily survivable except on low health.
- Adds a custom advancement obtainable for that unlucky soul who dies via bat.
- Bats, if you manage to kill them, drop a few pieces of gunpowder.

### More Info
<!--$youtubeLinkInsert-->

<!--$wikiLinkInsert-->

### Credits
<!--$creditsInsert -->

<!--$footerInsert-->
2 changes: 2 additions & 0 deletions gm4_bat_grenades/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ meta:
- Sparks
modrinth:
project_id: qWQqEQMY
smithed:
pack_id: gm4_bat_grenades
planetminecraft:
uid: 4293806
11 changes: 0 additions & 11 deletions gm4_better_armour_stands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,3 @@ Ever felt like Armour Stands looked a bit boring? Better Armour Stands lets your
Want some preset poses? Download the [Poses Pack Expansion]($dynamicLink:gm4_poses_pack)

Add particles to your builds with the [Particles Pack Expansion]($dynamicLink:gm4_particles_pack)


### More Info
<!--$youtubeLinkInsert-->

<!--$wikiLinkInsert-->

### Credits
<!--$creditsInsert -->

<!--$footerInsert-->
2 changes: 2 additions & 0 deletions gm4_better_armour_stands/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ meta:
- Sparks
modrinth:
project_id: ib7YfS5V
smithed:
pack_id: gm4_better_armour_stands
Empty file added gm4_calling_bell/README.md
Empty file.
10 changes: 0 additions & 10 deletions gm4_chairs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,3 @@ Since the dawn of Minecraft, stairs have been used as chairs in every house you'
Want some preset poses? Download the [Poses Pack Expansion]($dynamicLink:gm4_poses_pack)

Add particles to your builds with the [Particles Pack Expansion]($dynamicLink:gm4_particles_pack)

### More Info
<!--$youtubeLinkInsert-->

<!--$wikiLinkInsert-->

### Credits
<!--$creditsInsert -->

<!--$footerInsert-->
12 changes: 1 addition & 11 deletions gm4_crossbow_cartridges/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
# Crossbow Cartridges<!--$headerTitle--><!--$pmc:delete-->

Shoot more than just arrows! Crossbow Cartridges allows your crossbow to fire a variety of projectiles; Shoot Pufferfish, Tripwires, Torches, and many more <!--$pmc:headerSize>
Shoot more than just arrows! Crossbow Cartridges allows your crossbow to fire a variety of projectiles; Shoot Pufferfish, Tripwires, Torches, and many more <!--$pmc:headerSize-->

<img src="images/crossbow_cartridges.webp" alt="Crossbow Cartridges Example" width="350"/> <!--$localAssetToURL--> <!--$modrinth:replaceWithVideo--> <!--$pmc:delete-->

### Features:
- Hold new projectiles in your offhand to shoot them from your crossbow
- Shoot fish buckets, splash potions, tnt, fire charges, torches and string!
- Adds two new crossbow advancements

### More Info
<!--$youtubeLinkInsert-->

<!--$wikiLinkInsert-->

### Credits
<!--$creditsInsert -->

<!--$footerInsert-->
2 changes: 2 additions & 0 deletions gm4_crossbow_cartridges/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ meta:
- Sparks
modrinth:
project_id: E7M57BNU
smithed:
pack_id: gm4_crossbow_cartridges
15 changes: 15 additions & 0 deletions gm4_desire_lines/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Desire Lines<!--$headerTitle--><!--$pmc:delete-->

Ever felt like minecraft could do with a bit more immersion? This modular datapack adds a new cool interaction to your survival world in the form of self generating paths! When you walk between two places enough, a desire line will form transforming your grass into coarse dirt all on its own! <!--$pmc:headerSize-->

<img src="images/desire_line.png" alt="A natural desire line" height="350"/> <!--$localAssetToURL--> <!--$modrinth:replaceWithVideo--> <!--$pmc:delete-->

### Features
- When grass or dirt is stepped on it has a chance of turning into dirt or coarse dirt respectively.
- Flowers, grass and other plants will be trampled and break if walked on enough.
- Adds two new custom advancements to be obtained by trampling enough blocks.

### Compatability
When playing with other Gamemode 4 datapacks, adds some bonus features:
- Adds the Celaro shamir when used with the [Metallurgy]($dynamicLink:gm4_metallurgy) datapack.
- Use the [Boots of Ostara]($dynamicLink:gm4_boots_of_ostara) module to spread nature instead of trampling it.
4 changes: 4 additions & 0 deletions gm4_desire_lines/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ meta:
- Andante
Icon Design:
- JonPot
modrinth:
project_id: cx5dX4ug
smithed:
pack_id: gm4_desire_lines
Binary file added gm4_desire_lines/images/desire_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions gm4_display_frames/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Display Frames<!--$headerTitle--><!--$pmc:delete-->

Have you ever wanted to add invisible item frames to your survival world without feeling like you're cheating? This datapack will let you splash your item frames with invisibility potions to make them permanently invisible when displaying an item! <!--$pmc:headerSize-->

<img src="images/display_frames_example.png" alt="Display frames in use" height="350"/> <!--$localAssetToURL--> <!--$modrinth:replaceWithVideo--> <!--$pmc:delete-->

### Features
- When an invisibility potion is thrown in the vicinity of an item frame, it makes the item frame go invisible when displaying an item.
- When an invisible item frame is holding no item it will turn visible but show invisible potion effect particles to indicate that it is still able to turn invisible again.
- Adds a new custom advancement for turning an item frame invisible.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions gm4_ink_spitting_squid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ink Spitting Squid<!--$headerTitle--><!--$pmc:delete-->

For too long have Squid been defenceless, now it's time for them to fight back! Or at least annoy you with some ink while you continue killing them.<!--$pmc:headerSize-->

### Features:
- Squid will spit blinding ink on nearby players for 5 seconds.
- Glow Squid will instead inflict glowing and night vision.
- Only affects players that have their head submerged in water.
2 changes: 2 additions & 0 deletions gm4_live_catch/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ meta:
credits:
Creator:
- MichaelMiner137
Icon Design:
- BluePsychoRanger
Binary file modified gm4_live_catch/pack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8c51e57

Please sign in to comment.