Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port iOS documentation #247

Merged
merged 15 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/styles/Microsoft/Units.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ tokens:
- pounds
exceptions:
- "in pixels"
- "Facebook pixels"
20 changes: 20 additions & 0 deletions .vscode/markdown.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,25 @@
"${0:${TM_SELECTED_TEXT}}",
"</Tile>"
]
},
"Tabs": {
"prefix": "tabs",
"description": "Insert a tab group",
"body": [
"<Tabs>",
"<Tab ${1:sync=\"${2:An optional sync label}\"} ${3:icon=\"${4:An optional icon}\"}>",
"",
"### ${5:Tab label}",
"",
"${6:Content}",
"</Tab>"
"<Tab ${7:sync=\"${8:An optional sync label}\"} ${9:icon=\"${10:An optional icon}\"}>",
"",
"### ${11:Tab label}",
"",
"${0:Content}",
"</Tab>",
"</Tabs>"
]
}
}
14 changes: 11 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import {
import expressiveCode from "astro-expressive-code";
import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections";

const astroExpressiveCodeOptions = {
// This is where you can pass your plugin options
frames: {
extractFileNameFromCode: false
},
}

// https://astro.build/config
export default defineConfig({
integrations: [
Expand All @@ -32,9 +39,10 @@ export default defineConfig({
}),
// Enable React for the Algolia search component.
react({ experimentalReactChildren: true }),
expressiveCode({
plugins: [pluginCollapsibleSections()],
}),
expressiveCode(astroExpressiveCodeOptions,
{
plugins: [pluginCollapsibleSections()],
}),
mdx(),
tailwind(),
sitemap(),
Expand Down
26 changes: 12 additions & 14 deletions src/components/Function.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,28 @@ export interface Props {
const { lang, name, link } = Astro.props;
---

<dl class="function">
<dt class="sig-name descname">
<>
<h2 class="sig-name descname">
<span class="pre">{name}</span>
</dt>
<dd>
<slot />
<GitHubRender link={link} lang={lang} />
</dd>
</h2>
<slot />
<GitHubRender link={link} lang={lang} />
{
Astro.slots.has("parameters") && (
<dl>
<dt class="parameters">Parameters:</dt>
<>
<h3>Parameters</h3>
<slot name="parameters" />
</dl>
</>
)
}
{
Astro.slots.has("returns") && (
<dl>
<dt class="returnValues">Return values</dt>
<>
<h3>Return values</h3>
<slot name="returns" />
</dl>
</>
)
}
<h3>Example</h3>
<slot name="snippet" />
</dl>
</>
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const AudienceDropdown: FC = () => {
>
{audiences.map((audience) => (
<a
key={audience.slug}
aria-label={`audience picker item ${audience.slug}`}
href={audience.link}
style={{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (Astro.slots.has("default")) {
search={search}
flex={!noflex && !resizable}
striped={striped}
height={height}
height={height ? Number(height) : "full-height"}
list={list}
>
<Fragment set:html={content} slot="content" />
Expand Down
6 changes: 3 additions & 3 deletions src/components/atlas/BuildTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const BuildTable: FC<{
};

if (props.list) {
const listItems = el.querySelectorAll("ul > li > ul");
const listItems = el.querySelectorAll("body > ul > li > ul");
listItems.forEach((value, key) => {
// The first row is always the header, so we create the columns array with these values
if (key === 0) {
Expand Down Expand Up @@ -143,11 +143,11 @@ const BuildTable: FC<{
<TableV2
data={data}
columns={columns}
autoRowsHeight
searchTerm={searchTerm}
visualProperties={visualProperties}
flex={props.flex}
height={props.height ? Number(props.height) : "full-height"}
height={props.height}
autoRowsHeight
/>
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions src/components/utils/convertCase.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export function toSentenceCase(string: string): string {
let lower = string.toLowerCase();
if (lower === "seealso") {
lower = "see also"
}
return lower[0].toUpperCase() + lower.slice(1);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {2}
let adRevenue = ADJAdRevenue(source: source);
adRevenue.addCallbackParameter(key, value: value);
Adjust.trackAdRevenue(adRevenue);
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {2}
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source];
[adRevenue addCallbackParameter:key value:value];
[Adjust trackAdRevenue:adRevenue];
```

</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {2}
let adRevenue = ADJAdRevenue(source: source);
adRevenue.addPartnerParameter(key, value: value);
Adjust.trackAdRevenue(adRevenue);
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {2}
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source];
[adRevenue addPartnerParameter:key value:value];
[Adjust trackAdRevenue:adRevenue];
```

</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {1}
let adRevenue = ADJAdRevenue(source: source);
//...
Adjust.trackAdRevenue(adRevenue);
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {1}
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source];
//...
[Adjust trackAdRevenue:adRevenue];
```

</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {2}
let adRevenue = ADJAdRevenue(source: source);
adRevenue?.adImpressionsCount = 1;
Adjust.trackAdRevenue(adRevenue);
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {2}
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source];
[adRevenue setAdImpressionsCount:1];
[Adjust trackAdRevenue:adRevenue];
```

</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {2}
let adRevenue = ADJAdRevenue(source: source);
adRevenue?.adRevenueNetwork = "network1";
Adjust.trackAdRevenue(adRevenue);
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {2}
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source];
[adRevenue setAdRevenueNetwork:@"network1"];
[Adjust trackAdRevenue:adRevenue];
```

</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {2}
let adRevenue = ADJAdRevenue(source: source);
adRevenue?.adRevenuePlacement = "banner";
Adjust.trackAdRevenue(adRevenue);
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {2}
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source];
[adRevenue setAdRevenuePlacement:@"banner"];
[Adjust trackAdRevenue:adRevenue];
```

</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {2}
let adRevenue = ADJAdRevenue(source: source);
adRevenue?.adRevenueUnit = "unit1";
Adjust.trackAdRevenue(adRevenue);
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {2}
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source];
[adRevenue setAdRevenueUnit:@"unit1"];
[Adjust trackAdRevenue:adRevenue];
```

</Tab>
</Tabs>
24 changes: 24 additions & 0 deletions src/content/docs/code-snippets/ios/ADJAdRevenue/_setRevenue.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {2}
let adRevenue = ADJAdRevenue(source: source);
adRevenue.setRevenue(1.6, currency: "USD");
Adjust.trackAdRevenue(adRevenue);
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {2}
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source];
[adRevenue setRevenue:1.6 currency:@"USD"];
[Adjust trackAdRevenue:adRevenue];
```

</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {3-5}
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox as? String
let adjustConfig = ADJConfig(
appToken: yourAppToken,
environment: environment)
```

</Tab>
<Tab sync="objc">

### Objective-C

```objective-c {3-4}
NSString *yourAppToken = @"{YourAppToken}";
NSString *environment = ADJEnvironmentSandbox;
*adjustConfig = [ADJConfig configWithAppToken:yourAppToken
environment:environment];
```

</Tab>
<Tab sync="js">

### Javascript

```javascript {4}
setupWebViewJavascriptBridge(function(bridge) {
var yourAppToken = yourAppToken;
var environment = AdjustConfig.EnvironmentSandbox;
var adjustConfig = new AdjustConfig(yourAppToken, environment);
});
```

</Tab>
</Tabs>
Loading
Loading