Add a etc/config/compiler-explorer.local.properties
file
formatters
keylib/formatters/<formatter>.js
file using the template below, replacing Type
and type
as appropriateimport { BaseFormatter } from '../base-formatter'; export class TypeFormatter extends BaseFormatter { static get key() { return 'type'; } }
key
above corresponds to the type
property you set in the compiler-explorer properties configuration file.format(args, source)
, getDefaultArguments()
, getStyleArguments(style)
and isValidStyle(style)
as necessaryAdd your TypeFormatter
to lib/formatters/_all.js
in alphabetical order
You can check the output of http://localhost:10240/api/formats to be sure your formatter is there.
Make an installer in the infra repository. An example patch for adding an installer can be found here