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

Docusaurus API Plugin + Libraries #12

Merged
merged 25 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dcc8849
Testing a new way to interact with park
MaXFeeD Nov 17, 2024
0333d46
Squashed 'api/' content from commit 06e27942d
MaXFeeD Nov 26, 2024
7cdd956
Merge commit '0333d461837f9d4dd5cf8949cbc5bc8ec7210337' as 'api'
MaXFeeD Nov 26, 2024
867263f
Migrating to docusaurus-plugin-typedoc-api
MaXFeeD Nov 26, 2024
972192f
Added libraries, experimental
MaXFeeD Nov 26, 2024
e801283
Squashed 'api/typedoc-plugin/' content from commit b069bc730
MaXFeeD Nov 29, 2024
09342e4
Merge commit 'e8012834f4d49515e4980ac0efc77a99a328ccda' as 'api/typed…
MaXFeeD Nov 29, 2024
f2e8477
Moved packages/plugin/docusaurus-plugin-typedoc-api to docusaurus-typ…
MaXFeeD Nov 29, 2024
65721ce
Bump @docusaurus dependencies (3.6.1 -> 3.6.3)
MaXFeeD Nov 30, 2024
68af6b6
Removed typedoc-codicon-theme, since it cannot be used anymore
MaXFeeD Dec 2, 2024
c193015
Properly linting markdown, ignoring images links
MaXFeeD Dec 2, 2024
0091d8d
Added plugin building to package
MaXFeeD Dec 2, 2024
a5b2f50
Compiling plugin with typescript, copying assets
MaXFeeD Dec 2, 2024
1fcb2a8
Removed plugin footer, useless one
MaXFeeD Dec 2, 2024
6a8ae36
Typedoc 0.26+ uses ReflectionId as identifier (still number, but with…
MaXFeeD Dec 2, 2024
38c1d86
Plugins should use @theme-init instead of @theme
MaXFeeD Dec 2, 2024
a5a0211
Added typedoc 0.26+ document icon
MaXFeeD Dec 2, 2024
f801d4d
Added Options type export to entry point, using it in docusaurus.conf…
MaXFeeD Dec 2, 2024
aa7eb1c
Downgrading to Typedoc 0.25.13 until jiti-v2 is coming out to Docusaurus
MaXFeeD Dec 3, 2024
6245b38
Migrating plugin back too for now
MaXFeeD Dec 3, 2024
73631c5
Moving plugin to @nernar/docusaurus-plugin-typedoc, migrating to Docu…
MaXFeeD Dec 4, 2024
cf25662
Added libraries tsconfig stuff
MaXFeeD Dec 4, 2024
bc10e86
Moved declarations to new location
MaXFeeD Dec 4, 2024
62f7aa0
Added libraries packages to API
MaXFeeD Dec 4, 2024
1f90595
Some dirty stuff to make it work
MaXFeeD Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Dependencies
/node_modules
node_modules/

# Production
/build
/src/pages/api
/innercore*-docs.pdf

# Generated files
Expand Down
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"markdown.preferredMdPathExtensionStyle": "removeExtension",
"markdown.validate.enabled": true,
"mdx.experimentalLanguageServer": true,
"markdown.validate.ignoredLinks": [
"/images/**/*"
],
"search.exclude": {
"**/node_modules": true,
"**/package-lock.json": true,
"**/.wireit": true,
"**/build": true
},
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
}
}
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ I mean modding documentation for Inner Core of course, rewrited from zero to Typ

Everything divided by categories, which also represents sidebar structure. Every markdown location described in **sidebars.js**, you can use it for auto-generation or manually provide required routes.

## API Reference

