mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +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']);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import {ApplicationContext} from "context";
|
|||
import {EntityKind} from "cad/model/entities";
|
||||
import {BooleanDefinition} from "cad/craft/schema/common/BooleanDefinition";
|
||||
import {OperationDescriptor} from "cad/craft/operationPlugin";
|
||||
import {GenerateWorkbenchOperationDocumentationLink} from "doc/documentationHelper";
|
||||
|
||||
interface BooleanParams {
|
||||
tools: [];
|
||||
|
|
@ -34,7 +33,6 @@ export const BooleanOperation: OperationDescriptor<BooleanParams> = {
|
|||
return returnObject;
|
||||
|
||||
},
|
||||
documentationLink: GenerateWorkbenchOperationDocumentationLink(__dirname),
|
||||
form: [
|
||||
{
|
||||
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 {loadDeclarativeForm} from "cad/mdf/declarativeFormLoader";
|
||||
import {operationIconToActionIcon} from "cad/craft/operationHelper";
|
||||
import {GenerateWorkbenchOperationDocumentationLink} from "doc/documentationHelper";
|
||||
|
||||
export function activate(ctx: ApplicationContext) {
|
||||
|
||||
|
|
@ -51,12 +52,18 @@ export function activate(ctx: ApplicationContext) {
|
|||
|
||||
let schemaIndex = createSchemaIndex(schema);
|
||||
|
||||
let documentationLink = descriptor.documentationLink;
|
||||
if (!documentationLink && descriptor.path) {
|
||||
documentationLink = GenerateWorkbenchOperationDocumentationLink(descriptor.path);
|
||||
}
|
||||
|
||||
let operation = {
|
||||
appearance,
|
||||
schemaIndex,
|
||||
defaultActiveField: schemaIndex.fields[0]?.flattenedPath, // to be overridden by descriptor
|
||||
...descriptor,
|
||||
schema, form
|
||||
schema, form,
|
||||
documentationLink
|
||||
};
|
||||
|
||||
registry$.mutate(registry => registry[id] = operation);
|
||||
|
|
@ -140,6 +147,7 @@ export interface OperationDescriptor<R> {
|
|||
schema?: OperationSchema,
|
||||
onParamsUpdate?: (params, name, value) => void,
|
||||
documentationLink?: string,
|
||||
path?: string,
|
||||
masking?: {
|
||||
id: string,
|
||||
label: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue