I am trying to add a webfinger file to Jekyll (under .well-known/webfinger) in a markdown file (e.g. webfinger.md with the path in the front-matter).
---
layout: null
permalink: /.well-known/webfinger
---
{
"subject": "acct:blah#blah.com",
"aliases": [
"https://blah.com/#blah",
"https://blah.com/users/blah"
],
"links": [
{
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html",
"href": "https://blah.com/#blah"
},
{
"rel": "self",
"type": "application/activity+json",
"href": "https://blah.com/users/blah"
},
{
"rel": "http://ostatus.org/schema/1.0/subscribe",
"template": "https://mastodon.nz/authorize_interaction?uri={uri}"
}
]
}
I thought that the html would spit out the raw JSON, but it is wrapped with a HTML <p> tag. Is there any way to avoid that?
I've just done the same thing only a few minutes ago. If you change the name of the file to webfinger without the .md extension, then it should work.
I made the change in https://github.com/mgriffin/mikegriffin/pull/51 and you can see the result at https://mikegriffin.ie/.well-known/webfinger but it downloads the file if you visit it through a browser for some reason...
Related
i am trying to create a simple template that has 2 variable in Mediawiki.
variable 1 is the link whatever someone type: file://test.txt
variable 2 is the title: Test Document
The template would generate the hyperlink such as this:
TestDocument
But behind this test document link it has this wiki syntax:
<ext>file://test.txt</ext>
Could someone assist with this?
Here is the sample of wiki syntax i tried testing:
<ext>{{{1}}}|{{{2}}}</ext>
<noinclude>
<ext>{{{1}}}|{{{2}}}</ext>
<noinclude>
<templatedata>
{
"params": {
"1": {
"label": "Link",
"description": "Link",
"type": "string",
"default": "file://test.txt",
"required": true
},
"2": {
"label": "Description:",
"description": "Text",
"type": "string",
"required": true
}
},
"description": "links",
"paramOrder": [
"1",
"2"
]
}
</templatedata>
</noinclude>
If you add $wgUrlProtocols [] = 'file://'; to your LocalSettings.php, you can simply use external link syntax: [{{{1}}} {{{2}}}].
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": "#.*"
}]
}
}
}
I changed the output paths in my semantic.json which is working fine. However I would like the following files to be built in ../../static/css (../../static/js):
semantic.css
semantic.js
semantic.min.css
semantic.min.js
What do I have to change in order to achieve this?
File content:
{
"base": "semantic/",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"packaged": "../static/",
"uncompressed": "../static/components/",
"compressed": "../static/components/",
"themes": "../static/themes/"
},
"clean": "../static/"
},
"permission": false,
"autoInstall": false,
"rtl": false,
"components": [
/* Components come here... */
],
"version": "2.2.13"
}
Changing the output directories in the Semantic.json didn't work for me, but changing it in semantic/tasks/config/defaults.js worked. I don't know why or if that's good, but the files have been created correctly now.
As to your problem with separating CSS and JS:
Here (https://github.com/Semantic-Org/Semantic-UI/issues/2221) it says:
JS and CSS files are not set up to have separate output directories in
the current build system.
As of July 2016 there was no solution yet.
I am unable to filter the following.
I need to find out the count of names starting with "SnapshotSet" which are under the name tag of the below JSON file.
Example - "name": "SnapshotSet.1475076959480"
As a first step I am trying to filter out all the names starting with SnapshotSet...but receiving the following error.
jq '.snapshot-sets[]' testjq
error: sets is not defined
But when I filter out links I am able to get an output
jq '.links[]' testjq
{
"href": "https://test.com/api/json/v2/types/snapshot-sets/",
"rel": "self"
}
Anything to do with the name "snapshot-sets"?
Please find the JSON file below.
{
"links": [
{
"href": "https://test.com/api/json/v2/types/snapshot-sets/",
"rel": "self"
}
],
"snapshot-sets": [
{
"href": "https://test.com/api/json/v2/types/snapshot-sets/1",
"name": "SnapshotSet.1475076959480"
},
{
"href": "https://test.com/api/json/v2/types/snapshot-sets/3",
"name": "SnapshotSet.1475165496304"
},
{
"href": "https://test.com/api/json/v2/types/snapshot-sets/2",
"name": "SnapshotSet.1475158265437"
},
{
"href": "https://test.com/api/json/v2/types/snapshot-sets/63659",
"name": "server1a_b_c_STFS1474869600618"
},
As explained here, the abbreviated form .keyname cannot be used when the key contains the - character.
You can run the following to get the list of all names from your file:
jq '."snapshot-sets"[].name' testjq
I am new to programming and I am trying to learn node.js and CoffeeScript. I have read a few books and watched some screencasts. And now I have started to code. Now I faced my first problem and was not able to solve it with Google. Already lost a few hours and I am stuck. Maybe someone can give me a light.
Here is the problem. I have this json file:
{
"title": "title",
"pages": [
{ "name": "Page1", "url": "#Page1", "class": "class", "template":"templateName" },
{ "name": "Page2", "url": "#Page2", "class": "class", "template":"templateName" },
{ "name": "Page3", "url": "#Page3", "class": "class", "template":"templateName" },
{ "name": "Page4", "url": "#Page4", "class": "class", "template":"templateName" },
{ "name": "Page5", "url": "#Page5", "class": "class", "template":"templateName" }
]
}
and the code to get the json file is
configFile = require(file.json)
If I do
console.log(configFile.pages)
I can get the correct information.
But if I do
console.log(configFile.pages.template[0])
I get an undefined error.
Can anyone give me a hand?
configFile.pages[0].template
it's your structure :)
template is not an array, pages is. So use this:
console.log(configFile.pages[0].template);