New era of Core Engine documentation, generated into single webpage like everything here. See [Nernar/API](https://github.com/Nernar/API) repository for details.

## Modding Examples

Here represented most of legendary Core Engine mods with unique mechanics, that you can freely take into your content.

## Libraries freely to use

At beginning, it located by few locations: **libraries** where everything starts, **i18n** where localization performs and **static** where additional files is located.
Expand Down
6 changes: 6 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Production
docs/

# Generated files
/declarations/core-engine.d.ts
/.wireit
924 changes: 924 additions & 0 deletions api/LICENSE

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions api/core-engine/ActorRenderer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* Class, upon which armor and attachments render is based
* It is a model that consists of parts, same as in {@link Render},
* but more abstract, allows creating root parts instead of
* inheritance from old humanoid model.
* @since 2.2.0b75
*/
declare class ActorRenderer {
/**
* Constructs new {@link ActorRenderer} object without parts.
*/
constructor();

/**
* Constructs new {@link ActorRenderer} object,
* based on one of default Minecraft render templates.
* @param templateName default template name
*/
constructor(templateName: DefaultRenderTemplate);

getUniformSet(): ShaderUniformSet;

setTexture(textureName: string): void;

setMaterial(materialName: string): void;

getPart(name: string): ActorRenderer.ModelPart;

/**
* Adds a child model part of an existing one.
* @param name child model name
* @param parentName parent model name
*/
addPart(name: string, parentName: string, mesh?: RenderMesh): ActorRenderer.ModelPart;

/**
* Adds a root model part.
*/
addPart(name: string, mesh?: RenderMesh): ActorRenderer.ModelPart;

}

declare namespace ActorRenderer {

/**
* All methods of {@link ActorRenderer.ModelPart} build in such a way,
* that you can create full render in one chain of calls.
* @example
* ```js
* new ActorRenderer()
* .addPart("child", "parent")
* .addBox(-4, -4, -4, 4, 0, 4)
* .addPart("grandChild", "child")
* .addBox(-4, 0, -4, 4, 4, 4)
* .setOffset(0, 4, 0)
* .endPart();
* ```
*/
class ModelPart {

endPart(): ActorRenderer;

setTexture(textureName: string): ModelPart;

setMaterial(materialName: string): ModelPart;

setTextureSize(w: number, h: number): ModelPart;

setOffset(x: number, y: number, z: number): ModelPart;

setRotation(x: number, y: number, z: number): ModelPart;

setPivot(x: number, y: number, z: number): ModelPart;

setMirrored(isMirrored: boolean): ModelPart;

/**
* @param inflate increases the box by a certain value in all directions
*/
addBox(x: number, y: number, z: number, sizeX: number, sizeY: number, sizeZ: number, inflate: number, u: number, v: number): ModelPart;

clear(): ModelPart;

}

}
48 changes: 48 additions & 0 deletions api/core-engine/AddonEntityRegistry.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Module used to manage custom entities added via add-ons.
* @since 2.0.1b18
* @remarks
* Depends on local player dimension, highly recommended to replace it
* with {@link BlockSource.spawnEntity} and {@link Entity.getTypeName}.
*/
declare namespace AddonEntityRegistry {
/**
* Spawns an entity defined via add-on on the specified coordinates.
* @param nameID entity name ID, as defined from add-on
* @deprecated Client-side method, use {@link BlockSource.spawnEntity} instead.
*/
function spawn(x: number, y: number, z: number, nameID: string): number;

/**
* Added entities stores in registry, so already spawned entity
* data may resolved again by requesting information by UID.
* @returns Add-on entity information by entity ID.
*/
function getEntityData(entity: number): AddonEntity;

interface AddonEntity {
/**
* Entity unique ID.
*/
readonly id: number,

/**
* Add-on defined entity name ID.
*/
readonly type: string,

/**
* Executes command with the entity.
* @param command command to be executed
* @returns Error message or null if the command was run successfully.
*/
exec(command: string): Nullable<string>;

/**
* Executes command with the entity on the specified coordinates.
* @param command command to be executed
* @returns Error message or null if the command was run successfully.
*/
execAt(command: string, x: number, y: number, z: number): Nullable<string>;
}
}
Loading
Loading