Jekyll - Highlighter on Aviator Theme? - jekyll

Im unsure which highlighting system is being used on: https://github.com/CloudCannon/Aviator-Jekyll-Theme
It uses code like:
``` json
[
{
"id": 1,
"title": "The Hunger Games",
"score": 4.5,
"dateAdded": "12/12/2013"
},
{
"id": 1,
"title": "The Hunger Games",
"score": 4.7,
"dateAdded": "15/12/2013"
},
]
```
But code like:
``` c++
```
Doesnt seem to work.
Cant find any CSS or JS references to anything so its confusing me heavily.

Aviator uses the default Jekyll syntax highlighter - Rouge. I haven't tried this but if you use cpp instead of c++ it might work.

Related

JSON changelog file connecting to a bootstrap card element

I'm currently making a change log for a website and was wondering how to connect the changelog.JSON file to my HTML file and subsequently extract it to turn it into the change log you see.
Its a bootstrap .card element...
The JSON file is called changelog.json
[
{
"version": "1.2",
"date": "8 Dec 2022",
"greennote": [
"All note files added!",
"Math homeworks offically available (permisson granted)"
],
"purplenote": [
"Wbebsite ui updated"
]
},
{
"version": "1.0",
"date": "2 Dec 2022",
"greennote": [
"Math Notes Version 1.1 file added",
"Math homeworks offically available (permisson granted)"
],
"purplenote": [
"Wbebsite created"
]
}]
I have tried a few things however im quite the beginner. If you could put me on the right track. Additionally with the greennote there are two elements how do you read this and provide a new check element for each as shown in the screenshot?

Can't get custom configuration points working for my VS Code extension

So I've been spending a lot of time trying to get a couple specific settings working for my language extension in VS Code, and while the documentation and the few articles online seem to make it sound as simple as adding a "configuration" point in my package.json and a "getConfiguration()" call in the extension.ts file, it seems that there is more needed to get them working. This is my first extension I've made so I'm a bit unfamiliar with some of these things.
I am working on this project for work, so I will paste some of my code below with certain edits. The main issue I am getting right now is that it recognizes that I have added the configuration points to the package json, but I get this error when trying to debug the extension:
Cannot register '<configuration_name>'. This property is already registered
I have read as much as I can online about this and it seems that maybe the issue is that VS Code is seeing these settings as already defined and therefore is confused because it may be expecting custom configurations. I'm not sure. I feel though the issue must lie in my extension.ts file since when I look at the configuration example on the VS Code Examples repository on Github, they are doing quite a lot more than just the simple "getConfiguration()" function I am using. But I really have no idea what I would do. I am not very familiar with typescript as of yet, so any help would be greatly appreciated on this. Anyone have any insight as to why it would be doing this?
Here is my package.json:
{
"name": "ex-lang",
"displayName": "Example",
"description": "Example language support",
"version": "0.0.1",
"engines": {
"vscode": "^1.64.2"
},
"categories": [
"Programming Languages",
"Snippets"
],
"contributes": {
"languages": [
{
"id": "ex",
"aliases": [
"EX",
"ex",
"Example"
],
"extensions": [
".ex"
],
"configuration": "./language-configuration.json",
"icon": {
"light": "./icons/icon.png",
"dark": "./icons/icon.png"
}
}
],
"grammars": [
{
"language": "ex",
"scopeName": "source.ex",
"path": "./syntaxes/ex.tmLanguage.json"
}
],
"snippets": [
{
"language": "ex",
"path": "./snippets.json"
}
],
"configuration": [
{
"id": "ex-config",
"title": "Example Custom Settings",
"properties": {
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment.block.documentation.ex"
],
"settings": {
"foreground": "#efc752"
}
}
]
},
"editor.bracketPairColorization.enabled": true,
"workbench.colorCustomizations": {
"editorBracketHighlight.foreground1": "#2b85d5",
"editorBracketHighlight.foreground2": "#559ddd",
"editorBracketHighlight.foreground3": "#80b6e6",
"editorBracketHighlight.foreground4": "#aaceee",
"editorBracketHighlight.foreground5": "#d5e7f7",
"editorBracketHighlight.foreground6": "#c6cad4",
"editorBracketHighlight.unexpectedBracket.foreground": "#db6165"
}
}
}
]
},
"dependencies": {
"vsce": "^2.9.2"
},
"devDependencies": {
"#types/node": "^16.11.7",
"#types/vscode": "^1.40.0",
"#typescript-eslint/eslint-plugin": "^5.19.0",
"#typescript-eslint/parser": "^5.19.0",
"eslint": "^8.13.0",
"typescript": "^4.7.2"
}
}
I have tried messing a bit with Activation Events, but I was getting more issues with it as I suppose I don't understand them as well as I might like. I have also fiddled with different scopes for the configuration points and such but to no avail. And lastly, I did have a "main" contribution point, but I was having very strange pathing issues when I had it (it kept saying the file was not found), so I removed it. Not sure if any of these things are also contributing to my problem or not.
Here is my extension.ts file for reference:
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
vscode.workspace.getConfiguration('ex-config');
}

