feat: add documentation by docusaurus (#1175)
* add initial configuration for docusaurus * add missing files * update to included edits from prior PR markdown files * updated primary theme color * remove docker support * update docusaurus configuration for working with gh-pages * remove creating branches * update to rename doing to working * update to remove duplicate content * update per PR feedback * update to move browser under testing * remove prereq's * remove localization for regions * update to fix section heading * update to remove unnecessary content * update to remove all boilerplate and edit content per pr
This commit is contained in:
Родитель
6e993b2769
Коммит
75dbbdb9ee
|
@ -79,4 +79,14 @@ www/
|
|||
.tmp/
|
||||
|
||||
# npm package-locks
|
||||
package-lock.json
|
||||
package-lock.json
|
||||
|
||||
# Docusaurus dependencies
|
||||
lib/core/metadata.js
|
||||
lib/core/MetadataBlog.js
|
||||
|
||||
website/translated_docs
|
||||
website/build/
|
||||
website/yarn.lock
|
||||
website/node_modules
|
||||
website/i18n/*
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
id: install
|
||||
title: Contributing
|
||||
sidebar_label: Install
|
||||
---
|
||||
|
||||
# Install
|
||||
|
||||
## Setup the source repository
|
||||
|
||||
Clone the repository, `cd` into the project, install [Lerna](https://github.com/lerna/lerna) and install dependencies.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/Microsoft/fast-dna.git
|
||||
cd fast-dna
|
||||
npm i --global lerna@3.3.0
|
||||
npm i
|
||||
```
|
||||
|
||||
Install all Lerna dependencies:
|
||||
|
||||
```shell
|
||||
lerna bootstrap
|
||||
```
|
||||
|
||||
- `npm run tslint` or `npm run tslint:fix` runs tslint on all typescript in the project.
|
||||
- `npm run unit-tests` runs all unit-tests.
|
||||
- `npm run test` runs all processes required to pass prior to check-in. Generally includes building, linting, and unit-testing.
|
||||
|
||||
To run these processes across *all* projects, substitute `npm` for `lerna`.
|
||||
|
||||
```shell
|
||||
lerna run test
|
||||
```
|
||||
|
||||
## Understanding packages
|
||||
|
||||
All packages can be found [here](https://github.com/Microsoft/fast-dna/tree/master/packages). Each package includes a `README.md` file at the root that describes how the package can be used.
|
||||
|
||||
## Dependencies
|
||||
|
||||
Dependencies are purposely limited to simplify the upgrade cycle. Due to the constantly changing nature of web technologies, it’s imperative to update more frequently with less friction and without customer impact.
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: policies
|
||||
title: Contributing
|
||||
sidebar_label: Policies
|
||||
---
|
||||
|
||||
# Policies
|
||||
|
||||
* [Licensing](https://github.com/Microsoft/fast-dna/blob/master/LICENSE)
|
||||
* [Contributions](https://github.com/Microsoft/fast-dna/blob/master/CONTRIBUTING.md)
|
||||
* [Code of Conduct](https://github.com/Microsoft/fast-dna/blob/master/CODE_OF_CONDUCT.md)
|
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
id: standards
|
||||
title: Contributing
|
||||
sidebar_label: Standards
|
||||
---
|
||||
|
||||
# Standards
|
||||
|
||||
The following standards are used by FAST-DNA contributors for consistency across this repository.
|
||||
|
||||
## Naming Conventions
|
||||
|
||||
* Avoid all abbreviations, except where common industry acronyms.
|
||||
* Use names that are clear and intuitive.
|
||||
* Use semantic names instead of presentational.
|
||||
|
||||
## Accessibility
|
||||
|
||||
FAST-DNA works diligently from the ground up to enable accessibility in collaboration with legal, accessibility, and marketing teams. As an ecosystem to accelerate the building of website's and apps we ensure you have the tools to build accessible user exerpiences.
|
||||
|
||||
### Animation
|
||||
|
||||
* End users should have a mechanism to reduce or remove animations from their experience. The Safari devs have proposed a media query for reduced animation. ("prefers-reduced-motion").
|
||||
* Some users with vestibular disorders or other cognitive disabilities have problems with movement. A safe fallback for nearly all users is fade animations.
|
||||
* Flashing animations can cause seizures and should be avoided.
|
||||
|
||||
## JSS (JavaScript Style Sheets) usage
|
||||
|
||||
JSS class name contracts follow a [BEM-like](http://getbem.com/naming/) convention.
|
||||
|
||||
BEM for FAST-DNA is slightly modified because dashes (the character used to delimit *modifiers*) cannot be used as JavaScript object keys without using string literals. So, underscores are used instead. A single underscore separates an element from a block while two underscores separate a modifier from a block or element.
|
||||
|
||||
FAST-DNA example
|
||||
|
||||
```html
|
||||
block_element__modifier
|
||||
```
|
||||
|
||||
Within a block, element, or modifier, words should be camelCased
|
||||
|
||||
```html
|
||||
anotherBlock_anotherElement__anotherModifier
|
||||
```
|
|
@ -0,0 +1,141 @@
|
|||
---
|
||||
id: testing
|
||||
title: Contributing
|
||||
sidebar_label: Testing
|
||||
---
|
||||
|
||||
# Testing
|
||||
|
||||
When building Web sites and apps on FAST-DNA it's recommended to perform exhaustive testing to instill the confidence that you've met your customers' expectations. The checklist below was compiled over the last few years and is a good starting point for manual testing Web applications.
|
||||
|
||||
## Checklist
|
||||
|
||||
1. Test each page for design and content issues
|
||||
1. Test screen sizes from viewport 1 to 6
|
||||
2. Test screen orientations
|
||||
1. Portrait
|
||||
2. Landscape
|
||||
3. Test word length and case
|
||||
1. Test smallest amount of text
|
||||
2. Test largest amount of text
|
||||
3. Case sensitivity
|
||||
2. Test for localization (RTL, LTR)
|
||||
3. Test for progressive enhancement
|
||||
1. Test complete browser matrix
|
||||
2. Test for zooming browser from 200% and 25%
|
||||
4. Test each component and pages for accessibility issues
|
||||
1. Test for keyboard accessibility
|
||||
2. Test for Mouse only interaction
|
||||
3. Test for Touch interaction
|
||||
4. Test with High Contrast of OS
|
||||
5. Test without images
|
||||
6. Test for text only
|
||||
7. Test with a screen reader
|
||||
|
||||
## Manual testing
|
||||
|
||||
There is a [FAST-DNA documentation site for MSFT Components](https://msft-docs.fast-dna.net) that includes built in developer and testing tools to manually test.
|
||||
|
||||
Additionally, there are services included in FAST-DNA under `./build/testing` that can be used to assist in comprehensive testing. The configuration and tests are included as a starting point and as functional and UI testing matures these may become part of the CI/CD pipeline. As of now, these can be run manually and the cloud services dashboard can be used to evaluate your code changes prior to submitting for code review.
|
||||
|
||||
For those interested in using these services contact the project maintainers on discord to gain access.
|
||||
|
||||
### Testing on physical devices
|
||||
|
||||
Testing local development code on physical devices in hand.
|
||||
|
||||
Localtunnel allows you to easily share a web service on your local development machine without messing with DNS and firewall settings.
|
||||
|
||||
Localtunnel will assign you a unique publicly accessible URL that will proxy all requests to your locally running web server.
|
||||
|
||||
Quickstart
|
||||
|
||||
+ Install Localtunnel globally (requires NodeJS).
|
||||
|
||||
```bash
|
||||
npm install -g localtunnel
|
||||
```
|
||||
|
||||
+ Start a web server on a local port (eg: http://localhost:8000) and use the command line interface to request a tunnel to the local server.
|
||||
|
||||
```bash
|
||||
lt --port 8000
|
||||
```
|
||||
|
||||
+ You will receive a URL, for example https://gqgh.localtunnel.me, that you can share with anyone for as long as your local instance remains active. Any requests will be routed to your local service at the specified port.
|
||||
|
||||
### Testing with Sauce Labs
|
||||
|
||||
[Sauce Labs](https://saucelabs.com/beta/dashboard/builds) allows collaborators and contributors to execute automated tests against Selenium WebDriver on pre-configured browser matrix's.
|
||||
|
||||
The cross browser testing strategy focuses on the differences between browser rendering engines. There are three different [configuration files](https://github.com/Microsoft/fast-dna/tree/master/build/testing) based on feature maturity of ongoing work.
|
||||
|
||||
[Alpha](https://github.com/Microsoft/fast-dna/blob/master/build/testing/config-browsers.alpha.js) Immature feature development
|
||||
|
||||
```bash
|
||||
node build/testing/sauce-labs/test-browsers.js alpha
|
||||
```
|
||||
|
||||
[Beta](https://github.com/Microsoft/fast-dna/blob/master/build/testing/config-browsers.beta.js) Stable feature development
|
||||
|
||||
```bash
|
||||
node build/testing/sauce-labs/test-browsers.js beta
|
||||
```
|
||||
|
||||
[Release](https://github.com/Microsoft/fast-dna/blob/master/build/testing/config-browsers.release.js) Mature feature development
|
||||
|
||||
```bash
|
||||
node build/testing/sauce-labs/test-browsers.js release
|
||||
```
|
||||
|
||||
### Testing with Applitools
|
||||
|
||||
[Applitools](https://eyes.applitools.com/) can be used to visual regression test UI changes on your own branches allow to execute automated tests against Selenium WebDriver. Currently, ChromeDriver and FirefoxDriver are supported.
|
||||
|
||||
Prior to making any UI changes on a new branch, it's recommended to initially run Applitools to create a baseline set of images.
|
||||
|
||||
1. The first time the test is executed on a new branch, screenshots are created as 'undefined' status.
|
||||
2. After the tests finish users should select all checkbox's and choose to save to generate the baseline image.
|
||||
3. Next perform UI code changes.
|
||||
4. Rerun the first set of tests and for all snapshots that match the baseline - they will turn green and show as 'passed' status. Any 'undefined' status would be additional UI changes added. Though to get into this scenario new test cases would be required in the `./run-msft-docs.js` file. Any anomalies will be marked red as 'failed' status.
|
||||
5. Manually review all UI changes and if the changes are desired, select and choose to save the new baseline. Anything else should be changed and retested.
|
||||
|
||||
```bash
|
||||
node build/testing/applitools/test-javascript.js
|
||||
```
|
||||
|
||||
#### Visual Regression testing with Cypress SDK
|
||||
|
||||
Contributors can perform functional user interface and experience testing using [Cypress](https://www.cypress.io/).
|
||||
|
||||
To validate Cypress is configured correctly.
|
||||
|
||||
```bash
|
||||
npm run ui-tests:verify
|
||||
```
|
||||
|
||||
Execute through Electron for real-time user interaction and debugging.
|
||||
|
||||
```bash
|
||||
npm run ui-tests:open
|
||||
```
|
||||
|
||||
Execute using the CLI.
|
||||
|
||||
```bash
|
||||
npm run ui-tests:run
|
||||
```
|
||||
|
||||
_When running as CLI, the results can be viewed as printed out to the command screen or in the cloud dashboard._
|
||||
|
||||
## Cross browser testing
|
||||
|
||||
You can read more from [Mozilla](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Introduction) on cross browser testing and processes.
|
||||
|
||||
Click on the links below to report browser bugs.
|
||||
|
||||
+ [Edge](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/)
|
||||
+ [Firefox](https://bugzilla.mozilla.org/)
|
||||
+ [Safari](https://bugs.webkit.org/)
|
||||
+ [Chrome](https://bugs.chromium.org/p/chromium/issues/list)
|
||||
+ [Opera](https://bugs.opera.com/wizard/desktop)
|
|
@ -0,0 +1,110 @@
|
|||
---
|
||||
id: working
|
||||
title: Contributing
|
||||
sidebar_label: Working
|
||||
---
|
||||
|
||||
# Working
|
||||
|
||||
## Managing Issues
|
||||
|
||||
Well crafted issues improve the speed that work can be triaged, understood, and completed. To help guide this process [issue templates](https://github.com/Microsoft/fast-dna/tree/master/.github/ISSUE_TEMPLATE) exist to allow users to choose an appropriate [bug report](https://github.com/Microsoft/fast-dna/blob/master/.github/ISSUE_TEMPLATE/Bug_report.md), [feature request](https://github.com/Microsoft/fast-dna/blob/master/.github/ISSUE_TEMPLATE/Feature_request.md), or [custom template](https://github.com/Microsoft/fast-dna/blob/master/.github/ISSUE_TEMPLATE/Custom.md).
|
||||
|
||||
Here's a good resource for [Do's and Don'ts](https://hackernoon.com/45-github-issues-dos-and-donts-dfec9ab4b612) when working with bugs, issues, and requests.
|
||||
|
||||
[GitHub Labels](https://developer.github.com/v3/issues/labels/) are used to manage issues broadly considered work items grouped by color and prefixed by label name.
|
||||
|
||||
## Pull requests
|
||||
|
||||
When landing a pull request (PR), individuals must modify the original commit message to include comprehensive details. This detail along with other git history meta information deploys as part of the documentation changelog history. Changlogs are generated by [Lerna](https://lernajs.io/) using [Conventional commits](https://conventionalcommits.org/).
|
||||
|
||||
PR comments should include the issue number per the [github closing issue keywords](https://help.github.com/articles/closing-issues-using-keywords/) documentation.
|
||||
|
||||
One or more collaborators will automatically be assigned to review each PR based on areas of [ownership](https://github.com/Microsoft/fast-dna/blob/master/.github/CODEOWNERS).
|
||||
|
||||
**`<type>`** is required to be at least one of the following:
|
||||
|
||||
- chore: A change that does not impact distributed packages
|
||||
- feat: Adding, updating, or removing a feature
|
||||
- fix: A bug fix.
|
||||
|
||||
**`<description>`** is required and speaks to what the user gets from this PR:
|
||||
|
||||
- Be concise
|
||||
- Use lowercase
|
||||
- Use imperative, present tense (e.g. `add` not `adds`)
|
||||
- Do not end with a period. Period.
|
||||
- Avoid redundant words
|
||||
|
||||
Accepted title format
|
||||
|
||||
```comment
|
||||
<type>: <description>
|
||||
```
|
||||
|
||||
Example titles
|
||||
|
||||
```comment
|
||||
feat: add a border radius to MSFT button
|
||||
chore: add unit-tests for all components
|
||||
fix: update MSFT design system to use 3px border radius
|
||||
```
|
||||
|
||||
### Formatting messages
|
||||
|
||||
Optionally, include more detail in the message.
|
||||
|
||||
`<body>` is used to provide clarity and context to the description.
|
||||
|
||||
`<footer>` is used to provide additional metadata about the pull request such as issue fixing (fix #19, close #19, resolve #19). Additionally, is used to denote [breaking changes](https://www.conventionalcommits.org/en/v1.0.0-beta.2/#specification).
|
||||
|
||||
### Interim commits
|
||||
|
||||
The above outlines the format for the **final** commit, but contributors will have many interim commits while working on their branch. These commits should be succinct, concise, and consistent for best readability. Always remember, a diff will tell you _what_ changed in a commit, but only the commit message can properly tell you _why_.
|
||||
|
||||
Typical interim commits may look like the following:
|
||||
|
||||
```terminal
|
||||
5ba3db6 Update toggle markup for accessibility
|
||||
84564a0 Add MSFT styles
|
||||
e142fd1 Rebase with master
|
||||
887815f Remove toggle underline on hover
|
||||
ac8326d Fix ts-lint errors
|
||||
```
|
||||
|
||||
As a core philosophy we prefer [rebasing over merging](https://www.atlassian.com/git/tutorials/merging-vs-rebasing)
|
||||
|
||||
## Common commands
|
||||
|
||||
All "packages" share common script names for consistency along with their own documentation guides.
|
||||
|
||||
To clean all packages.
|
||||
|
||||
```bash
|
||||
lerna clean
|
||||
```
|
||||
|
||||
When package files change the symbolic links will require updating.
|
||||
|
||||
```bash
|
||||
lerna bootstrap
|
||||
```
|
||||
|
||||
To run all tests on all packages.
|
||||
|
||||
```bash
|
||||
lerna run test
|
||||
```
|
||||
|
||||
To run all tests on a single package.
|
||||
|
||||
```bash
|
||||
cd packages/package-name
|
||||
npm run test
|
||||
```
|
||||
|
||||
Most packages have a *watch* command that will rebuild the package's distribution when a file changes. This process can be useful when doing development across multiple packages.
|
||||
|
||||
```bash
|
||||
npm run watch
|
||||
```
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
id: readme
|
||||
title: Welcome to FAST-DNA
|
||||
sidebar_label: What is FAST-DNA
|
||||
---
|
||||
|
||||
Check the [documentation](https://docusaurus.io) for how to use Docusaurus.
|
|
@ -81,6 +81,7 @@
|
|||
"babel-core": "^6.26.0",
|
||||
"babel-jest": "^23.6.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"docusaurus-init": "^1.0.2",
|
||||
"dotenv": "^6.0.0",
|
||||
"eyes.selenium": "0.0.83",
|
||||
"glob": "^7.1.2",
|
||||
|
@ -89,8 +90,8 @@
|
|||
"lerna": "^3.3.0",
|
||||
"lint-staged": "^7.3.0",
|
||||
"markdown-it": "^8.4.1",
|
||||
"rimraf": "^2.6.2",
|
||||
"prettier": "1.14.3",
|
||||
"rimraf": "^2.6.2",
|
||||
"ts-jest": "^23.10.4",
|
||||
"ts-node": "^5.0.1",
|
||||
"tslint": "^5.9.1",
|
||||
|
|
|
@ -0,0 +1,197 @@
|
|||
This website was created with [Docusaurus](https://docusaurus.io/).
|
||||
|
||||
# What's In This Document
|
||||
|
||||
* [Get Started in 5 Minutes](#get-started-in-5-minutes)
|
||||
* [Directory Structure](#directory-structure)
|
||||
* [Editing Content](#editing-content)
|
||||
* [Adding Content](#adding-content)
|
||||
* [Full Documentation](#full-documentation)
|
||||
|
||||
# Get Started in 5 Minutes
|
||||
|
||||
1. Make sure all the dependencies for the website are installed:
|
||||
|
||||
```sh
|
||||
# Install dependencies
|
||||
$ npm install
|
||||
```
|
||||
|
||||
2. Run your dev server:
|
||||
|
||||
```sh
|
||||
# Start the site
|
||||
$ npm start
|
||||
```
|
||||
|
||||
## Directory Structure
|
||||
|
||||
Your project file structure should look something like this
|
||||
|
||||
```text
|
||||
my-docusaurus/
|
||||
docs/
|
||||
doc-1.md
|
||||
doc-2.md
|
||||
doc-3.md
|
||||
website/
|
||||
blog/
|
||||
2016-3-11-oldest-post.md
|
||||
2017-10-24-newest-post.md
|
||||
core/
|
||||
node_modules/
|
||||
pages/
|
||||
static/
|
||||
css/
|
||||
img/
|
||||
package.json
|
||||
sidebar.json
|
||||
siteConfig.js
|
||||
```
|
||||
|
||||
# Editing Content
|
||||
|
||||
## Editing an existing docs page
|
||||
|
||||
Edit docs by navigating to `docs/` and editing the corresponding document:
|
||||
|
||||
`docs/doc-to-be-edited.md`
|
||||
|
||||
```markdown
|
||||
---
|
||||
id: page-needs-edit
|
||||
title: This Doc Needs To Be Edited
|
||||
---
|
||||
|
||||
Edit me...
|
||||
```
|
||||
|
||||
For more information about docs, click [here](https://docusaurus.io/docs/en/navigation)
|
||||
|
||||
## Editing an existing blog post
|
||||
|
||||
Edit blog posts by navigating to `website/blog` and editing the corresponding post:
|
||||
|
||||
`website/blog/post-to-be-edited.md`
|
||||
```markdown
|
||||
---
|
||||
id: post-needs-edit
|
||||
title: This Blog Post Needs To Be Edited
|
||||
---
|
||||
|
||||
Edit me...
|
||||
```
|
||||
|
||||
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
|
||||
|
||||
# Adding Content
|
||||
|
||||
## Adding a new docs page to an existing sidebar
|
||||
|
||||
1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`:
|
||||
|
||||
```md
|
||||
---
|
||||
id: newly-created-doc
|
||||
title: This Doc Needs To Be Edited
|
||||
---
|
||||
|
||||
My new content here..
|
||||
```
|
||||
|
||||
1. Refer to that doc's ID in an existing sidebar in `website/sidebar.json`:
|
||||
|
||||
```javascript
|
||||
// Add newly-created-doc to the Getting Started category of docs
|
||||
{
|
||||
"docs": {
|
||||
"Getting Started": [
|
||||
"quick-start",
|
||||
"newly-created-doc" // new doc here
|
||||
],
|
||||
...
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation)
|
||||
|
||||
## Adding a new blog post
|
||||
|
||||
1. Make sure there is a header link to your blog in `website/siteConfig.js`:
|
||||
|
||||
`website/siteConfig.js`
|
||||
|
||||
```javascript
|
||||
headerLinks: [
|
||||
...
|
||||
{ blog: true, label: 'Blog' },
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`:
|
||||
|
||||
`website/blog/2018-05-21-New-Blog-Post.md`
|
||||
|
||||
```markdown
|
||||
---
|
||||
author: Frank Li
|
||||
authorURL: https://twitter.com/foobarbaz
|
||||
authorFBID: 503283835
|
||||
title: New Blog Post
|
||||
---
|
||||
|
||||
Lorem Ipsum...
|
||||
```
|
||||
|
||||
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
|
||||
|
||||
## Adding items to your site's top navigation bar
|
||||
|
||||
1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`:
|
||||
|
||||
`website/siteConfig.js`
|
||||
|
||||
```javascript
|
||||
{
|
||||
headerLinks: [
|
||||
...
|
||||
/* you can add docs */
|
||||
{ doc: 'my-examples', label: 'Examples' },
|
||||
/* you can add custom pages */
|
||||
{ page: 'help', label: 'Help' },
|
||||
/* you can add external links */
|
||||
{ href: 'https://github.com/facebook/Docusaurus', label: 'GitHub' },
|
||||
...
|
||||
],
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation)
|
||||
|
||||
## Adding custom pages
|
||||
|
||||
1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`:
|
||||
1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element:
|
||||
|
||||
`website/siteConfig.js`
|
||||
|
||||
```javascript
|
||||
{
|
||||
headerLinks: [
|
||||
...
|
||||
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
|
||||
...
|
||||
],
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages).
|
||||
|
||||
# Full Documentation
|
||||
|
||||
Full documentation can be found on the [website](https://docusaurus.io/).
|
|
@ -0,0 +1,101 @@
|
|||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
class Footer extends React.Component {
|
||||
docUrl(doc, language) {
|
||||
const baseUrl = this.props.config.baseUrl;
|
||||
return `${baseUrl}docs/${language ? `${language}/` : ''}${doc}`;
|
||||
}
|
||||
|
||||
pageUrl(doc, language) {
|
||||
const baseUrl = this.props.config.baseUrl;
|
||||
return baseUrl + (language ? `${language}/` : '') + doc;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<footer className="nav-footer" id="footer">
|
||||
{/* <section className="sitemap">
|
||||
<a href={this.props.config.baseUrl} className="nav-home">
|
||||
{this.props.config.footerIcon && (
|
||||
<img
|
||||
src={this.props.config.baseUrl + this.props.config.footerIcon}
|
||||
alt={this.props.config.title}
|
||||
width="66"
|
||||
height="58"
|
||||
/>
|
||||
)}
|
||||
</a>
|
||||
<div>
|
||||
<h5>Docs</h5>
|
||||
<a href={this.docUrl('doc1.html', this.props.language)}>
|
||||
Getting Started (or other categories)
|
||||
</a>
|
||||
<a href={this.docUrl('doc2.html', this.props.language)}>
|
||||
Guides (or other categories)
|
||||
</a>
|
||||
<a href={this.docUrl('doc3.html', this.props.language)}>
|
||||
API Reference (or other categories)
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<h5>Community</h5>
|
||||
<a href={this.pageUrl('users.html', this.props.language)}>
|
||||
User Showcase
|
||||
</a>
|
||||
<a
|
||||
href="http://stackoverflow.com/questions/tagged/"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener">
|
||||
Stack Overflow
|
||||
</a>
|
||||
<a href="https://discordapp.com/">Project Chat</a>
|
||||
<a
|
||||
href="https://twitter.com/"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener">
|
||||
Twitter
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<h5>More</h5>
|
||||
<a href={`${this.props.config.baseUrl}blog`}>Blog</a>
|
||||
<a href="https://github.com/">GitHub</a>
|
||||
<a
|
||||
className="github-button"
|
||||
href={this.props.config.repoUrl}
|
||||
data-icon="octicon-star"
|
||||
data-count-href="/facebook/docusaurus/stargazers"
|
||||
data-show-count="true"
|
||||
data-count-aria-label="# stargazers on GitHub"
|
||||
aria-label="Star this project on GitHub">
|
||||
Star
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<a
|
||||
href="https://code.facebook.com/projects/"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
className="fbOpenSource">
|
||||
<img
|
||||
src={`${this.props.config.baseUrl}img/oss_logo.png`}
|
||||
alt="Facebook Open Source"
|
||||
width="170"
|
||||
height="45"
|
||||
/>
|
||||
</a> */}
|
||||
<section className="copyright">{this.props.config.copyright}</section>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Footer;
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"_comment": "This file is auto-generated by write-translations.js",
|
||||
"localized-strings": {
|
||||
"next": "Next",
|
||||
"previous": "Previous",
|
||||
"tagline": "Accelerate building Web sites and applications",
|
||||
"docs": {
|
||||
"contributing/install": {
|
||||
"title": "Contributing",
|
||||
"sidebar_label": "Install"
|
||||
},
|
||||
"contributing/policies": {
|
||||
"title": "Contributing",
|
||||
"sidebar_label": "Policies"
|
||||
},
|
||||
"contributing/standards": {
|
||||
"title": "Contributing",
|
||||
"sidebar_label": "Standards"
|
||||
},
|
||||
"contributing/testing": {
|
||||
"title": "Contributing",
|
||||
"sidebar_label": "Testing"
|
||||
},
|
||||
"contributing/working": {
|
||||
"title": "Contributing",
|
||||
"sidebar_label": "Working"
|
||||
},
|
||||
"readme": {
|
||||
"title": "Welcome to FAST-DNA",
|
||||
"sidebar_label": "What is FAST-DNA"
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"Docs": "Docs"
|
||||
},
|
||||
"categories": {
|
||||
"Getting started": "Getting started",
|
||||
"Contributing": "Contributing"
|
||||
}
|
||||
},
|
||||
"pages-strings": {
|
||||
"Help Translate|recruit community translators for your project": "Help Translate",
|
||||
"Edit this Doc|recruitment message asking to edit the doc source": "Edit",
|
||||
"Translate this Doc|recruitment message asking to translate the docs": "Translate"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"scripts": {
|
||||
"examples": "docusaurus-examples",
|
||||
"start": "docusaurus-start",
|
||||
"build": "docusaurus-build",
|
||||
"publish-gh-pages": "docusaurus-publish",
|
||||
"write-translations": "docusaurus-write-translations",
|
||||
"version": "docusaurus-version",
|
||||
"rename-version": "docusaurus-rename-version"
|
||||
},
|
||||
"devDependencies": {
|
||||
"docusaurus": "^1.5.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
const CompLibrary = require('../../core/CompLibrary.js');
|
||||
|
||||
const Container = CompLibrary.Container;
|
||||
const GridBlock = CompLibrary.GridBlock;
|
||||
|
||||
const siteConfig = require(`${process.cwd()}/siteConfig.js`);
|
||||
|
||||
function docUrl(doc, language) {
|
||||
return `${siteConfig.baseUrl}docs/${language ? `${language}/` : ''}${doc}`;
|
||||
}
|
||||
|
||||
class Help extends React.Component {
|
||||
render() {
|
||||
const language = this.props.language || '';
|
||||
const supportLinks = [
|
||||
{
|
||||
content: `Learn more using the [documentation on this site.](${docUrl(
|
||||
'doc1.html',
|
||||
language,
|
||||
)})`,
|
||||
title: 'Browse Docs',
|
||||
},
|
||||
{
|
||||
content: 'Ask questions about the documentation and project',
|
||||
title: 'Join the community',
|
||||
},
|
||||
{
|
||||
content: "Find out what's new with this project",
|
||||
title: 'Stay up to date',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="docMainWrapper wrapper">
|
||||
<Container className="mainContainer documentContainer postContainer">
|
||||
<div className="post">
|
||||
<header className="postHeader">
|
||||
<h1>Need help?</h1>
|
||||
</header>
|
||||
<p>This project is maintained by a dedicated group of people.</p>
|
||||
<GridBlock contents={supportLinks} layout="threeColumn" />
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Help;
|
|
@ -0,0 +1,215 @@
|
|||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
const CompLibrary = require('../../core/CompLibrary.js');
|
||||
|
||||
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
|
||||
const Container = CompLibrary.Container;
|
||||
const GridBlock = CompLibrary.GridBlock;
|
||||
|
||||
const siteConfig = require(`${process.cwd()}/siteConfig.js`);
|
||||
|
||||
function imgUrl(img) {
|
||||
return `${siteConfig.baseUrl}img/${img}`;
|
||||
}
|
||||
|
||||
function docUrl(doc, language) {
|
||||
return `${siteConfig.baseUrl}docs/${language ? `${language}/` : ''}${doc}`;
|
||||
}
|
||||
|
||||
function pageUrl(page, language) {
|
||||
return siteConfig.baseUrl + (language ? `${language}/` : '') + page;
|
||||
}
|
||||
|
||||
class Button extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="pluginWrapper buttonWrapper">
|
||||
<a className="button" href={this.props.href} target={this.props.target}>
|
||||
{this.props.children}
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Button.defaultProps = {
|
||||
target: '_self',
|
||||
};
|
||||
|
||||
const SplashContainer = props => (
|
||||
<div className="homeContainer">
|
||||
<div className="homeSplashFade">
|
||||
<div className="wrapper homeWrapper">{props.children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const Logo = props => (
|
||||
<div className="projectLogo">
|
||||
<img src={props.img_src} alt="Project Logo" />
|
||||
</div>
|
||||
);
|
||||
|
||||
const ProjectTitle = () => (
|
||||
<h2 className="projectTitle">
|
||||
{siteConfig.title}
|
||||
<small>{siteConfig.tagline}</small>
|
||||
</h2>
|
||||
);
|
||||
|
||||
const PromoSection = props => (
|
||||
<div className="section promoSection">
|
||||
<div className="promoRow">
|
||||
<div className="pluginRowBlock">{props.children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
class HomeSplash extends React.Component {
|
||||
render() {
|
||||
const language = this.props.language || '';
|
||||
return (
|
||||
<SplashContainer>
|
||||
<Logo img_src={imgUrl('docusaurus.svg')} />
|
||||
<div className="inner">
|
||||
<ProjectTitle />
|
||||
<PromoSection>
|
||||
<Button href="https://msft-docs.fast-dna.net">Try It Out</Button>
|
||||
{/* <Button href={docUrl('doc1.html', language)}>Example Link</Button>
|
||||
<Button href={docUrl('doc2.html', language)}>Example Link 2</Button> */}
|
||||
</PromoSection>
|
||||
</div>
|
||||
</SplashContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const Block = props => (
|
||||
<Container
|
||||
padding={['bottom', 'top']}
|
||||
id={props.id}
|
||||
background={props.background}>
|
||||
<GridBlock align="center" contents={props.children} layout={props.layout} />
|
||||
</Container>
|
||||
);
|
||||
|
||||
const Features = () => (
|
||||
<Block layout="fourColumn">
|
||||
{[
|
||||
{
|
||||
content: 'This is the content of my feature',
|
||||
image: imgUrl('docusaurus.svg'),
|
||||
imageAlign: 'top',
|
||||
title: 'Feature One',
|
||||
},
|
||||
{
|
||||
content: 'The content of my second feature',
|
||||
image: imgUrl('docusaurus.svg'),
|
||||
imageAlign: 'top',
|
||||
title: 'Feature Two',
|
||||
},
|
||||
]}
|
||||
</Block>
|
||||
);
|
||||
|
||||
const FeatureCallout = () => (
|
||||
<div
|
||||
className="productShowcaseSection paddingBottom"
|
||||
style={{textAlign: 'center'}}>
|
||||
<h2>Feature Callout</h2>
|
||||
<MarkdownBlock>These are features of this project</MarkdownBlock>
|
||||
</div>
|
||||
);
|
||||
|
||||
const LearnHow = () => (
|
||||
<Block background="light">
|
||||
{[
|
||||
{
|
||||
content: 'Talk about learning how to use this',
|
||||
image: imgUrl('docusaurus.svg'),
|
||||
imageAlign: 'right',
|
||||
title: 'Learn How',
|
||||
},
|
||||
]}
|
||||
</Block>
|
||||
);
|
||||
|
||||
const TryOut = () => (
|
||||
<Block id="try">
|
||||
{[
|
||||
{
|
||||
content: 'Talk about trying this out',
|
||||
image: imgUrl('docusaurus.svg'),
|
||||
imageAlign: 'left',
|
||||
title: 'Try it Out',
|
||||
},
|
||||
]}
|
||||
</Block>
|
||||
);
|
||||
|
||||
const Description = () => (
|
||||
<Block background="dark">
|
||||
{[
|
||||
{
|
||||
content: 'This is another description of how this project is useful',
|
||||
image: imgUrl('docusaurus.svg'),
|
||||
imageAlign: 'right',
|
||||
title: 'Description',
|
||||
},
|
||||
]}
|
||||
</Block>
|
||||
);
|
||||
|
||||
const Showcase = props => {
|
||||
if ((siteConfig.users || []).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const showcase = siteConfig.users.filter(user => user.pinned).map(user => (
|
||||
<a href={user.infoLink} key={user.infoLink}>
|
||||
<img src={user.image} alt={user.caption} title={user.caption} />
|
||||
</a>
|
||||
));
|
||||
|
||||
return (
|
||||
<div className="productShowcaseSection paddingBottom">
|
||||
<h2>Who is Using This?</h2>
|
||||
<p>This project is used by all these people</p>
|
||||
<div className="logos">{showcase}</div>
|
||||
<div className="more-users">
|
||||
<a className="button" href={pageUrl('users.html', props.language)}>
|
||||
More {siteConfig.title} Users
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
class Index extends React.Component {
|
||||
render() {
|
||||
const language = this.props.language || '';
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HomeSplash language={language} />
|
||||
<div className="mainContainer">
|
||||
{/* <Features />
|
||||
<FeatureCallout />
|
||||
<LearnHow />
|
||||
<TryOut />
|
||||
<Description />
|
||||
<Showcase language={language} /> */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Index;
|
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
const CompLibrary = require('../../core/CompLibrary.js');
|
||||
|
||||
const Container = CompLibrary.Container;
|
||||
|
||||
const siteConfig = require(`${process.cwd()}/siteConfig.js`);
|
||||
|
||||
class Users extends React.Component {
|
||||
render() {
|
||||
if ((siteConfig.users || []).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const editUrl = `${siteConfig.repoUrl}/edit/master/website/siteConfig.js`;
|
||||
const showcase = siteConfig.users.map(user => (
|
||||
<a href={user.infoLink} key={user.infoLink}>
|
||||
<img src={user.image} alt={user.caption} title={user.caption} />
|
||||
</a>
|
||||
));
|
||||
|
||||
return (
|
||||
<div className="mainContainer">
|
||||
<Container padding={['bottom', 'top']}>
|
||||
<div className="showcaseSection">
|
||||
<div className="prose">
|
||||
<h1>Who is Using This?</h1>
|
||||
<p>This project is used by many folks</p>
|
||||
</div>
|
||||
<div className="logos">{showcase}</div>
|
||||
<p>Are you using this project?</p>
|
||||
<a href={editUrl} className="button">
|
||||
Add your company
|
||||
</a>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Users;
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"docs": {
|
||||
"Getting started": ["readme"],
|
||||
"Contributing": [
|
||||
"contributing/install",
|
||||
"contributing/working",
|
||||
"contributing/standards",
|
||||
"contributing/testing",
|
||||
"contributing/policies"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// See https://docusaurus.io/docs/site-config for all the possible
|
||||
// site configuration options.
|
||||
|
||||
// List of projects/orgs using your project for the users page.
|
||||
const users = [
|
||||
{
|
||||
caption: 'User1',
|
||||
// You will need to prepend the image path with your baseUrl
|
||||
// if it is not '/', like: '/test-site/img/docusaurus.svg'.
|
||||
image: '/img/docusaurus.svg',
|
||||
infoLink: 'https://www.facebook.com',
|
||||
pinned: true,
|
||||
},
|
||||
];
|
||||
|
||||
const siteConfig = {
|
||||
title: 'FAST-DNA', // Title for your website.
|
||||
tagline: 'Accelerate building Web sites and applications',
|
||||
url: 'https://microsoft.github.io', // Your website URL
|
||||
baseUrl: '/fast-dna/',
|
||||
// Base URL for your project */
|
||||
// For github.io type URLs, you would set the url and baseUrl like:
|
||||
// url: 'https://facebook.github.io',
|
||||
// baseUrl: '/test-site/',
|
||||
|
||||
// Used for publishing and more
|
||||
projectName: 'fast-dna',
|
||||
organizationName: 'Microsoft',
|
||||
// For top-level user or org sites, the organization is still the same.
|
||||
// e.g., for the https://JoelMarcey.github.io site, it would be set like...
|
||||
// organizationName: 'JoelMarcey'
|
||||
|
||||
// For no header links in the top nav bar -> headerLinks: [],
|
||||
headerLinks: [
|
||||
{doc: 'readme', label: 'Docs'},
|
||||
// {doc: 'doc4', label: 'API'},
|
||||
// {page: 'help', label: 'Help'},
|
||||
// {blog: true, label: 'Blog'},
|
||||
],
|
||||
|
||||
// If you have users set above, you add it here:
|
||||
users,
|
||||
|
||||
/* path to images for header/footer */
|
||||
headerIcon: 'img/docusaurus.svg',
|
||||
footerIcon: 'img/docusaurus.svg',
|
||||
favicon: 'img/favicon.png',
|
||||
|
||||
/* Colors for website */
|
||||
colors: {
|
||||
primaryColor: '#FB356D',
|
||||
secondaryColor: '#CCCCCC',
|
||||
},
|
||||
|
||||
/* Custom fonts for website */
|
||||
/*
|
||||
fonts: {
|
||||
myFont: [
|
||||
"Times New Roman",
|
||||
"Serif"
|
||||
],
|
||||
myOtherFont: [
|
||||
"-apple-system",
|
||||
"system-ui"
|
||||
]
|
||||
},
|
||||
*/
|
||||
|
||||
// This copyright info is used in /core/Footer.js and blog RSS/Atom feeds.
|
||||
copyright: `Copyright © ${new Date().getFullYear()} FAST-DNA`,
|
||||
|
||||
highlight: {
|
||||
// Highlight.js theme to use for syntax highlighting in code blocks.
|
||||
theme: 'default',
|
||||
},
|
||||
|
||||
// Add custom scripts here that would be placed in <script> tags.
|
||||
scripts: ['https://buttons.github.io/buttons.js'],
|
||||
|
||||
// On page navigation for the current documentation page.
|
||||
onPageNav: 'separate',
|
||||
// No .html extensions for paths.
|
||||
cleanUrl: true,
|
||||
|
||||
// Open Graph and Twitter card images.
|
||||
ogImage: 'img/docusaurus.png',
|
||||
twitterImage: 'img/docusaurus.png',
|
||||
|
||||
// Show documentation's last contributor's name.
|
||||
// enableUpdateBy: true,
|
||||
|
||||
// Show documentation's last update time.
|
||||
// enableUpdateTime: true,
|
||||
|
||||
// You may provide arbitrary config keys to be used as needed by your
|
||||
// template. For example, if you need your repo's URL...
|
||||
// repoUrl: 'https://github.com/facebook/test-site',
|
||||
};
|
||||
|
||||
module.exports = siteConfig;
|
|
@ -0,0 +1,16 @@
|
|||
/* your custom css */
|
||||
|
||||
@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1023px) {
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1400px) {
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1500px) {
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
После Ширина: | Высота: | Размер: 76 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 984 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 9.4 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 4.3 KiB |
Загрузка…
Ссылка в новой задаче