You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,11 @@ Supported attributes are:
41
41
42
42
-`compiler`: Compiler Explorer compiler ID, defaulting to `clang2110`.
43
43
-`args`: arguments sent unchanged to Compiler Explorer.
44
+
-`ce-url`: Compiler Explorer base URL, defaulting to `https://godbolt.org/`.
45
+
-`ce-language`: language stored in the Compiler Explorer client state, defaulting to `c++`.
46
+
-`ce-compiler`: override the linked Compiler Explorer compiler without changing Run.
47
+
-`ce-options`: override the linked Compiler Explorer arguments without changing Run.
48
+
-`ce-filters`: JSON object overriding Compiler Explorer output filters, such as `'{"intel":false,"demangle":true}'`.
44
49
-`theme`: `auto`, `light`, or `dark`.
45
50
-`debug`: show the basic/full editor and light/dark switches. These are hidden by default.
46
51
-`width`: any valid CSS width for the complete block.
@@ -73,9 +78,33 @@ Supported attributes are:
73
78
</script>
74
79
```
75
80
76
-
Call `CodeBlocks.configure(options)` before a block is upgraded to set defaults for later blocks. The available options are `theme`, `showDebugControls`, `compiler`, `args`, `compilerExplorerUrl`, `editorOptions`, `styles`, and `onStatus`.
81
+
Call `CodeBlocks.configure(options)` before a block is upgraded to set defaults for later blocks. The available options are `theme`, `showDebugControls`, `compiler`, `args`, `compilerExplorer`, `editorOptions`, `styles`, and `onStatus`.
82
+
83
+
The Compiler Explorer link contains the active source, filename, compiler, arguments, and output filters in its `/clientstate/` URL. No upload or short-link request is needed. Client-state fields can be overridden globally or when creating an individual block:
84
+
85
+
```js
86
+
CodeBlocks.configure({
87
+
compilerExplorer: {
88
+
baseUrl:"https://godbolt.org/",
89
+
language:"c++",
90
+
compiler:"gsnapshot",
91
+
options:"-std=c++26 -O2",
92
+
filters: {
93
+
intel:false,
94
+
demangle:true,
95
+
commentOnly:false,
96
+
},
97
+
libs: [],
98
+
specialoutputs: [],
99
+
tools: [],
100
+
overrides: [],
101
+
},
102
+
});
103
+
```
104
+
105
+
The legacy `compilerExplorerUrl` JavaScript option remains available as an alias for `compilerExplorer.baseUrl`.
77
106
78
-
`CodeBlocks.get(element)` returns the upgraded block instance. It exposes `getValue`, `setValue`, `getTabs`, `selectTab`, `focus`, `run`, `setTheme`, `dispose`, `onDidChange`, `editorReady`, `monacoReady`, and `clangdReady`. `getValue` and `setValue` act on the active tab. `monacoReady` resolves to the underlying Monaco standalone editor for integrations that need the native editor API.
107
+
`CodeBlocks.get(element)` returns the upgraded block instance. It exposes `getValue`, `setValue`, `getTabs`, `selectTab`, `getCompilerExplorerUrl`, `focus`, `run`, `setTheme`, `dispose`, `onDidChange`, `editorReady`, `monacoReady`, and `clangdReady`. `getValue` and `setValue` act on the active tab. `monacoReady` resolves to the underlying Monaco standalone editor for integrations that need the native editor API.
79
108
80
109
Styling uses CSS custom properties. Common properties include:
0 commit comments