diff --git a/docs/native-components-ios.md b/docs/native-components-ios.md index 470c05edfa6..d83b8c23c61 100644 --- a/docs/native-components-ios.md +++ b/docs/native-components-ios.md @@ -274,7 +274,7 @@ Until now we've only returned a `MKMapView` instance from our manager's `-(UIVie Note that all `RCTBubblingEventBlock` must be prefixed with `on`. Next, declare an event handler property on `RNTMapManager`, make it a delegate for all the views it exposes, and forward events to JS by calling the event handler block from the native view. -```objectivec{9,17,31-48} +```objectivec // RNTMapManager.m #import diff --git a/website/core/PrismTheme.js b/website/core/PrismTheme.js new file mode 100644 index 00000000000..7a6d3845a6e --- /dev/null +++ b/website/core/PrismTheme.js @@ -0,0 +1,128 @@ +var theme = { + plain: { + color: '#FFFFFF', + background: '#282C34', + }, + styles: [ + // other modifications + { + types: ['property'], + style: { + color: '#2aa198', + }, + }, + // solarized-dark theme + { + types: ['attr-name', 'comment', 'prolog', 'doctype', 'cdata'], + style: { + color: '#93a1a1', + }, + }, + + { + types: ['punctuation'], + style: { + color: '#657b83' /* base00 */, + }, + }, + { + types: ['namespace'], + style: { + opacity: 0.7, + }, + }, + { + types: ['deleted'], + style: { + color: '#d33682' /* magenta */, + }, + }, + { + types: ['selector', 'char', 'builtin', 'url', 'inserted'], + style: { + color: '#2aa198' /* cyan */, + }, + }, + { + types: ['entity'], + style: { + color: '#2aa198' /* cyan */, + }, + }, + { + types: ['atrule'], + style: { + color: '#859900' /* yellow */, + }, + }, + { + types: ['important', 'variable'], + style: { + color: '#cb4b16' /* orange */, + }, + }, + { + types: ['important', 'bold'], + style: { + fontWeight: 'bold', + }, + }, + { + types: ['italic'], + style: { + fontStyle: 'italic', + }, + }, + { + types: ['entity'], + style: { + cursor: 'help', + }, + }, + // react-native theme + { + types: ['attr-name', 'keyword'], + style: { + color: '#c5a5c5', + }, + }, + { + types: ['string', 'regex', 'attr-value'], + style: { + color: '#8dc891', + }, + }, + { + types: ['number', 'constant', 'symbol'], + style: { + color: '#5a9bcf', + }, + }, + { + types: ['boolean'], + style: { + color: '#ff8b50', + }, + }, + { + types: ['class-name'], + style: { + color: '#fac863', + }, + }, + { + types: ['function'], + style: { + color: '#79b6f2', + }, + }, + { + types: ['operator', 'tag'], + style: { + color: '#fc929e', + }, + }, + ], +}; + +module.exports = theme; diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index d431bbc43bb..818dad5020b 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -365,6 +365,11 @@ module.exports = { prism: { defaultLanguage: 'jsx', }, + prism: { + defaultLanguage: 'jsx', + theme: require('./core/PrismTheme'), + additionalLanguages: ['java', 'kotlin', 'objectivec', 'swift'], + }, navbar: { title: 'React Native', logo: { diff --git a/website/versioned_docs/version-0.60/native-components-ios.md b/website/versioned_docs/version-0.60/native-components-ios.md index 4eb358ac9e8..771f1b6ebb0 100644 --- a/website/versioned_docs/version-0.60/native-components-ios.md +++ b/website/versioned_docs/version-0.60/native-components-ios.md @@ -274,7 +274,7 @@ Until now we've only returned a `MKMapView` instance from our manager's `-(UIVie Note that all `RCTBubblingEventBlock` must be prefixed with `on`. Next, declare an event handler property on `RNTMapManager`, make it a delegate for all the views it exposes, and forward events to JS by calling the event handler block from the native view. -```objectivec{9,17,31-48} +```objectivec // RNTMapManager.m #import diff --git a/website/versioned_docs/version-0.61/native-components-ios.md b/website/versioned_docs/version-0.61/native-components-ios.md index e6e63726b2a..a6f52033baf 100644 --- a/website/versioned_docs/version-0.61/native-components-ios.md +++ b/website/versioned_docs/version-0.61/native-components-ios.md @@ -274,7 +274,7 @@ Until now we've only returned a `MKMapView` instance from our manager's `-(UIVie Note that all `RCTBubblingEventBlock` must be prefixed with `on`. Next, declare an event handler property on `RNTMapManager`, make it a delegate for all the views it exposes, and forward events to JS by calling the event handler block from the native view. -```objectivec{9,17,31-48} +```objectivec // RNTMapManager.m #import diff --git a/website/versioned_docs/version-0.62/native-components-ios.md b/website/versioned_docs/version-0.62/native-components-ios.md index 470c05edfa6..d83b8c23c61 100644 --- a/website/versioned_docs/version-0.62/native-components-ios.md +++ b/website/versioned_docs/version-0.62/native-components-ios.md @@ -274,7 +274,7 @@ Until now we've only returned a `MKMapView` instance from our manager's `-(UIVie Note that all `RCTBubblingEventBlock` must be prefixed with `on`. Next, declare an event handler property on `RNTMapManager`, make it a delegate for all the views it exposes, and forward events to JS by calling the event handler block from the native view. -```objectivec{9,17,31-48} +```objectivec // RNTMapManager.m #import diff --git a/website/versioned_docs/version-0.63/native-components-ios.md b/website/versioned_docs/version-0.63/native-components-ios.md index 470c05edfa6..d83b8c23c61 100644 --- a/website/versioned_docs/version-0.63/native-components-ios.md +++ b/website/versioned_docs/version-0.63/native-components-ios.md @@ -274,7 +274,7 @@ Until now we've only returned a `MKMapView` instance from our manager's `-(UIVie Note that all `RCTBubblingEventBlock` must be prefixed with `on`. Next, declare an event handler property on `RNTMapManager`, make it a delegate for all the views it exposes, and forward events to JS by calling the event handler block from the native view. -```objectivec{9,17,31-48} +```objectivec // RNTMapManager.m #import