How to display formatted JSON in VSCode Extension Webview - vscode-extensions

I'm developing extension for VSCode and need to display formatted JSON inside a Webview panel. It should also be collapsable.
How do I achieve this?

Related

What is the best to use to describe styles for application content?

I have been creating application in React Native. The goal of the application is to have content that can be changed without updating the app. I understand that the two best solutions are either Firebase or some other API call at every application start to get new content. Now I would just like to know if there are any recommended way to style content beside my three current solutions:
Styling content with markdown and then parsing it in application
Styling content with html and then parsing it in application
Or having a standard content object so that all the content is packed the same way and then showing right text/media on correct place with correct style
I am open to any other styling solutions for content and would like to know what is the best way. I also already have a server responding to API call that returns new content, the biggest problem is styling.

Ionic 3 view PDF in content view with external URL

The application has to show invoice PDF inside <div> which is currently rendered in Webapp itself.
For example :
The web app already has the PDF generation functionality which generates by clicking on generate_pdf function.
I want to show the same PDF by using the same function which is currently available for the public.
Example URL:
http://URL/index.php/pulic/view/generate_invoice_pdf/Smgr4NX7yiWfu3J6qhdtRzF9lVT0kLs2
I have tried InAppBrowser however, it opens up outside the app just want to show inside the app.
DocumentViewer is not supported since it does not contain .pdf in URL
Anyone who needs the solution
I use fileTranfer to download the file and File to show it on the device.

Can I remove the title/border of an app in Rally?

I recently found that one of the custom apps I can add to my Rally homepage is a custom HTML app.
This will be really useful to me, since I can use some HTML (Bootstrap) headers to separate apps on my page and make it more organized.
I got the custom HTML to show properly (and I currently have a header/divider) however, it is showing the grey title bar just like any other app would.
Is it possible to hide this when using the HTML app, so just the HTML output shows?
(If anyone is familiar with apps in Sharepoint, it's called a "Chrome" and you can hide the chrome/title so just the content shows.
I don't think there's any built-in chrome to the apps themselves... Can you show a screenshot? Are you following the general formula to embedding apps presented in this guide?
https://help.rallydev.com/apps/2.1/doc/#!/guide/embedding_apps

display html in xaml

I wasted few hours for looking the answer and I'm very sad cause I didn't find anything usefull. I have a CMS in cloud and it provides content for diffrent devices like www site and my new windows store application.
I want to use html formating. I've already created app in c# and xaml and I'm wondering how can I display html
I was happy cause I found http://nuget.org/packages/RichTextBlock.Html2Xaml but I can't make it work. I get blank page. No text, no error, no nothing.
Can someone pls tell me how can I display html in my app ?
Use a WebView/WebViewBrush or use HTML Agility Pack and implement the styles/rendering yourself.
In WinRt app you can display html code by some ways:
Using WebView with it's NavigateToString("html content")
Using WebViewBrush and displaying it in rectangle
If you had your .html file local - you can open it with myWebview.Navigate(new Uri("ms-appx-web:///" + myPath));
You can make a screenshot of webpage by the method wich I describe here and open it as a picture.
For more info, see the WebView control sample

Can I get the current HTML or Uri for the Metro WebView control?

It doesn't appear that the Source property for the XAML WebView control is updating as the user is navigating in the WebView. Is it possible to get either the current Uri or the HTML currently being rendered in the WebView? My need is to parse the HTML that is being displayed so either would work.
Turns out that the WebView doesn't provide a way to retrieve its HTML directly. But you can use WebView.InvokeScript like this:
webview.InvokeScript("eval", new string[] {"document.documentElement.outerHTML;"})
You can also obtain the Uri via the LoadCompleted event's NavigationEventArgs.Uri.
Did you look at the LoadCompleted event for WebView? That gives the URI that's just loaded.
The property you are looking for is called Source.
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webview.source.aspx
Unluckily the Document property of WinForms WebBrowser doesn't seem to exist anymore.
You will have to re-download the page and process it using libraries like HtmlAgilityPack and Fizzler/FizzlerEx.