Skip to content

Commit e7a0151

Browse files
committed
Markdownlint lint fixes batch #3
1 parent 55a576d commit e7a0151

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+215
-186
lines changed

dev-docs/add-rtd-submodule.md

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ sidebarType: 1
66
---
77

88
# How to Add a Real Time Data Submodule
9+
910
{:.no_toc}
1011

1112
Sub-modules interact with the Real-Time Data (RTD) core module to
1213
add data to bid requests or add targeting values for the primary ad server.
1314

14-
1515
* TOC
1616
{:toc }
1717

1818
## Overview
19+
1920
The point of the Real Time Data (RTD) infrastructure is to make configuration consistent for publishers. Rather than having dozens of different modules with disparate config approaches, being a Real-Time Data sub-module means plugging into a framework
2021
for publishers to control how sub-modules behave. For example, publishers can define how long the auction can be delayed and give some
2122
sub-modules priority over others.
@@ -40,13 +41,13 @@ Here is the flow for how the RTD-core module interacts with its sub-modules:
4041
The activities performed by the RTD-core module are on the left-hand side, while the functions
4142
that can be provided by your RTD sub-module are on the right-hand side. Note that you don't need to implement all of the functions - you'll want to plan out your functionality and develop the appropriate functions.
4243

43-
4444
## Creating a Sub-Module
4545

4646
When you create a Real-Time Data sub-module, you will be operating under the umbrella of the Real-Time Data core module. Here are the services core provides:
47-
- your sub-module will be initialized as soon as pbjs.setConfig({realTimeData}) is called. If you can initialize at the time of code load, that can be done at the bottom of your javascript file.
48-
- whenever any of your functions is called, it will be passed the config params provided by the publisher. As a result, you should not call getConfig().
49-
- your functions will also be passed all available privacy information. As a result, you do not need to query to get GDPR, US Privacy, or any other consent parameters.
47+
48+
* your sub-module will be initialized as soon as pbjs.setConfig({realTimeData}) is called. If you can initialize at the time of code load, that can be done at the bottom of your javascript file.
49+
* whenever any of your functions is called, it will be passed the config params provided by the publisher. As a result, you should not call getConfig().
50+
* your functions will also be passed all available privacy information. As a result, you do not need to query to get GDPR, US Privacy, or any other consent parameters.
5051

5152
Working with any Prebid project requires using Github. In general, we recommend the same basic workflow for any project:
5253

@@ -65,7 +66,8 @@ with the [module rules](/dev-docs/module-rules.html) that apply globally and to
6566
Create a markdown file under `modules` with the name of the module suffixed with 'RtdProvider', e.g., `exRtdProvider.md`
6667