"crbug/1173575, non-JS module files deprecated" Error in flutter

i created a json file with all the data required for my app, it was working fine but one image was showing error saying that it is from another domain, so i changed the image address to another image, and now it says
crbug/1173575, non-JS module files deprecated
i tried changing it back to the previous image and restarted the application it still shows the error.
{
"id": 1,
"name": "92.7",
"tagline": "on the ground by Rose",
"color": "blue",
"url": "https://upload.wikimedia.org/wikipedia/en/5/51/Google_Chrome_on_Windows_10_screenshot.png" ,
"icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/96px-Google_Chrome_icon_%28September_2014%29.svg.png" ,
"img": "https://preview.redd.it/ls2yuc4501l61.jpg?width=512&auto=webp&s=be785e98bf288f69c0b0105fb2bce6ab807b20f4",
"category": "blackpink",
"disliked": false,
"order": 1
},
{
"id": 2,
"name": "92.7",
"tagline": "blood sweat and tears by BTS",
"color": "blue",
"url":"https://upload.wikimedia.org/wikipedia/en/5/51/Google_Chrome_on_Windows_10_screenshot.png" ,
"icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/96px-Google_Chrome_icon_%28September_2014%29.svg.png",
"img":"https://m.media-amazon.com/images/M/MV5BZTQ3YmU4MjAtYzQ0NC00NjRjLThmMzYtMTE4MzgzMWJkNjliXkEyXkFqcGdeQXVyNDY5MjMyNTg#._V1_.jpg",
"category": "BTS",
"disliked": false,
"order": 2
}
Error was in the first pic, the second was showing fine but after changing it , now it doesnt start the application and shows the error i mentioned above. I'm using google chrome to run the application.
Delete your launch.json file as it is causing your app to not launch with the default configuration of flutter
I encounter the same error in one of my flutter web projects. you have to delete the launch.json file.
Here is path of file
.vscode -> launch.json
just delete launch.json and your project will run.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "Launch Chrome against localhost",
"type": "dart"
}
]
}

Json to Data Frame and Excel with Python

