diff --git a/examples/exampleOutputWithCodeBlocks.md b/examples/exampleOutputWithCodeBlocks.md index b9c21b5..8dd4715 100644 --- a/examples/exampleOutputWithCodeBlocks.md +++ b/examples/exampleOutputWithCodeBlocks.md @@ -13,7 +13,9 @@ Enter telemetry — by automatically collecting statistics and/or errors, you ca [Azure application insights](https://azure.microsoft.com/en-us/services/application-insights/) makes this collection very simple (and free): +``` npm install [vscode-extension-telemetry](https://github.com/Microsoft/vscode-extension-telemetry) --save +``` If you want a real-world example of its useage you can take a look at how I use it in [AREPL-vscode](https://github.com/Almenon/AREPL-vscode/blob/master/src/telemetry.ts). @@ -29,21 +31,27 @@ distinct users, ordered by last use date. Some other useful queries: +``` // heaviest users by avg time spent using extcustomEvents | where timestamp < now() and name=="almenon.arepl/closed" | summarize timeOpen=avg(todouble(customDimensions.timeSpent)) by cloud\_RoleInstance | order by timeOpen +``` * * * +``` // most frequent users by number of times openedcustomEvents | where timestamp < now() and name=="almenon.arepl/closed" | summarize numEvents=count(iKey) by cloud\_RoleInstance | order by numEvents +``` * * * You can even project your results into graphs +``` customEvents | where name == 'almenon.arepl/closed' | summarize count() by client\_CountryOrRegion | render piechart +``` diff --git a/lib/convertFromUrl.js b/lib/convertFromUrl.js index 3ef94e9..98873bf 100644 --- a/lib/convertFromUrl.js +++ b/lib/convertFromUrl.js @@ -56,6 +56,13 @@ turndownService.addRule('noHiddenImages', { } }) +turndownService.addRule('code blocks', { + filter: 'pre', + replacement: function (content, node) { + return "```\n" + content + "\n```" + } +}) + // todo: filter out profile header // (right below title, the div with author profile pic and name and time to read article) // unfortunately Medium uses randomly generated CSS properties which makes it hard to