-
Add a
etc/config/compiler-explorer.local.properties
file- Add a new formatter under the
formatters
key - The new formatter can have the following keys: name, exe, styles, type, explicitVersion (to override version parsing), version (argument to get version info), versionRe (regex to filter out the right version info)
- Add a
lib/formatters/<formatter>.js
file using the template below, replacingType
andtype
as appropriateimport { BaseFormatter } from '../base-formatter'; export class TypeFormatter extends BaseFormatter { static get key() { return 'type'; } }
- The value returned by
key
above corresponds to thetype
property you set in the compiler-explorer properties configuration file. - Tweak
format(source, options)
andisValidStyle(style)
as necessary. See the JSDoc forformat
and the implementations for other formatters to get a further understanding of how to implementformat(source, options)
.
- Add a new formatter under the
-
Add your
TypeFormatter
tolib/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