Skip to content

Commit

Permalink
Push live (#286)
Browse files Browse the repository at this point in the history
* Update host-config.md (#248)

* Update host-config.md

* updated native styling information for ios

* Update host-config.md (#248) (#249)

* Update host-config.md

* updated native styling information for ios

Co-authored-by: shalinijoshi19 <[email protected]>

* Fix typo

Fixes #242

* Webex Team now supports 1.2. (#258)

Hi, I am the engineering manager who manages buttons & cards for webex teams. We are now support 1.2 with certain exceptions.

* Update partners.md

* Fix typo (#257)

* Update service.md (#252)

* Update service.md

* Update partners.md

* Update render-a-card.md (#239)

Fixed a typo

* Update partners.md

* Updated note text - .NET version is available (#265)

* Update Web Chat to 4.8.0 with AC 1.2.5 (#264)

* typo, then > than (#263)

* C196067 - Converting plain-text link to MD syntax (#267)

There are some languages that, based on linguistic grounds, changed the position of the links in comparison to their source content and placed them at the beginning of the string. This prevents their correct rendering on live pages. Kindly consider using MD hyperlink syntax structure \[..\]\(…\) 
Affected Line 13

* Update config to enable docfx v3 (#269)

* fix obsolete ctor

* Update variable name (#280)

* Fixed minor typos (#279)

* Fixed a wrong spelling (#281)

* Updated iOS example (#283)

* Updating Web Chat to 4.9.0 (#284)

* Update templating docs (#272)

* Update templating docs

* update the language

* Updated .Net section in sdk.md (#275)

* added custom funtion to sdk.md

* Update sdk.md

* Update sdk.md

* Update index.md

* Update language.md

* Update language.md

* Update index.md

* Update index.md

* Update toc.yml

* Update index.md

* added Troubleshooting section

* updated sdk section

* Update language.md

* Update sdk.md

* Update AdaptiveCards/templating/index.md

Co-authored-by: shalinijoshi19 <[email protected]>

* Update AdaptiveCards/templating/index.md

Co-authored-by: shalinijoshi19 <[email protected]>

* Update AdaptiveCards/templating/language.md

Co-authored-by: shalinijoshi19 <[email protected]>

* Update index.md

Co-authored-by: Joseph Woo <[email protected]>
Co-authored-by: Joseph Woo <[email protected]>
Co-authored-by: shalinijoshi19 <[email protected]>

Co-authored-by: Joseph Woo <[email protected]>
Co-authored-by: shalinijoshi19 <[email protected]>
Co-authored-by: urangasa <[email protected]>
Co-authored-by: Chris Whitten <[email protected]>
Co-authored-by: Mark McGee <[email protected]>
Co-authored-by: Haldun Bayhantopcu <[email protected]>
Co-authored-by: Bill Bliss <[email protected]>
Co-authored-by: William Wong <[email protected]>
Co-authored-by: Bob <[email protected]>
Co-authored-by: V-vafune <[email protected]>
Co-authored-by: VSC-Service-Account <[email protected]>
Co-authored-by: Tony Xia <[email protected]>
Co-authored-by: Joseph Woo <[email protected]>
Co-authored-by: Joseph Woo <[email protected]>
  • Loading branch information
15 people authored May 19, 2020
1 parent e6418d6 commit 826b599
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 154 deletions.
7 changes: 5 additions & 2 deletions .openpublishing.publish.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@
],
"need_generate_pdf_url_template": false,
"need_generate_pdf": false,
"need_generate_intellisense": false
}
"need_generate_intellisense": false,
"docs_build_engine": {
"name": "docfx_v3"
}
}
2 changes: 1 addition & 1 deletion AdaptiveCards/getting-started/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ There is a great 45-min learn module that covers these steps end-to-end.

### Learn more

This session at Build 2017 covers User Activities in detial.
This session at Build 2017 covers User Activities in detail.

<iframe src="https://channel9.msdn.com/Events/Build/2017/B8108/player" width="960" height="540" allowFullScreen frameBorder="0"></iframe>

Expand Down
2 changes: 1 addition & 1 deletion AdaptiveCards/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ By focusing on keeping it simple and expressive, Markdown created an easy and co
same way, we believe that Adaptive Cards can create a simple, expressive means of describing card content.

### When in doubt, keep it out
It is easier to add later then it is to live with a mistake. If we found ourselves debating whether we should add something or not, we opted to leave it out. It is always easier to add a property than to live with a legacy we wish we didn't have to support.
It is easier to add later than it is to live with a mistake. If we found ourselves debating whether we should add something or not, we opted to leave it out. It is always easier to add a property than to live with a legacy we wish we didn't have to support.


## Build 2019 Session
Expand Down
2 changes: 1 addition & 1 deletion AdaptiveCards/resources/partners.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you are interested in joining the Adaptive Cards ecosystem, please [reach out

Platform | Description | Documentation | Version
---------|-------------|---------------|---------
[Bot Framework Web Chat](https://github.com/Microsoft/BotFramework-WebChat) | Embeddable web chat control for the Microsoft Bot Framework | [Get Started](https://docs.microsoft.com/adaptive-cards/get-started/bots) | 1.2.3 (Web Chat 4.7.1)
[Bot Framework Web Chat](https://github.com/Microsoft/BotFramework-WebChat) | Embeddable web chat control for the Microsoft Bot Framework | [Get Started](https://docs.microsoft.com/adaptive-cards/get-started/bots) | 1.2.5 (Web Chat 4.9.0)
[Outlook Actionable Messages](https://docs.microsoft.com/outlook/actionable-messages/) | Attach an actionable message to email | [Get Started](https://docs.microsoft.com/outlook/actionable-messages/) | 1.0
[Microsoft Teams](https://products.office.com/microsoft-teams/group-chat-software) | Platform that combines workplace chat, meetings, and notes | [Get Started](https://docs.microsoft.com/microsoftteams/platform/concepts/cards/cards-reference#adaptive-card) | 1.2
[Cortana Skills](https://docs.microsoft.com/cortana/skills/adaptive-cards) | A virtual assistant for Windows 10 | [Get Started](https://docs.microsoft.com/adaptive-cards/get-started/bots) | 1.0
Expand Down
2 changes: 1 addition & 1 deletion AdaptiveCards/sdk/designer.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ms.topic: article

The Adaptive Card Designer provides a rich, interactive design-time experience for authoring adaptive cards.

Try it out at https://adaptivecards.io/designer
Try it out at [https://adaptivecards.io/designer](https://adaptivecards.io/designer)

![Designer screenshot](../content/designer.png)

Expand Down
6 changes: 3 additions & 3 deletions AdaptiveCards/sdk/rendering-cards/android/extensibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ public class OnlineImageLoader implements IOnlineImageLoader
@Override
public HttpRequestResult<Bitmap> loadOnlineImage(String url, GenericImageLoaderAsync loader) throws IOException, URISyntaxException
{
String catImnageUri = "http://adaptivecards.io/content/cats/1.png";
byte[] bytes = HttpRequestHelper.get(catImnageUri);
String catImageUri = "http://adaptivecards.io/content/cats/1.png";
byte[] bytes = HttpRequestHelper.get(catImageUri);
if (bytes == null)
{
throw new IOException("Failed to retrieve content from " + catImnageUri);
throw new IOException("Failed to retrieve content from " + catImageUri);
}

Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
Expand Down
2 changes: 1 addition & 1 deletion AdaptiveCards/sdk/rendering-cards/ios/host-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ACOHostConfig *defaultConfig = [[ACHostConfig alloc] init];

## Render a card using host config

Rederer takes adaptive card and host config. HostConfig can be nil, and if nil, default value will be used.
Renderer takes adaptive card and host config. HostConfig can be nil, and if nil, default value will be used.

```objective-c
ACRRenderResult *renderResult;
Expand Down
8 changes: 4 additions & 4 deletions AdaptiveCards/sdk/rendering-cards/ios/render-a-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ NSString *jsonStr = @"{ \"type\": \"AdaptiveCard\", \"version\": \"1.0\", \"body
ACOAdaptiveCardParseResult *cardParseResult = [ACOAdaptiveCard fromJson:jsonStr];

/// access for parse warnings and errors
NSArray<NSError *> errors = cardParseResult.parseErrors;
NSArray<ACRParseWarning *> warnings = cardPraseResult.parseWarnings;
NSArray<NSError *> *errors = cardParseResult.parseErrors;
NSArray<ACRParseWarning *> *warnings = cardParseResult.parseWarnings;
```
## Render a Card
Expand All @@ -31,7 +31,7 @@ Returned UIView uses autolayout. Width will be constraint to the value set by wi
Height is not bound, and when returned it will have the height of sums of all contents rendered. To bound the view dimension, please use NSLayoutConstraint. The exact dimension is accessible from the context of viewDidLayoutSubview of its superview's viewcontroller or its method with the same name if ACRViewController is used.
```objective-c
ACRRenderResult *renderResult;
ACRRenderResult *renderResult = nil;
if(cardParseResult.isValid){
renderResult = [ACRRenderer render:cardParseResult.card config:nil widthConstraint:335];
}
Expand All @@ -55,7 +55,7 @@ ViewController.m
[super viewDidLoad];

NSString *jsonStr = @"{ \"type\": \"AdaptiveCard\", \"version\": \"1.0\", \"body\": [ { \"type\": \"Image\", \"url\": \"http://adaptivecards.io/content/adaptive-card-50.png\", \"horizontalAlignment\":\"center\" }, { \"type\": \"TextBlock\", \"horizontalAlignment\":\"center\", \"text\": \"Hello **Adaptive Cards!**\" } ], \"actions\": [ { \"type\": \"Action.OpenUrl\", \"title\": \"Learn more\", \"url\": \"http://adaptivecards.io\" }, { \"type\": \"Action.OpenUrl\", \"title\": \"GitHub\", \"url\": \"http://github.com/Microsoft/AdaptiveCards\" } ] }";
ACRRenderResult *renderResult;
ACRRenderResult *renderResult = nil;
ACOAdaptiveCardParseResult *cardParseResult = [ACOAdaptiveCard fromJson:jsonStr];
if(cardParseResult.isValid){
renderResult = [ACRRenderer render:cardParseResult.card config:nil widthConstraint:335];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ AdaptiveSchemaVersion schemaVersion = renderer.SupportedSchemaVersion; // 1.0
```csharp
// Build a simple card
// In the real world this would probably be provided as JSON
AdaptiveCard card = new AdaptiveCard()
AdaptiveCard card = new AdaptiveCard(renderer.SupportedSchemaVersion)
{
Body = { new AdaptiveTextBlock() { Text = "Hello World" } }
};
Expand Down
56 changes: 31 additions & 25 deletions AdaptiveCards/templating/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@
title: Templating Overview
author: matthidinger
ms.author: mahiding
ms.date: 07/29/2019
ms.date: 05/18/2020
ms.topic: article
---

# Adaptive Cards Templating (Preview)
# Adaptive Cards Templating

We're excited to share a preview of new tools that will help you **create**, **reuse**, and **share** Adaptive Cards.

> [!IMPORTANT]
>
> These features are **in preview and subject to change**. Your feedback is not only welcome, but critical to ensure we deliver the features **you** need.
> **Breaking changes** in the **May 2020 Release Candidate**
>
> The new templating release candidate package includes some minor breaking changes that you should be aware of if you've been using the older packages. Troubleshoot common migration or usage issues in the [Troubleshooting section below](Add link to the section here).
## Breaking changes as of May 2020

1. The binding syntax changed from `{...}` to `${...}`.
* For Example: `"text": "Hello {name}"` becomes `"text": "Hello ${name}"`
2. The JavaScript API no longer contains an `EvaluationContext` object. Simply pass your data to the `expand` function. Please see the [SDK page](sdk.md) for full details.
3. The .NET API was redesigned to more closely match the JavaScript API. Please see the [SDK page](sdk.md) for full details.

## How can templating help you?
## How can templating help you

Templating enables the separation of **data** from the **layout** in an Adaptive Card.

Expand Down Expand Up @@ -46,7 +55,7 @@ It's comprised of 3 major components:

## Template Language

The template langauge is the syntax used to author an Adaptive Card template.
The template language is the syntax used to author an Adaptive Card template.

> [!NOTE]
>
Expand Down Expand Up @@ -80,7 +89,7 @@ Paste the example below into the **Card Payload Editor** pane:
"items": [
{
"type": "Image",
"url": "{photo}",
"url": "${photo}",
"altText": "Profile picture",
"size": "Small",
"style": "Person"
Expand All @@ -93,7 +102,7 @@ Paste the example below into the **Card Payload Editor** pane:
"items": [
{
"type": "TextBlock",
"text": "Hi {name}!",
"text": "Hi ${name}!",
"size": "Medium"
},
{
Expand All @@ -107,7 +116,7 @@ Paste the example below into the **Card Payload Editor** pane:
},
{
"type": "TextBlock",
"text": "Your manager is: **{manager.name}**"
"text": "Your manager is: **${manager.name}**"
},
{
"type": "TextBlock",
Expand All @@ -117,9 +126,9 @@ Paste the example below into the **Card Payload Editor** pane:
"type": "FactSet",
"facts": [
{
"$data": "{peers}",
"title": "{name}",
"value": "{title}"
"$data": "${peers}",
"title": "${name}",
"value": "${title}"
}
]
}
Expand Down Expand Up @@ -170,12 +179,12 @@ The Templating SDKs make it possible to populate a template with real-data.

> [!NOTE]
>
> During the initial preview we only have a limited set of SDKs available. When we release there will be templating libraries for every supported Adaptive Cards platform.
> At this time templating SDKs are available for .NET and NodeJS. Over time we will release templating SDKs for all remaining Adaptive Cards platform, like iOS, Android, UWP, etc.
Platform | Install | Documentation
--- | --- | ---
JavaScript | `npm install adaptivecards-templating` | [Documentation](https://www.npmjs.com/package/adaptivecards-templating)
.NET | `nuget install AdaptiveCards.Templating` | [Documentation](https://docs.microsoft.com/adaptive-cards/templating/sdk#net)
Platform | Package | Install | Documentation
--- | --- | --- | ---
JavaScript | [![npm install](https://img.shields.io/npm/v/adaptivecards-templating.svg)](https://www.npmjs.com/package/adaptivecards-templating) | `npm install adaptivecards-templating` | [Documentation](https://www.npmjs.com/package/adaptivecards-templating)
.NET | [![Nuget install](https://img.shields.io/nuget/vpre/AdaptiveCards.Templating.svg)](https://www.nuget.org/packages/AdaptiveCards.Templating) | `dotnet add package AdaptiveCards.Templating` | [Documentation](https://docs.microsoft.com/adaptive-cards/templating/sdk#net)

### JavaScript Example

Expand All @@ -186,12 +195,11 @@ var template = new ACData.Template({
// EmployeeCardTemplate goes here
});

var dataContext = new ACData.EvaluationContext();
dataContext.$root = {
// Data goes here
};

var card = template.expand(dataContext);
var card = template.expand({
$root: {
// Your data goes here
}
});
// Now you have an AdaptiveCard ready to render!
```

Expand All @@ -213,6 +221,4 @@ All templates are flat JSON files stored in a GitHub repo so anyone can contribu
## What's next and sending feedback

Templating and the separation of presentation from data takes us a whole lot closer toward our mission: "an ecosystem for exchanging card content in a common and consistent way".

We're eager to share more as soon as we can. In the meantime please give feedback here, [GitHub](https://github.com/microsoft/AdaptiveCards), or Twitter **[@MattHidinger](https://twitter.com/matthidinger)**/**#AdaptiveCards**.
Templating and the separation of presentation from data takes us a whole lot closer toward our mission: "an ecosystem standardized content exchange between apps and services". We've got plenty to deliver in this area, so stay tuned and let us know how it's working for you on [GitHub](https://github.com/Microsoft/AdaptiveCards/issues)!
Loading

0 comments on commit 826b599

Please sign in to comment.