6768
Example markdown file:
68-
{% highlight text %}
69+
70+
```md
6971
# Overview
7072

7173
Module Name: Ex Rtd Provider
@@ -90,7 +92,7 @@ In order to let RTD-core know where to find the functions in your sub-module, cr
9092
| param name | type | Scope | Description | Params |
9193
| :------------ | :------------ | :------ | :------ | :------ |
9294
| name | string | required | must match the name provided by the publisher in the on-page config | n/a |
93-
| gvlid | number | optional | global vendor list ID for your submodule | n/a |
95+
| gvlid | number | optional | global vendor list ID for your submodule | n/a |
9496
| init | function | required | defines the function that does any auction-level initialization required | config, userConsent |
9597
| getTargetingData | function | optional | defines a function that provides ad server targeting data to RTD-core | adUnitArray, config, userConsent |
9698
| getBidRequestData | function | optional | defines a function that provides bid request data to RTD-core | reqBidsConfigObj, callback, config, userConsent |
@@ -100,7 +102,8 @@ In order to let RTD-core know where to find the functions in your sub-module, cr
100102
| onBidResponseEvent | function |optional | listens to the BID_RESPONSE event and calls a sub-module function that lets it know when a bid response has been collected | bidResponse, config, userConsent |
101103

102104
For example:
103-
{% highlight text %}
105+
106+
```javascript
104107
export const subModuleObj = {
105108
name: 'ExampleRTDModule',
106109
init: init,
@@ -112,20 +115,22 @@ export const subModuleObj = {
112115

113116
Register submodule to RTD-core:
114117

115-
{% highlight text %}
118+
```javascript
116119
submodule('realTimeData', subModuleObject);
117120
```
118121

119122
#### User Consent
120123

121124
Several of the interfaces get a `userConsent` object. It's an object that carries these attributes:
122-
- [gdpr](/dev-docs/modules/consentManagement.html#bidder-adapter-gdpr-integration) - GDPR
123-
- [usp](/dev-docs/modules/consentManagementUsp.html#bidder-adapter-us-privacy-integration) - US Privacy (aka CCPA)
124-
- [coppa](/dev-docs/publisher-api-reference/setConfig.html#setConfig-coppa) - the Child Online Privacy Protection Act
125+
126+
* [gdpr](/dev-docs/modules/consentManagement.html#bidder-adapter-gdpr-integration) - GDPR
127+
* [usp](/dev-docs/modules/consentManagementUsp.html#bidder-adapter-us-privacy-integration) - US Privacy (aka CCPA)
128+
* [coppa](/dev-docs/publisher-api-reference/setConfig.html#setConfig-coppa) - the Child Online Privacy Protection Act
125129

126130
These are provided so you can do the right thing with respect to regulations. The only privacy requirement imposed by the RTD-core is that sub-modules make make use of the StorageManager instead of attempting to access cookies or localstorage directly.
127131

128132
#### The init() function
133+
129134
1. This function receives module configuration and userConsent parameters
130135
2. If the function returns `false`, the submodule will be ignored.
131136

@@ -137,7 +142,8 @@ This is the function that will allow RTD sub-modules to merge ad server targetin
137142

138143
1. RTD-core will call this function with an array of adUnits, config, and userConsent as parameters
139144
2. Your sub-module should respond with per-adslot data that should be set as key values on the ad server targeting in this format:
140-
{% highlight text %}
145+
146+
```json
141147
{
142148
"slotA":{
143149
"p":0.56, // ad server targeting variable (e.g. p) for slotA is 0.56
@@ -150,7 +156,7 @@ This is the function that will allow RTD sub-modules to merge ad server targetin
150156

151157
**Code Example**
152158

153-
{% highlight text %}
159+
```javascript
154160
/** @type {RtdSubmodule} */
155161
export const subModuleObj = {
156162
name: 'ExampleRTDModule',
@@ -177,27 +183,27 @@ submodule('realTimeData', subModuleObj);
177183
This is the function that will allow RTD sub-modules to modify the AdUnit object for each auction. It's called as part of the requestBids hook.
178184

179185
1. RTD-core will call this function with:
180-
- reqBidsConfigObj: a slightly modified version of the object that's passed to `pbjs.requestBids` (see [below](#reqBidsConfigObj)). Note that several auctions can happen concurrently, so the sub-module must be ready to support this.
181-
- callback: lets RTD-core know which auction the sub-module is done with.
182-
- config: the sub-module's config params provided by the publisher
183-
- userConsent object (see above)
186+
1. reqBidsConfigObj: a slightly modified version of the object that's passed to `pbjs.requestBids` (see [below](#reqBidsConfigObj)). Note that several auctions can happen concurrently, so the sub-module must be ready to support this.
187+
2. callback: lets RTD-core know which auction the sub-module is done with.
188+
3. config: the sub-module's config params provided by the publisher
189+
4. userConsent object (see above)
184190
2. Your sub-module may update the reqBidsConfigObj and hit the callback. To inject data into the bid requests, you should follow one of these conventions:
185-
- Recommended: use one of these [First Party Data](/features/firstPartyData.html) conventions:
186-
- For AdUnit-specific first party data, set AdUnit.ortb2Imp.ext.data.ATTRIBUTES
187-
- For global first party data, including bidder-specific data, modify the `reqBidsConfigObj` as shown [below](#reqBidsConfigObj)
188-
- Not recommended: Place your data in bidRequest.rtd.RTDPROVIDERCODE.ATTRIBUTES and then get individual adapters to specifically read that location. Note that this method won't pass data to Prebid Server adapters.
191+
1. Recommended: use one of these [First Party Data](/features/firstPartyData.html) conventions:
192+
1. For AdUnit-specific first party data, set AdUnit.ortb2Imp.ext.data.ATTRIBUTES
193+
2. For global first party data, including bidder-specific data, modify the `reqBidsConfigObj` as shown [below](#reqBidsConfigObj)
194+
2. Not recommended: Place your data in bidRequest.rtd.RTDPROVIDERCODE.ATTRIBUTES and then get individual adapters to specifically read that location. Note that this method won't pass data to Prebid Server adapters.
189195

190-
<a id="reqBidsConfigObj" />
196+
<a id="reqBidsConfigObj"></a>
191197

192198
The `reqBidsConfigObj` parameter is a copy of the object passed to [`requestBids`](/dev-docs/publisher-api-reference/requestBids.html), except for:
193199

194-
- `adUnits` and `timeout` are always defined (if the publisher didn't provide them, the default values are filled in - `pbjs.adUnits` and `getConfig('bidderTimeout')` respectively)
195-
- `ortb2` is replaced with an `ortb2Fragments` object, intended to be inspected and / or modified by your module.
200+
* `adUnits` and `timeout` are always defined (if the publisher didn't provide them, the default values are filled in - `pbjs.adUnits` and `getConfig('bidderTimeout')` respectively)
201+
* `ortb2` is replaced with an `ortb2Fragments` object, intended to be inspected and / or modified by your module.
196202

197203
The `ortb2Fragments` parameter is an object containing two properties:
198204

199-
- `global`, an object containing global (not bidder-specific) first party data in the same OpenRTB format used by `setConfig({ortb2})`
200-
- `bidder`, a map from bidder code to bidder-specific, OpenRTB-formatted first party data.
205+
* `global`, an object containing global (not bidder-specific) first party data in the same OpenRTB format used by `setConfig({ortb2})`
206+
* `bidder`, a map from bidder code to bidder-specific, OpenRTB-formatted first party data.
201207

202208
Your module may modify either or both with additional data. If adding bidder-specific data in `ortb2Fragments.bidder`, it should also support a parameter to allow the publisher to define which bidders are to receive the data.
203209

@@ -207,7 +213,7 @@ at the time `requestBids` is called, and RTD submodules that wish to modify it a
207213

208214
**Code Example**
209215

210-
{% highlight text %}
216+
```javascript
211217
/** @type {RtdSubmodule} */
212218
export const subModuleObj = {
213219
name: 'ExampleRTDModule2',
@@ -236,18 +242,21 @@ submodule('realTimeData', subModuleObj);
236242
```
237243
238244
#### beforeInit
245+
239246
1. Use this function to take action to make sure data will be served as soon as possible (AJAX calls, pixels, etc..)
240247
2. This function is **not** invoked by the RTD module, and should be invoked at the bottom of the submodule.
241248
242249
#### Using event listeners
250+
243251
1. The RTD-core module listens for 3 events - `AUCTION_INIT`, `AUCTION_END`, and `BID_RESPONSE`.
244252
2. Each time one of the events fires, RTD-core will invoke the corresponding function on each sub-module, allowing the sub-module to make changes to the event object.
245253
3. To use this on your sub-module, define the required functions as noted in the table above and the examples below.
246254
247255
**Code Example**
248256
249257
Here is a code example with both mandatory and optional functions:
250-
{% highlight text %}
258+
259+
```javascript
251260
/** @type {RtdSubmodule} */
252261
export const subModuleObj = {
253262
name: 'ExampleRTDModule3',
@@ -288,7 +297,6 @@ function beforeInit(){
288297
beforeInit();
289298
```
290299
291-
292300
### Step 3: Add unit tests
293301
294302
1. Create a JS file under `test/spec/modules` with the name of the bidder suffixed with 'RtdProvider_spec', e.g., `exRtdProvider_spec.js`
@@ -305,7 +313,7 @@ Once everything looks good, submit the code, tests, and markdown as a pull reque
305313
306314
2. Create a new file for your RTD sub-module in dev-docs/modules/ExampleRtdProvider.md. Take a look at the other *RtdProvider.md files in that directory for the important header values. Specifically it requires the following:
307315
308-
```
316+
```markdown
309317
---
310318
layout: page_v2
311319
title: Example Module
@@ -322,6 +330,7 @@ Once everything looks good, submit the code, tests, and markdown as a pull reque
322330

323331
[Useful publisher-facing documentation]
324332
```
333+
325334
3. Submit the pull request to the prebid.github.io repo.
326335
327336
### Step 6: Wait for Prebid volunteers to review

dev-docs/add-video-submodule.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ sidebarType: 1
99
{:.no_toc}
1010

1111
Video submodules interact with the Video Module to integrate Prebid with Video Players, allowing Prebid to automatically:
12-
- render bids in the desired video player.
13-
- mark used bids as won.
14-
- trigger player and media events.
15-
- populate the oRTB Video Impression and Content params in the bid request.
12+
* render bids in the desired video player.
13+
* mark used bids as won.
14+
* trigger player and media events.
15+
* populate the oRTB Video Impression and Content params in the bid request.
1616

1717
* TOC
1818
{:toc }
@@ -28,11 +28,12 @@ Publishers who use players from different vendors on the same page can use multi
2828
## Requirements
2929

3030
The Video Module only supports integration with Video Players that meet the following requirements:
31-
- Must support parsing and reproduction of VAST ads.
32-
- Input can be an ad tag URL or the actual Vast XML.
33-
- Must expose an API that allows the procurement of [Open RTB params](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) for Video (section 3.2.7) and Content (section 3.2.16).
34-
- Must emit javascript events for Ads and Media.
35-
- see [Event Registration](#event-registration).
31+
32+
* Must support parsing and reproduction of VAST ads.
33+
* Input can be an ad tag URL or the actual Vast XML.
34+
* Must expose an API that allows the procurement of [Open RTB params](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) for Video (section 3.2.7) and Content (section 3.2.16).
35+
* Must emit javascript events for Ads and Media.
36+
* see [Event Registration](#event-registration).
3637

3738
## Creating a Submodule
3839

@@ -49,7 +50,8 @@ Working with any Prebid project requires using Github. In general, we recommend
4950
Create a markdown file under `modules` with the name of the module suffixed with 'VideoProvider', i.e. `exampleVideoProvider.md`.
5051

5152
Example markdown file:
52-
{% highlight text %}
53+
54+
```md
5355
# Overview
5456

5557
Module Name: Example Video Provider
@@ -73,7 +75,7 @@ Your page must link the Example Player build from our CDN. Alternatively you can
7375
Vendor codes are required to indicate which submodule type to instantiate. Add your vendor code constant to an export const in `vendorCodes.js` in Prebid.js under `libraries/video/constants/vendorCodes.js`.
7476
i.e. in `vendorCodes.js`:
7577

76-
{% highlight text %}
78+
```javascript
7779
export const EXAMPLE_PLAYER_VENDOR = 3;
7880
```
7981

@@ -89,7 +91,7 @@ Your submodule should also import the `submodule` function from `src/hook.js` an
8991

9092
**Code Example**
9193

92-
{% highlight text %}
94+
```javascript
9395
import { submodule } from '../src/hook.js';
9496

9597
function exampleSubmoduleFactory(videoProviderConfig) {
@@ -121,7 +123,8 @@ The submodule object must adhere to the following interface:
121123
| destroy | function | required | Deallocates the submodule and destroys the associated video player. n/a | void | void |
122124

123125
For example:
124-
{% highlight text %}
126+
127+
```javascript
125128
const exampleSubmodule = {
126129
init: init,
127130
getId: getId,
@@ -134,7 +137,7 @@ const exampleSubmodule = {
134137
};
135138
```
136139

137-
<a name="event-registration" />
140+
<a name="event-registration"></a>
138141

139142
#### Event Registration
140143

@@ -158,7 +161,8 @@ Submodules must support attaching and detaching event listeners on the video pla
158161
#### Update .submodules.json
159162

160163
In prebid.js, add your new submodule to `.submodules.json` under the `videoModule` as such:
161-
{% highlight text %}
164+
165+
```json
162166
{
163167
"parentModules": {
164168
"videoModule": [

dev-docs/bidder-adaptor.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ sidebarType: 1
99

1010

1111
# How to Add a New Prebid.js Bidder Adapter
12+
1213
{:.no_toc}
1314

1415
At a high level, a bidder adapter is responsible for:
@@ -23,10 +24,10 @@ This page has instructions for writing your own bidder adapter. The instruction
2324

2425
## Planning your Adapter
2526

26-
+ [Required Adapter Rules](#bidder-adaptor-Required-Adapter-Conventions)
27-
+ [Required Files](#bidder-adaptor-Required-Files)
28-
+ [Designing your Bid Params](#bidder-adaptor-Designing-your-Bid-Params)
29-
+ [HTTP Simple Requests](#bidder-adaptor-HTTP-simple-requests)
27+
* [Required Adapter Rules](#bidder-adaptor-Required-Adapter-Conventions)
28+
* [Required Files](#bidder-adaptor-Required-Files)
29+
* [Designing your Bid Params](#bidder-adaptor-Designing-your-Bid-Params)
30+
* [HTTP Simple Requests](#bidder-adaptor-HTTP-simple-requests)
3031

3132
<a name="bidder-adaptor-Required-Adapter-Conventions" />
3233

@@ -43,24 +44,24 @@ In order to provide a fast and safe header bidding environment for publishers, t
4344
{: .alert.alert-danger :}
4445
The above list is **not** the full list of requirements. Failure to follow any of the required conventions defined in the [Module Rules](/dev-docs/module-rules.html) could lead to delays in approving your adapter for inclusion in Prebid.js. If you'd like to apply for an exception to one of the rules, make your request in a new [Prebid.js issue](https://github.com/prebid/Prebid.js/issues).
4546

46-
<a name="bidder-adaptor-Required-Files" />
47+
<a name="bidder-adaptor-Required-Files"></a>
4748

4849
### Required Files
4950

5051
With each adapter submission, there are two files required to be in the pull request:
5152

5253
* `modules/exampleBidAdapter.js`: the file containing the code for the adapter
5354
* `modules/exampleBidAdapter.md`: a markdown file containing key information about the adapter:
54-
* The contact email of the adapter's maintainer.
55-
* A test ad unit that will consistently return test creatives. This helps us to ensure future Prebid.js updates do not break your adapter. Note that if your adapter supports video (instream and/or outstream context) or native, you must also provide example parameters for each type.
55+
* The contact email of the adapter's maintainer.
56+
* A test ad unit that will consistently return test creatives. This helps us to ensure future Prebid.js updates do not break your adapter. Note that if your adapter supports video (instream and/or outstream context) or native, you must also provide example parameters for each type.
5657

5758
Example markdown file:
5859

59-
{% highlight text %}
60+
```md
6061

6162
# Overview
6263

63-
```
64+
```markdown
6465
Module Name: Example Bidder Adapter
6566
Module Type: Bidder Adapter
6667
Maintainer: [email protected]
@@ -71,7 +72,8 @@ Maintainer: [email protected]
7172
Module that connects to Example's demand sources
7273

7374
# Test Parameters
74-
```
75+
76+
```javascript
7577
var adUnits = [
7678
{
7779
code: 'test-div',
@@ -188,11 +190,11 @@ If you're the type that likes to skip to the answer instead of going through a t
188190
{: .alert.alert-warning :}
189191
If your adapter interfaces with an ORTB backend, you may take advantage of Prebid's [ORTB conversion library](https://github.com/prebid/Prebid.js/blob/master/libraries/ortbConverter/README.md), which provides most of the implementation for `buildRequests` and `interpretResponse`.
190192

191-
+ [Overview](#bidder-adaptor-Overview)
192-
+ [Building the Request](#bidder-adaptor-Building-the-Request)
193-
+ [Interpreting the Response](#bidder-adaptor-Interpreting-the-Response)
194-
+ [Registering User Syncs](#bidder-adaptor-Registering-User-Syncs)
195-
+ [Registering on Timeout](#bidder-adaptor-Registering-on-Timout)
193+
* [Overview](#bidder-adaptor-Overview)
194+
* [Building the Request](#bidder-adaptor-Building-the-Request)
195+
* [Interpreting the Response](#bidder-adaptor-Interpreting-the-Response)
196+
* [Registering User Syncs](#bidder-adaptor-Registering-User-Syncs)
197+
* [Registering on Timeout](#bidder-adaptor-Registering-on-Timout)
196198

197199
<a name="bidder-adaptor-Overview" />
198200

@@ -1317,5 +1319,5 @@ The Prebid.org [download page](/download.html) will automatically be updated wit
13171319
13181320
## Further Reading
13191321
1320-
+ [Prebid.js Repo - Bidder Adapter Sources](https://github.com/prebid/Prebid.js/tree/master/modules)
1321-
+ [Module Rules](/dev-docs/module-rules.html)
1322+
* [Prebid.js Repo - Bidder Adapter Sources](https://github.com/prebid/Prebid.js/tree/master/modules)
1323+
* [Module Rules](/dev-docs/module-rules.html)

0 commit comments

Comments
 (0)