I would like to ask for some help with the conversion of a nested json into pandas df.
I have read the quite brilliant input from a couple of year past, but that is outdated now. :(
Flatten double nested JSON
So here is a sample of my input data (mind that classes might contain up to 10 class name and confidence pairs):
[
{
"classifier_id": "my_classifier_id",
"url": "https://api.eu-de.natural-language-classifier...",
"text": "for sales? aligning obsolete incentive\u00a0 system to what is the standard today: 100% reference salary, 100% of ref sal if you hit 100% of your quota",
"top_class": "conditions",
"classes": [
{
"class_name": "conditions",
"confidence": 0.9074866214536228
},
{
"class_name": "temperature",
"confidence": 0.09251337854637723
}
]
},
{
"classifier_id": "my_classifier_id",
"url": "https://api.eu-de.natural-language-classifier...",
"text": "Complete integration of incentives.\u00a0 People act inline with how they are compensated as the general rule. \u00a0 If we get that right then this model can genuinely change the face of IBM to the client.",
"top_class": "conditions",
"classes": [
{
"class_name": "conditions",
"confidence": 0.9683663322166756
},
{
"class_name": "temperature",
"confidence": 0.0316336677833244
}
]
},
{
"classifier_id": "my_classifier_id",
"url": "https://api.eu-de.natural-language-classifier.watson...",
"text": "Enablement, operational support on the most basic things",
"top_class": "temperature",
"classes": [
{
"class_name": "temperature",
"confidence": 0.8174158442711534
},
{
"class_name": "conditions",
"confidence": 0.1825841557288465
}
]
}
]
What I have tried thus far in python:
data_df = pd.read_json(r'C:\Users\...\Documents\Python NLP\WATSON NLC\OUTPUT JSON\nlc_data_full.json')
When using this the classes still remain in a json like form:
[{'class_name': 'conditions', 'confidence': 0.907486621453622}, {'class_name': 'temperature', 'confidence': 0.092513378546377}]
[{'class_name': 'conditions', 'confidence': 0.9683663322166751}, {'class_name': 'temperature', 'confidence': 0.031633667783324}]
[{'class_name': 'temperature', 'confidence': 0.8174158442711531}, {'class_name': 'conditions', 'confidence': 0.182584155728846}]
I would love to get a format that can be worked on in excel. Thank you for looking into this.
Well I think I managed to figure out what everyone already knew anyways. LOL
So the magic is in the pd.json_normalize function. With the parameters it takes it basically is able to open multinested json files with relative ease.
Also the pandas site has been a good friend as always: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.json_normalize.html
I am calling my dataset: nlc_data = [ .......
Here is a super lightweight solution for cases that do not have such intricate nesting: normie_2 = pd.json_normalize(nlc_data, max_level=0)
This one works for multi nested json files:
result = pd.json_normalize(nlc_data, 'classes', ['text', 'top_class'])
Well I guess I got a lot smarter today. Bare with me ... I just might have another awesome questions tomorrow.
Bye, Levi

Visual Studio Code: Comments not being detected while trying to add support for a new language/filetype

So I am working on a research project that involves using a very specific piece of software that uses its own filetype; XPPAUT using .ode files. To prevent me and my team of not-neuroscientists from ripping our hair out trying to work with this, I decided to write a syntax highlighter for these .ode files.
To start I just wanted to be able to recognize and color linecomments, which are delineated with a #, similar to Python, however when I run the development environment, the comments are not highlighted with the color I set my dev workspace to use, or highlighted at all. I'm very new to this, so any help would be appreciated.
Here is my package.json file
{
"name": "ode",
"displayName": "XPP ODE",
"description": "ODE files to be used with XPP/XPPAUT",
"version": "0.0.1",
"publisher": "wjmccann",
"engines": {
"vscode": "^1.22.0"
},
"categories": [
"Languages"
],
"contributes": {
"languages": [{
"id": "xpp",
"aliases": ["XPP ODE", "XPP", "XPPAUT"],
"extensions": [".ode"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "xpp",
"scopeName": "source.xpp",
"path": "./syntaxes/xpp.tmLanguage.json"
}]
}
}
and the corresponding language-configuration.json
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "#",
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
// symbols that that can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
]
}
The language-configuration.json file defines text patterns used in a variety of standard features of VS Code such as comment toggling as described here.
Syntax highlighting/colouring is via the grammars contribution point in package.json as described here.
Based on your package.jsonyou will need to create a new file at ./syntaxes/xpp.tmLanguage.json with the following content for your comments to be coloured appropriately. The actual colour used will depend on your current theme.
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "xpp",
"scopeName": "source.xpp",
"patterns": [
{
"include": "#comments"
}
],
"repository": {
"comments": {
"patterns": [{
"name": "comment.line.number-sign.xpp",
"match": "#.*"
}]
}
}
}