-
Notifications
You must be signed in to change notification settings - Fork 223
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
Cadl Website #935
Merged
Merged
Cadl Website #935
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
8111285
Cadl website skeleton
timotheeguerin fafc0cc
Remove style.css file: irrelevant to the website.
dtuyishime 243fce2
Add BrowserRouter and routes to pages/containers
dtuyishime d9b4e95
Add global App css for the website.
dtuyishime 9f1522b
Add global css to main.tsx
dtuyishime 11f46bf
Add navigation bar.
dtuyishime e3ff9da
Add navigation bar css
dtuyishime 1ffdbf4
Add footer
dtuyishime fb8d95e
Add footer css
dtuyishime e4e9e2e
Add playground on the website using iframe
dtuyishime d8f8462
Add css for the playground page
dtuyishime e9c186c
Add the landing/ home page for the website
dtuyishime 898b938
Add css for the landing/home page
dtuyishime 262b318
Add empty pages/containers for navabar link routed
dtuyishime f9cd205
Add css for navbar link pages routed
dtuyishime 60e253d
Add index file to access all containes/pages.
dtuyishime 6b7279a
Add index.ts file to access all components
dtuyishime 58b5cab
Add 404 error page for unroute pages.
dtuyishime 4e62c56
Add empty components on for future reuse
dtuyishime 3da3bcb
Remove unnecessary div.
dtuyishime 30716a4
Add fluentui/ web-component and other packages.
dtuyishime bd38979
Add the launch.json file
dtuyishime 81f150f
Add rush formatting.
dtuyishime 65956ba
Add rush formatting
dtuyishime 4d517c5
ADD fluentUI web-compnonent and routing packages
dtuyishime 806b422
Disable strictPeerDependencies
dtuyishime 99273cb
add openapi-output
dtuyishime 5fd65bf
Remove vite server and React site code.
dtuyishime 7beaa4c
Eleventy setup files
dtuyishime 7aa53e5
Add css files for all containers and all partials.
dtuyishime e680720
Add Tutorials container/section
dtuyishime 6fccb0c
Add playground container/ section
dtuyishime 920ba09
Add download section/page for installing cadl and getting started
dtuyishime 07e952c
Add docs page for the language documentation
dtuyishime f9f9a69
Add community page/container
dtuyishime 99f597a
Add blog page for future reference
dtuyishime 9619c8c
Add base container for the home page and most pages.
dtuyishime 0b9f3bf
Add contianer layout for containers such playground., tutorial and ot…
dtuyishime a0c4e42
Add tutorials layouts for tutorial page and for future use.
dtuyishime f50c163
Add footer for the website
dtuyishime 80132a1
Add Navbar for the website
dtuyishime fc54b35
Add navbar items from _data as a json file.
dtuyishime 0e0ea5a
Add main web entry point.
dtuyishime 6f35b24
Add the compiled output from eleventy containers, partials, and layouts.
dtuyishime f35a933
Remove output file and adding _website folder to gitignore
dtuyishime 4c03dcd
Add _website to gitignore.
dtuyishime 8c57c93
Cadl website basic scaffolding (#806)
dtuyishime 381f93b
Merge branch 'microsoft:cadl-website' into cadl-website
dtuyishime a68cb68
Run rush format to solve formatting issues
dtuyishime f0d7f53
Merge branch 'cadl-website' of https://github.com/dtuyishime/cadl int…
dtuyishime baa743e
Remove unused dependencies and update rush
dtuyishime 0415ffc
Running git pull upstream main
dtuyishime 0d47a7f
update Rush
dtuyishime 8ef4610
Merge branch 'main' of https://github.com/microsoft/cadl into cadl-we…
dtuyishime ecdd961
Merging the remaining file.
dtuyishime e7af60a
.
dtuyishime ab17e6b
Downgrade node-fetch to 3.2.8
dtuyishime 148ab69
Correct the formating issue using rush format
dtuyishime dc63bc6
Run rush change
dtuyishime b3047da
Merge branch 'main' of https://github.com/microsoft/cadl into cadl-we…
dtuyishime ebcb7a7
Update pnpm-lock file to the latest playground version
dtuyishime bc1f962
Update rush.json
dtuyishime c245a77
Remove cadl-website json file
dtuyishime 123fb43
Merge branch 'cadl-website' of https://github.com/dtuyishime/cadl int…
dtuyishime 1355bfa
Merge branch 'main' into cadl-website
markcowl 83cade3
Merge branch 'main' into cadl-website
dtuyishime d7501fa
Add Cadl documentation to be edited online to make editing easier.
dtuyishime ae5e9a5
Merge branch 'cadl-website' of https://github.com/dtuyishime/cadl int…
dtuyishime b060eb0
Update Readme from the GitHub online for editing purpose
dtuyishime ac6a9f3
Run rush format to get rid of formating errors.
dtuyishime 9ee58d6
Remove unnecessary steps.
dtuyishime 2dcd433
Resolve rush formatting issue
dtuyishime 1003882
Merge branch 'main' into cadl-website
dtuyishime 11839cd
Add build for production command.
dtuyishime 4ca3c98
Merge branch 'cadl-website' of https://github.com/dtuyishime/cadl int…
dtuyishime 5d44eec
Merge branch 'main' of https://github.com/Microsoft/cadl into cadl-we…
timotheeguerin 983d014
reoganize
timotheeguerin aaa6cad
Cleanup
timotheeguerin 0fa0fc0
Cadl syntax highlighitn
timotheeguerin 502b9d3
Style tweak
timotheeguerin 99e7222
Import docs showcasing syntax highlighting
timotheeguerin d2cd95a
Merge with main
timotheeguerin 30631a4
try website
timotheeguerin 3a6d1ca
can't make jsonc work with 11ty
timotheeguerin 4f3814d
format
timotheeguerin 46a6eff
PUsh website
timotheeguerin d72fb25
.
timotheeguerin 01feac6
Css needs to be out of input dir
timotheeguerin e404897
Tweaks
timotheeguerin 8d1260a
Tweaks
timotheeguerin 16d4bc0
Merge with main
timotheeguerin 3070e23
Home use url filter
timotheeguerin 37c44b8
Improve smaller screen style for docs
timotheeguerin 7b53367
Format
timotheeguerin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can use the tmlanguage somehow? Seems annoying to have another set of regexes to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, yeah..., I did look if there was an existing way to auto convert it but doesn't seem like there is. Felt more work to get this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More work for sure, but I imagine we could convert to html as bicep does for its tests: https://github.com/Azure/bicep/blob/main/src/textmate/test/baselines/comments.html
And do that on publish?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe file an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh you mean we are the one doing the syntax highlighting instead of using the extension(via PrismJs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? Just brainstorming here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue #938
This was the PR that added bicep to PrismJS, where they seemed to have manually intepreted the tmlanguage and wrong a simple primsjs language
PrismJS/prism#3027