Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unibit 🎉 #2141

Merged
merged 5 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"@babel/preset-env": "^7.4.2",
"@cerebral/http": "^4.0.0",
"@cerebral/mobx-state-tree": "^3.0.0",
"@codesandbox/template-icons": "^0.3.0",
"@codesandbox/template-icons": "^0.4.0",
Saeris marked this conversation as resolved.
Show resolved Hide resolved
"@emmetio/codemirror-plugin": "^0.3.5",
"@svgr/core": "^2.4.1",
"@vue/babel-preset-app": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/tsconfig.check.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
"exclude": ["codesandbox-browserfs/*", "overmind/*"],
"exclude": ["codesandbox-browserfs/*", "src/app/overmind/*"],
"compilerOptions": {
"allowJs": false
}
Expand Down
4 changes: 4 additions & 0 deletions packages/common/src/templates/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
SapperIcon,
ParcelIcon,
VuePressIcon,
StackbitIcon,
Saeris marked this conversation as resolved.
Show resolved Hide resolved
} from '@codesandbox/template-icons';

import {
Expand Down Expand Up @@ -53,6 +54,7 @@ import {
vuepress,
mdxDeck,
quasar,
unibit,
} from './';

import { TemplateType } from './';
Expand Down Expand Up @@ -118,6 +120,8 @@ export default function getIcon(theme: TemplateType): ReturnedIcon {
return MDXDeckIcon;
case quasar.name:
return QuasarIcon;
case unibit.name:
return StackbitIcon;
Saeris marked this conversation as resolved.
Show resolved Hide resolved
default:
return ReactIcon;
}
Expand Down
9 changes: 7 additions & 2 deletions packages/common/src/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import gridsome from './gridsome';
import vuepress from './vuepress';
import mdxDeck from './mdx-deck';
import quasar from './quasar';
import unibit from './unibit';

export {
adonis,
Expand Down Expand Up @@ -55,7 +56,8 @@ export {
gridsome,
vuepress,
mdxDeck,
quasar
quasar,
unibit,
};

export type TemplateType =
Expand All @@ -82,7 +84,8 @@ export type TemplateType =
| 'gridsome'
| 'vuepress'
| 'mdx-deck'
| 'quasar';
| 'quasar'
| 'unibit';

export default function getDefinition(theme: TemplateType) {
switch (theme) {
Expand Down Expand Up @@ -142,6 +145,8 @@ export default function getDefinition(theme: TemplateType) {
return vuepress;
case quasar.name:
return quasar;
case unibit.name:
return unibit;
default:
return react;
}
Expand Down
19 changes: 19 additions & 0 deletions packages/common/src/templates/unibit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Template from './template';
import { decorateSelector } from '../theme';

export default new Template(
'unibit',
'Unibit',
'https://www.stackbit.com',
'github/stackbithq/stackbit-theme-universal/tree/master/',
decorateSelector(() => '#3EB0FD'),
{
distDir: 'public',
isServer: true,
popular: true,
mainFile: ['README.md'],
showOnHomePage: true,
main: false,
showCube: false,
}
);

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Language="en-US" Id="nunjucks" Version="0.2.3" Publisher="ronnidc"/>
<DisplayName>Nunjucks</DisplayName>
<Description xml:space="preserve">A Nunjucks syntax definition</Description>
<Tags>nunjucks,Nunjucks,__ext_.nunjucks,__ext_.nunjs,__ext_.nunj,__ext_.nj,__ext_.njk,__ext_.html,__ext_.htm,__ext_template,__ext_.tmpl,__ext_.tpl</Tags>
<Categories>Languages</Categories>
<GalleryFlags>Public</GalleryFlags>
<Badges></Badges>
<Properties>

<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/ronnidc/vscode-nunjucks" />
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/ronnidc/vscode-nunjucks" />

<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/ronnidc/vscode-nunjucks" />


<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/ronnidc/vscode-nunjucks/issues" />

<Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="#203510" />
<Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="dark" />
</Properties>

<Icon>extension/images/nunjucksIcon.png</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
</Installation>
<Dependencies/>
<Assets>
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/images/nunjucksIcon.png" Addressable="true" />
</Assets>
</PackageManifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Nunjucks for Visual Studio Code
Nunjucks template syntax definition specifically for **Microsoft Visual Studio Code**.

```
>ext install extension nunjucks
```
## vscode-nunjucks support these file extensions
```
.nunjucks, .nunjs, .nj, .njk, .html, .htm, .template, .tmpl, .tpl
```

### Although you are free to use any file extension you wish for your Nunjucks template files, the Nunjucks community has adopted `.njk`
<br />
<br />

## Install Nunjucks from Visual Studio Code *(recomended method)*
To install the [Nunjucks extension](https://marketplace.visualstudio.com/items/ronnidc.nunjucks) directly from Visual Studio Code you need to proceed with theese four simple steps:

1. Go to *View > Command Palette* (Mac OSX: `cmd+shift+P`, Windows: `ctrl+shift+P`)
2. Run the following command in the Command Palette field: `>ext install extension` and hit enter.
3. Then type `nunjucks` and hit enter.
4. After instalation is complete restart the Code app and you are all set up for start writing Nunjucks templates in Visual Studio Code.

![Install the Nunjucks extension from Code Command Palette](https://github.com/ronnidc/vscode-nunjucks/raw/master/images/vscode-command-palette-nunjucks.png)

## Or install the Nunjucks extension for Visual Studio Code manually
To install Nunjucks manually for Visual Studio Code you need to proceed with theese five steps:

1. Download this [vscode-nunjucks](https://github.com/ronnidc/vscode-nunjucks) repo from GitHub
2. Navigate to the `<user home>/.vscode/extensions` directory on your computer.
3. Create a new folder and name it `nunjucks`
4. Copy all content of this repository into the `<user home>/.vscode/extensions/nunjucks` directory.
5. Restart the Code app and you are all set up for start writing Nunjucks templates in Code.

![Nunjucks example in Code](https://github.com/ronnidc/vscode-nunjucks/raw/master/images/vscode-nunjucks.png)

## What's in the folder
* This folder contains all of the files necessary for the vscode-nunjucks extension
* `package.json` - this is the manifest file in which the language support is declared and the location of the grammar file that has been copied into the extension is defined.
* `syntaxes/nunjucks.tmLanguage` - this is the Text mate grammar file that is used for tokenization
* `nunjucks.configuration.json` - this the language configuration, defining the tokens that are used for comments and brackets.

### For more information
* [Visual Studio Code Docs](https://code.visualstudio.com/docs)
* [Nunjucks by Mozilla](https://mozilla.github.io/nunjucks/)

### Credits
This extension is based on the [Sublime-nunjucks](https://github.com/mogga/sublime-nunjucks) language file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
//"lineComment": "{#",
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
"blockComment": [ "{#", "#}" ]
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "nunjucks",
"displayName": "Nunjucks",
"description": "A Nunjucks syntax definition",
"icon": "images/nunjucksIcon.png",
"repository": {
"type": "git",
"url": "https://github.com/ronnidc/vscode-nunjucks"
},
"galleryBanner": {
"color": "#203510",
"theme": "dark"
},
"bugs": {
"url": "https://github.com/ronnidc/vscode-nunjucks/issues"
},
"version": "0.2.3",
"publisher": "ronnidc",
"engines": {
"vscode": "^0.10.1"
},
"categories": [
"Languages"
],
"contributes": {
"languages": [
{
"id": "nunjucks",
"aliases": [
"Nunjucks",
"nunjucks"
],
"extensions": [
".nunjucks",
".nunjs",
".nunj",
".nj",
".njk",
".html",
".htm",
"template",
".tmpl",
".tpl"
],
"configuration": "./nunjucks.configuration.json"
}
],
"grammars": [
{
"language": "nunjucks",
"scopeName": "text.html.nunjucks",
"path": "./syntaxes/nunjucks.tmLanguage"
}
]
},
"__metadata": {
"id": "2a3e1925-d174-4cd7-baa7-3e13824d68c7",
"publisherId": "4ac833f3-e61a-47fc-ae7d-c14a86f2ca03",
"publisherDisplayName": "ronnidc"
}
}
Loading