Giter VIP home page Giter VIP logo

infobook-html's Introduction

Cyclops Infobook HTML

Build Status Coverage Status npm version

Output Cyclops infobooks as HTML.

This tool is the basis for the following mod-specific plugins:

Usage

This tool allows Cyclops infobooks to be exported as an HTML website in three phases:

  1. Metadata generation: A preparation step for generating all required metadata that is needed for serializing the infobook to HTML.
  2. Icon generation: Exporting item and block icons to PNG files.
  3. HTML generation: Serialization to HTML based on the infook XML and metadata.

1. Metadata Generation

This step will start a Forge server with your mods so that all relevant metadata can be exported to JSON files.

Before you can execute this phase, you need a modpack.json file with contents that look as follows:

{
  "minecraft": "1.12.2",
  "forge": "14.23.5.2838",
  "mods": [
	{
	  "type": "curseforge",
	  "project": "cyclops-core",
	  "artifact": "CyclopsCore-1.12.2",
	  "version": "1.4.0"
	},
    {
	  "type": "maven",
      "artifact": "org.cyclops.integrateddynamics:IntegratedDynamics:1.12.2-1.0.9-1317",
      "repo": "https://oss.jfrog.org/artifactory/simple/libs-release/"
    },
    {
	  "type": "maven",
      "artifact": "org.cyclops.commoncapabilities:CommonCapabilities:1.12.2-2.4.4-309",
      "repo": "https://oss.jfrog.org/artifactory/simple/libs-release/"
    },
    {
      "type": "raw",
      "name": "integratedscripting-1.19.2-1.0.0-61.jar",
      "url": "https://www.dropbox.com/s/mbbikni5ieyttuq/integratedscripting-1.19.2-1.0.0-61.jar?dl=1"
    }
  ]
}

The "forge" entry may be replaced by "neoforge".

To start this phase, simply run generate-mod-metadata modpack.json generate.

Optionally, you can delete the resulting server files afterwards using generate-mod-metadata modpack.json clean.

If you want to re-download the mods without re-installing Forge, you can run generate-mod-metadata modpack.json cleanmods.

2. Icon Generation

This phase should be done using the Item Exporter mod.

Simply create a modpack with all the mods that were downloaded in the previous step (including the Item Exporter mod), start a world, and run the /iconexporter export 64 command.

Next, copy the resulting contents of icon-exports-x64 to icons in your project directory.

3. HTML Generation

Before you start this phase, make sure the following files and directories are present:

  • registries/crafting_recipe.json: All crafting recipes. (Generated in Metadata Generation)
  • registries/item_translation_keys.json: A mapping from all items to translation keys. (Generated in Metadata Generation)
  • registries/fluid_translation_keys.json: A mapping from all items to translation keys. (Generated in Metadata Generation)
  • mod_assets/ The mod asset files extracting from the mod jars. (Generated in Metadata Generation)
  • config.json: A configuration file with the following contents:
{
  "baseUrl": "/",
  "googleAnalytics": "UA-???????-??",
  "googleAdsense": {
    "client": "ca-pub-?",
    "slot": "?",
    "format": "auto"
  },
  "colors": {
    "h": "#16384c",
    "border": "#3381ad",
    "border_light": "#49b8f7",
    "border_muted": "#9fcae3",
    "main_background": "#e6d6ac",
    "outer_background": "#09171f"
  },
  "icon": "https://media.forgecdn.net/attachments/70/844/logo.png",
  "modId": "integrateddynamics",
  "modName": "Integrated Dynamics",
  "modUrl": "https://www.curseforge.com/minecraft/mc-mods/integrated-dynamics",
  "bookName": "On the Dynamics of Integration",
  "sectionsFile": "mod_assets/integrateddynamics/info/on_the_dynamics_of_integration.xml",
  "injectSections": {
    "info_book.integrateddynamics.manual": [
      {
        "sectionsFile": "mod_assets/integratedtunnels/info/tunnels_info.xml",
        "modId": "integratedtunnels"
      }
    ],
    "info_book.integrateddynamics.tutorials": [
      {
        "sectionsFile": "mod_assets/integratedtunnels/info/tunnels_tutorials.xml",
        "modId": "integratedtunnels"
      }
    ]
  },
  "keybindings": {
    "key.integrateddynamics.logic_programmer_focus_search": "Alt + F",
    "key.integrateddynamics.logic_programmer_open_rename": "Alt + R"
  },
  "recipeOverrides": {},
  "recipePredefineds": {}
}

This phase can be started by executing generate-cyclops-infobook-html config.json /output. Afterwards, the contents of /output can be hosted on any Web server.

Plugins

Optionally, plugins can be loaded to for example add support for non-default appendix handlers.

This can be done by implementing IInfobookPlugin, and exporting an instance of it via a JavaScript file.

Next, the plugin can be loaded when generating HTML by adding the following to your config.json file:

{
  "plugins": [
    "path/to/instance.js"
  ],
}

Example: Integrated Dynamics plugin

License

This software is written by Ruben Taelman.

This code is released under the MIT license.

infobook-html's People

Contributors

greenkeeper[bot] avatar renovate-bot avatar renovate[bot] avatar rubensworks avatar

Watchers

 avatar  avatar  avatar

infobook-html's Issues

An in-range update of @types/node is breaking the build 🚨

The dependency @types/node was updated from 12.6.9 to 12.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).
  • βœ… coverage/coveralls: First build on greenkeeper/@types/node-12.7.0 at 72.222% (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>rubensworks/renovate-presets:js)

An in-range update of @types/node is breaking the build 🚨

The dependency @types/node was updated from 12.12.1 to 12.12.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).
  • βœ… coverage/coveralls: First build on greenkeeper/@types/node-12.12.2 at 72.222% (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @types/mkdirp Unavailable
npm @types/rimraf Unavailable
npm tslint Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency @types/istanbul-reports to v3.0.4
  • Update dependency rimraf to v6
  • πŸ” Create all rate-limited PRs at once πŸ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • Update dependency xml2js to ^0.6.0
  • Update dependency @types/mkdirp to v2
  • Update dependency @types/node to v20
  • Update dependency @types/rimraf to v4
  • Update dependency mkdirp to v3
  • Update dependency yauzl to v3

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @types/mkdirp ^0.5.2
  • @types/ncp ^2.0.1
  • @types/node ^13.1.0
  • @types/node-fetch ^2.5.0
  • @types/pug ^2.0.4
  • @types/rimraf ^3.0.0
  • @types/xml2js ^0.4.4
  • @types/yauzl ^2.9.1
  • minimist ^1.2.0
  • mkdirp ^0.5.1
  • mvn-artifact-download ^5.0.0
  • ncp ^2.0.0
  • node-fetch ^2.6.0
  • pug ^3.0.0
  • rimraf ^3.0.0
  • xml2js ^0.4.19
  • yauzl ^2.10.0
  • @types/jest ^28.0.0
  • @types/minimist ^1.2.0
  • coveralls ^3.0.3
  • jest ^28.0.0
  • manual-git-changelog ^1.0.1
  • pre-commit ^1.2.2
  • ts-jest ^28.0.0
  • tslint ^6.0.0
  • tslint-eslint-rules ^5.4.0
  • typescript ^4.0.0
  • @types/istanbul-reports 3.0.0
travis
.travis.yml
  • node 10
  • node 12

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.