12

Is it possible to add a new option here and bind an evaluator?

enter image description here

Is it possible to take SageMath, Matlab, Maple, etc. as examples to provide a complete process demonstration?

Aster
  • 3,836
  • 1
  • 18
  • 44
  • Add it to the stylesheet so that it goes with CurrentValue[EvaluationNotebook[], {StyleDefinitions, "ExternalLanguage", CellFrameLabels}]. It seems the menu there changes a CellEvaluationLanguage option. – b3m2a1 Oct 17 '19 at 04:20

1 Answers1

7

It was just an attempt to add a ExternalCell, and did not successfully create an evaluator bind.

enter image description here

  1. First create a new package called ExternalEvaluate_*, only this form can be recognized by External Evaluator Manager.

  2. Then add cell icon and set "ShowInFrontendCellQ" as True.

  3. Then run the ExternalEvaluate`RegisterSystem.

ExternalEvaluate`RegisterSystem["SageMath",
    <|
        "ExecutablePathFunction" -> Function[{vers}, unimplement[]],
        "ExecutablePatternFunction" -> Function[{vers}, unimplement[]],
        "ProgramFileFunction" -> Function[{version}, PacletManager`PacletResource["ExternalEvaluate_SageMath", "REPL"]],
        "ScriptExecCommandFunction" -> Function[{uuid, exec, file, opts}, unimplement[]],

        "Icon" -> Import[PacletManager`PacletResource["ExternalEvaluate_SageMath", "Icon"]],
        "IconCell" -> ToBoxes@Import[PacletManager`PacletResource["ExternalEvaluate_SageMath", "IconCell"]],
        "ShowInFrontendCellQ" -> True,

        "VersionExecCommandFunction" -> Function[{exec}, unimplement[]],
        "PacletName" -> Automatic,
        "SessionProlog" -> None,

        "DeserializationFunction" -> BinaryDeserialize,
        "SerializationFunction" -> BinarySerialize
    |>
  ];

Then a new kind of External Cell is available.

But it needs to bind executable program, still have no idea.

Aster
  • 3,836
  • 1
  • 18
  • 44