mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
create documentation link from __dirname
This commit is contained in:
parent
991287f133
commit
cb13e2d374
4 changed files with 17 additions and 9 deletions
|
|
@ -90,7 +90,7 @@ module.exports = function(grunt) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.registerTask('default', ['clean', 'build', 'copy:resources', 'copy:lib_assets', 'mark-revision', 'show-revision']);
|
grunt.registerTask('default', ['clean', 'build', 'copy:resources', 'copy:lib_assets', 'gen-docs', 'mark-revision', 'show-revision']);
|
||||||
|
|
||||||
grunt.registerTask('gen-docs', ['copy:docs', 'process-markdown']);
|
grunt.registerTask('gen-docs', ['copy:docs', 'process-markdown']);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import {ApplicationContext} from "context";
|
||||||
import {EntityKind} from "cad/model/entities";
|
import {EntityKind} from "cad/model/entities";
|
||||||
import {BooleanDefinition} from "cad/craft/schema/common/BooleanDefinition";
|
import {BooleanDefinition} from "cad/craft/schema/common/BooleanDefinition";
|
||||||
import {OperationDescriptor} from "cad/craft/operationPlugin";
|
import {OperationDescriptor} from "cad/craft/operationPlugin";
|
||||||
import {GenerateWorkbenchOperationDocumentationLink} from "doc/documentationHelper";
|
|
||||||
|
|
||||||
interface BooleanParams {
|
interface BooleanParams {
|
||||||
tools: [];
|
tools: [];
|
||||||
|
|
@ -34,7 +33,6 @@ export const BooleanOperation: OperationDescriptor<BooleanParams> = {
|
||||||
return returnObject;
|
return returnObject;
|
||||||
|
|
||||||
},
|
},
|
||||||
documentationLink: GenerateWorkbenchOperationDocumentationLink(__dirname),
|
|
||||||
form: [
|
form: [
|
||||||
{
|
{
|
||||||
type: 'selection',
|
type: 'selection',
|
||||||
|
|
@ -97,5 +95,6 @@ export const BooleanOperation: OperationDescriptor<BooleanParams> = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
path: __dirname
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,4 +39,5 @@ export const DeleteBodyOperation: OperationDescriptor<DeleteBodyParams> = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
path: __dirname,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import {IconDeclaration} from "cad/icons/IconDeclaration";
|
||||||
import {resolveIcon} from "cad/craft/ui/iconResolver";
|
import {resolveIcon} from "cad/craft/ui/iconResolver";
|
||||||
import {loadDeclarativeForm} from "cad/mdf/declarativeFormLoader";
|
import {loadDeclarativeForm} from "cad/mdf/declarativeFormLoader";
|
||||||
import {operationIconToActionIcon} from "cad/craft/operationHelper";
|
import {operationIconToActionIcon} from "cad/craft/operationHelper";
|
||||||
|
import {GenerateWorkbenchOperationDocumentationLink} from "doc/documentationHelper";
|
||||||
|
|
||||||
export function activate(ctx: ApplicationContext) {
|
export function activate(ctx: ApplicationContext) {
|
||||||
|
|
||||||
|
|
@ -51,12 +52,18 @@ export function activate(ctx: ApplicationContext) {
|
||||||
|
|
||||||
let schemaIndex = createSchemaIndex(schema);
|
let schemaIndex = createSchemaIndex(schema);
|
||||||
|
|
||||||
|
let documentationLink = descriptor.documentationLink;
|
||||||
|
if (!documentationLink && descriptor.path) {
|
||||||
|
documentationLink = GenerateWorkbenchOperationDocumentationLink(descriptor.path);
|
||||||
|
}
|
||||||
|
|
||||||
let operation = {
|
let operation = {
|
||||||
appearance,
|
appearance,
|
||||||
schemaIndex,
|
schemaIndex,
|
||||||
defaultActiveField: schemaIndex.fields[0]?.flattenedPath, // to be overridden by descriptor
|
defaultActiveField: schemaIndex.fields[0]?.flattenedPath, // to be overridden by descriptor
|
||||||
...descriptor,
|
...descriptor,
|
||||||
schema, form
|
schema, form,
|
||||||
|
documentationLink
|
||||||
};
|
};
|
||||||
|
|
||||||
registry$.mutate(registry => registry[id] = operation);
|
registry$.mutate(registry => registry[id] = operation);
|
||||||
|
|
@ -140,6 +147,7 @@ export interface OperationDescriptor<R> {
|
||||||
schema?: OperationSchema,
|
schema?: OperationSchema,
|
||||||
onParamsUpdate?: (params, name, value) => void,
|
onParamsUpdate?: (params, name, value) => void,
|
||||||
documentationLink?: string,
|
documentationLink?: string,
|
||||||
|
path?: string,
|
||||||
masking?: {
|
masking?: {
|
||||||
id: string,
|
id: string,
|
||||||
label: string;
|
label: string;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue