Fix website syntax highlighting
Summary: We have a bunch of code blocks using languages that aren't rendered by default, so adding syntax highlighting for those languages. Also, some uses are using the wrong "name" for the language, so I've fixed them. Reviewed By: mweststrate Differential Revision: D21974341 fbshipit-source-id: 17146ea5ae4979241c51b3707035470e9742a104
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7a7684e32f
commit
2a5d1d8ff9
@@ -52,7 +52,7 @@ public class MyFlipperPlugin implements FlipperPlugin {
|
||||
@end
|
||||
```
|
||||
<!--C++-->
|
||||
```c++
|
||||
```cpp
|
||||
class MyFlipperPlugin : public FlipperPlugin {
|
||||
public:
|
||||
std::string identifier() const override { return "MyFlipperPlugin"; }
|
||||
@@ -130,7 +130,7 @@ connection.receive("getData", new FlipperReceiver() {
|
||||
@end
|
||||
```
|
||||
<!--C++-->
|
||||
```c++
|
||||
```cpp
|
||||
void MyFlipperPlugin::didConnect(std::shared_ptr<FlipperConnection> conn) {
|
||||
conn->receive("getData", [](const folly::dynamic ¶ms,
|
||||
std::unique_ptr<FlipperResponder> responder) {
|
||||
@@ -177,7 +177,7 @@ connection.send("MyMessage",
|
||||
[connection send:@"getData" withParams:@{@"message":@"hello"}];
|
||||
```
|
||||
<!--C++-->
|
||||
```c++
|
||||
```cpp
|
||||
void MyFlipperPlugin::didConnect(std::shared_ptr<FlipperConnection> conn) {
|
||||
dynamic message = folly::dynamic::object("message", "hello");
|
||||
conn->send("getData", message);
|
||||
|
||||
@@ -62,7 +62,7 @@ To expose an object to the layout inspector in Sonar you have to implement a `SK
|
||||
|
||||
**Don't**
|
||||
|
||||
```objc
|
||||
```objectivec
|
||||
@interface SKArbitraryViewDescriptor : SKViewDescriptor<ArbitraryView *>
|
||||
|
||||
@end
|
||||
@@ -80,7 +80,7 @@ To expose an object to the layout inspector in Sonar you have to implement a `SK
|
||||
|
||||
**Do**
|
||||
|
||||
```objc
|
||||
```objectivec
|
||||
@interface SKArbitraryViewDescriptor : SKNodeDescriptor<ArbitraryView *>
|
||||
@end
|
||||
|
||||
@@ -99,7 +99,7 @@ To expose an object to the layout inspector in Sonar you have to implement a `SK
|
||||
|
||||
In order to register your descriptor for an object, you use `SKDescriptorMapper`. After registering all descriptors you pass on the descriptor-mapper object to the plugin during initialisation.
|
||||
|
||||
```objc
|
||||
```objectivec
|
||||
[descriptorMapper registerDescriptor:[SKArbitraryViewDescriptor new]
|
||||
forClass:[AbritraryView class]];
|
||||
|
||||
@@ -118,7 +118,7 @@ Sometimes all you need is to extend the functionality of an existing descriptor.
|
||||
|
||||
If you want to extend the `SKComponentKitLayoutDescriptor` and add an additional section based on the nodes of the `SKComponentLayoutDescriptor`, you can use `SKSubDescriptor`.
|
||||
|
||||
```objc
|
||||
```objectivec
|
||||
#import <FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.h>
|
||||
|
||||
NSString *YourSubDescriptor(SKComponentLayoutWrapper *)node {
|
||||
|
||||
@@ -26,7 +26,7 @@ MyFlipperPlugin *myPlugin = [client pluginWithIdentifier:@"MyFlipperPlugin"];
|
||||
[myPlugin sendData:myData];
|
||||
```
|
||||
<!--C++-->
|
||||
```c++
|
||||
```cpp
|
||||
auto& client = FlipperClient::instance();
|
||||
auto myPlugin = client.getPlugin<MyFlipperPlugin>("MyFlipperPlugin");
|
||||
if (myPlugin) {
|
||||
|
||||
@@ -27,7 +27,7 @@ Initialize the plugin in the following way:
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<!--Objective-C-->
|
||||
```objc
|
||||
```objectivec
|
||||
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
|
||||
|
||||
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:@"your_suitename"]];
|
||||
|
||||
@@ -72,6 +72,9 @@ const siteConfig = {
|
||||
hitsPerPage: 5,
|
||||
},
|
||||
},
|
||||
prism: {
|
||||
additionalLanguages: ['groovy', 'java', 'kotlin', 'ruby', 'swift'],
|
||||
},
|
||||
},
|
||||
favicon: 'img/icon.png',
|
||||
scripts: [
|
||||
|
||||
Reference in New Issue
Block a user