Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e29ad9
commit 057c124
Showing
34 changed files
with
2,392 additions
and
232 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// @ts-check | ||
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); | ||
const syntaxhighlightPlugin = require("@11ty/eleventy-plugin-syntaxhighlight"); | ||
const cadlPrismDefinition = require("./cadl-prism-lang.js"); | ||
|
||
const prNumber = process.env["SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"]; | ||
|
||
module.exports = (eleventyConfig) => { | ||
eleventyConfig.addPassthroughCopy("css"); | ||
eleventyConfig.addPassthroughCopy({ | ||
"node_modules/prism-themes/themes/prism-one-light.css": "css/themes/prism-one-light.css", | ||
}); | ||
|
||
eleventyConfig.addPlugin(eleventyNavigationPlugin); | ||
eleventyConfig.addPlugin(syntaxhighlightPlugin, { | ||
init: ({ Prism }) => { | ||
Prism.languages.cadl = cadlPrismDefinition; | ||
}, | ||
}); | ||
|
||
return { | ||
markdownTemplateEngine: "njk", | ||
dataTemplateEngine: "njk", | ||
htmlTemplateEngine: "njk", | ||
dir: { | ||
input: "src", | ||
output: "dist", | ||
}, | ||
pathPrefix: prNumber ? `/prs/${prNumber}/` : "/", | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#ignore output folder | ||
/_website |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Cadl Website using 11Ty Static Website Generator | ||
|
||
This repo contains the code for static web generator for Cadl project using Eleventy(11ty) static web generator. To get started with 11Ty visit https://www.11ty.dev. | ||
|
||
Support libraries that enable the demo features are in the `packages/` directory. The demo code itself is in the `website/` directory. | ||
|
||
## Instructions for editing or contributing to this website | ||
|
||
### Running the website | ||
|
||
To get started with the webiste, run the following npm commands | ||
|
||
To build for production: | ||
|
||
```bash | ||
> npm run build | ||
``` | ||
|
||
To run the site on the local server | ||
|
||
```bash | ||
> npm start | ||
``` | ||
|
||
(Be careful, after starting the server, do not close it while building on the existing code. The server will help you while debugging as it shows any changes that is causing trouble in the code.) | ||
|
||
### Adding an item on the navigation bar. | ||
|
||
Items on the navigation bar are stored and maintained from the navbar.json file. To add or remove an item from the navigation bar, change the json from navbar.json. Check out where to find navbar.json file. | ||
|
||
`.src/_data/navbar.json` | ||
|
||
### Creating a new layout | ||
|
||
There are some basic layout already developed in this repo. Check out some layouts, which are found in `.scr/_includes/layouts/`. | ||
|
||
> The `Base.njk` layout is the main layout that includes the navigation bar, and body content(empty content to be altered later) and the footer. | ||
> The "container.njk" layout has the exact same content as the base layout, except that it designed for the container files that are not already included in the template folder `(/_include)` | ||
> The `continer.njk` layout uses the container layout and create the layout for tutorial page/ container of the website. | ||
To create a new layout, add a new file in the \_include folder, and build from existing layouts or create whole new layout. | ||
|
||
### Adding pictures or other folders to the source folder. | ||
|
||
Checkout the file `.eleventy.js` in the source folder `.src/`. After creating the desired folders in the src folder, add the following line the file. | ||
|
||
```bash | ||
module.exports = (eleventyConfig) => { | ||
eleventyConfig.addPassthroughCopy("folderName"); //change folderName with the name of your folder | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
module.exports = { | ||
comment: [ | ||
{ | ||
// multiline comments eg /* ASDF */ | ||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, | ||
lookbehind: true, | ||
greedy: true, | ||
}, | ||
{ | ||
// singleline comments eg // ASDF | ||
pattern: /(^|[^\\:])\/\/.*/, | ||
lookbehind: true, | ||
greedy: true, | ||
}, | ||
], | ||
|
||
directives: { pattern: /#.*/g, greedy: true, alias: "comment" }, | ||
|
||
decorator: { | ||
pattern: /@[$\w\xA0-\uFFFF]+/, | ||
inside: { | ||
at: { | ||
pattern: /^@/, | ||
alias: "operator", | ||
}, | ||
function: /^[\s\S]+/, | ||
}, | ||
}, | ||
|
||
property: { | ||
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, | ||
lookbehind: true, | ||
alias: "property", | ||
}, | ||
|
||
string: [ | ||
{ | ||
pattern: /"""[^"][\s\S]*?"""/, | ||
greedy: true, | ||
}, | ||
{ | ||
pattern: /(^|[^\\"])"(?:\\.|\$(?!\{)|[^"\\\r\n$])*"/, | ||
lookbehind: true, | ||
greedy: true, | ||
}, | ||
], | ||
|
||
boolean: /\b(?:false|true)\b/, | ||
keyword: | ||
/\b(?:import|model|namespace|op|interface|union|using|is|extends|enum|alias|return|void|never|if|else|projection)\b/, | ||
|
||
function: /\b[a-z_]\w*(?=[ \t]*\()/i, | ||
|
||
number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, | ||
operator: | ||
/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/, | ||
punctuation: /[{}[\];(),.:]/, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.cadl-doc-container { | ||
display: flex; | ||
} | ||
|
||
.cadl-doc-container > .cadl-doc-nav { | ||
flex: 0 0 200px; | ||
border-right: 1px solid #f3f3f3; | ||
} | ||
|
||
.cadl-doc-container > .cadl-doc-content { | ||
flex: 1 auto; | ||
min-width: 0; | ||
max-width: 100%; | ||
margin: 0 24px; | ||
} | ||
|
||
.cadl-doc-toc ul { | ||
padding-left: 10px; | ||
} | ||
|
||
.cadl-doc-toc ul li { | ||
list-style-type: none; | ||
padding: 0; | ||
} | ||
|
||
.cadl-doc-toc ul li a { | ||
border: none; | ||
padding: 6px 0; | ||
transition: color 0.3s; | ||
color: #717171; | ||
} | ||
|
||
.cadl-doc-toc ul li a:hover { | ||
color: var(--main-color); | ||
} | ||
|
||
.cadl-doc-toc ul li.cadl-toc-active > a { | ||
color: var(--main-color); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
footer { | ||
text-align: center; | ||
color: #717171; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: var(--font-family); | ||
color: var(--text-color); | ||
overflow: auto; | ||
} | ||
|
||
.app_version { | ||
background: var(--version_bar-color); | ||
color: var(--text-in-main-color); | ||
text-align: center; | ||
} | ||
|
||
html { | ||
height: 100%; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
text-decoration-line: none; | ||
text-decoration-thickness: initial; | ||
text-decoration-style: initial; | ||
text-decoration-color: initial; | ||
color: #1064a8; | ||
} | ||
|
||
a:hover { | ||
color: var(--main-color); | ||
} | ||
|
||
code { | ||
background-color: hsl(230, 1%, 98%); | ||
border-radius: 3px; | ||
color: inherit; | ||
font-family: SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace; | ||
font-size: 85%; | ||
margin: 0; | ||
padding: 3.2px 6.4px; | ||
} | ||
|
||
pre { | ||
padding: 16px; | ||
border-radius: 3px; | ||
background-color: hsl(230, 1%, 98%); | ||
} | ||
pre > code { | ||
display: block; | ||
} | ||
|
||
/* Extra small devices (phones, 600px and down) */ | ||
|
||
@media only screen and (max-width: 600px) { | ||
} | ||
|
||
/* Small devices (portrait tablets and large phones, 600px and up) */ | ||
|
||
@media only screen and (min-width: 600px) { | ||
} | ||
|
||
/* Medium devices (landscape tablets, 768px and up) */ | ||
|
||
@media only screen and (min-width: 768px) { | ||
} | ||
|
||
/* Large devices (laptops/desktops, 992px and up) */ | ||
|
||
@media only screen and (min-width: 992px) { | ||
} | ||
|
||
/* Extra large devices (large laptops and desktops, 1200px and up) */ | ||
|
||
@media only screen and (min-width: 1200px) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.root-container { | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
} | ||
|
||
main { | ||
flex-grow: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.main-content { | ||
margin: 0 auto; | ||
max-width: 1024px; | ||
padding: 0.5rem 1.5rem; | ||
} |
Oops, something went wrong.