Coder Social home page Coder Social logo

cfug / flutter.cn Goto Github PK

View Code? Open in Web Editor NEW
500.0 25.0 347.0 550.23 MB

Flutter CN docs translation plan, get started from the wiki: https://github.com/cfug/flutter.cn/wiki

Home Page: https://flutter.cn

License: Other

CSS 0.66% JavaScript 12.13% Dart 83.35% Shell 0.44% SCSS 3.30% Liquid 0.12%
localization china-region flutter-websites flutter cfug china documents dart

flutter.cn's Introduction

Flutter logo

Flutter documentation website

The documentation site for the Flutter framework, built with Eleventy and hosted on Firebase.

Build Status OpenSSF Scorecard

Issues, bugs, and requests

We welcome contributions and feedback on our website. Please file a request in our issue tracker or create a pull request. For simple changes (such as tweaking some text), it's easiest to make changes using the GitHub UI.

If you have an issue with the API docs on api.flutter.dev, please file those issues on the flutter/flutter repo, not on this (flutter/website) repo. The API docs are embedded in Flutter's source code, so the engineering team handles those.

Before you submit a PR

We love it when the community gets involved in improving our docs! But here are a few notes to keep in mind before you submit a PR:

  • When triaging issues, we sometimes label an issue with the tag PRs welcome. But we welcome PRs on other issues as well— it doesn't have to be tagged with that label.
  • Please don't run our docs through Grammarly (or similar) and submit those changes as a PR.
  • We follow the Google Developer Documentation Style Guidelines — for example, don't use "i.e." or "e.g.", avoid writing in first person, and avoid writing in future tense. You can start with the style guide highlights or the word list, or use the search bar that's at the top of every style guide page.

We truly thank you for your willingness and helpfulness in keeping the website docs up to date!

Contributing

To update this site, fork the repo, make your changes, and generate a pull request. For small, contained changes (such as style and typo fixes), you probably don't need to build this site. Often you can make changes using the GitHub UI. If needed, we can stage the changes automatically in your pull request.

Important

If you are cloning this repository locally, follow the below instruction on cloning with its submodule.

If your change involves code samples, adds/removes pages, or affects navigation, do consider building and test your work before submitting.

If you want or need to build the site, follow the steps below.

Build the site

For changes beyond simple text and CSS tweaks, we recommend running the site locally to enable an edit-refresh cycle.

Get the prerequisites

Install the following tools to build and develop the site:

Flutter

The latest stable release of Flutter, which includes Dart, is required to build the site and run its tooling. If you don't have Flutter or need to update, follow the instructions at Install Flutter or Upgrading Flutter.

If you already have Flutter installed, verify it's on your path and already the latest stable version:

flutter --version

Node.js

The latest stable LTS release of Node.js is required to build the site. If you don't have Node.js or need to update, download your computer's corresponding version and follow the instructions from the Node.js download archive. If you prefer, you can use a version manager such as nvm, and run nvm install from the repository's root directory.

If you already have Node installed, verify it's available on your path and already the latest stable version (currently 20.12 or later):

node --version

If your version is out of date, follow the update instructions for how you originally installed it.

Clone this repo and its submodules

Note

This repository has git submodules, which affects how you clone it. The GitHub documentation has general help on forking and cloning repos.

If you're not a member of the Flutter organization, we recommend you create a fork of this repo under your own account, and then submit a PR from that fork.

Once you have a fork (or you're a Flutter org member), choose one of the following submodule-cloning techniques:

  1. Clone the repo and its submodule at the same time using the --recurse-submodules option:

    git clone --recurse-submodules https://github.com/flutter/website.git
  2. If you've already cloned the repo without its submodule, then run this command from the root of the repository:

    git submodule update --init --recursive

Note

At any time during development you can use the git submodule command to refresh submodules:

git pull && git submodule update --init --recursive

Set up your local environment and serve changes

Before you continue setting up the site infrastructure, verify the correct versions of Flutter and Node.js are set up and available by following the instructions in Get the prerequisites.

  1. Optional: After cloning the repo and its submodules, create a branch for your changes:

    git checkout -b <BRANCH_NAME>
  2. From the root directory of the repository, fetch the site's Dart dependencies.

    dart pub get
  3. Install pnpm, an alternative, efficient package manager for npm packages. If you already have pnpm, verify you have the latest stable version.

    node --version

    If you do not already have pnpm installed, we recommend using corepack to install and manage pnpm versions, since corepack is bundled with most installations of Node. If you installed node using Homebrew, you'll need to install corepack separately:

    brew install corepack

    If you haven't used corepack before, you'll need to first enable it with corepack enable. Then, to install the correct pnpm version, from the root directory of the repository, run corepack install:

    corepack enable;
    corepack install

    To install pnpm without using corepack, you can use your preferred installation method.

  4. Once you have pnpm installed and setup, fetch the site's npm dependencies using pnpm install. We highly recommend you use pnpm, but you can also use npm.

    pnpm install

    Rerun pnpm install whenever you incorporate the latest changes to the main branch or if you experience dependency or import errors when building the site.

  5. From the root directory, run the dash_site tool to validate your setup and learn about the available commands.

    ./dash_site --help
  6. From the root directory, serve the site locally.

    ./dash_site serve

    This command generates and serves the site on a local port that's printed to your terminal.

  7. View your changes in the browser by navigating to http://localhost:4000.

    Note the port might be different if 4000 is taken.

    If you want to check the raw, generated HTML output and structure, view the _site directory in a file explorer or an IDE.

  8. Make your changes to the local repo.

    The site should automatically rebuild on most changes, but if something doesn't update, exit the process and rerun the command. Improvements to this functionality are planned. Please open a new issue to track the issue if this occurs.

  9. Commit your changes to the branch and submit your PR.

    If your change is large, or you'd like to test it, consider validating your changes.

Tip

To find additional commands that you can run, run ./dash_site --help from the repository's root directory.

Validate your changes

Check documentation and example code

If you've made changes to the code in the /examples or /tool directories, commit your work, then run the following command to verify it is up to date and matches the site standards.

./dash_site check-all

If this script reports any errors or warnings, then address those issues and rerun the command. If you have any issues, leave a comment on your issue or pull request, and we'll try our best to help you. You can also chat with us on the #hackers-devrel channel on the Flutter contributors Discord!

Refresh code excerpts

A build that fails with the error Error: Some code excerpts needed to be updated! means that one or more code excerpts in the markdown file aren't identical to the code in the corresponding .dart file.

To resolve this error, from the root of the website directory, run ./dash_site refresh-excerpts.

For more information see Code excerpts .

[Optional] Deploy to a staging site

Submitted pull requests can be automatically staged by a site maintainer. If you'd like to stage the site yourself though, you can build a full version and upload it to Firebase.

  1. If you don't already have a Firebase project,
  • Navigate to the Firebase Console and create your own Firebase project (for example, flutter-dev-staging).

  • Head back to your local terminal and verify that you are logged in.

    firebase login
  • Ensure that your project exists and activate that project:

    firebase projects:list
    firebase use <your-project>
  1. From the root directory of the repository, build the site:

    ./dash_site build

    This will build the site and copy it to your local _site directory. If that directory previously existed, it will be replaced.

  2. Deploy to your activated Firebase project's default hosting site:

    firebase deploy --only hosting
  3. Navigate to your PR on GitHub and include the link of the staged version. Do consider adding a reference to the commit you staged, so that reviewers know if any further changes have been made.

flutter.cn's People

Contributors

abarth avatar alexv525 avatar amoshuke avatar atsansone avatar cfug-dev avatar chalin avatar chenglu avatar dependabot[bot] avatar devoncarew avatar domesticmouse avatar fertolg avatar filiph avatar hixie avatar jayoung-lee avatar jin-zz avatar jmagman avatar johnpryan avatar khanhnwin avatar kwalrath avatar legalcodes avatar meandni avatar micpap25 avatar miquelbeltran avatar mit-mit avatar parlough avatar qchong avatar sethladd avatar sfshaza2 avatar vadaski avatar xster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter.cn's Issues

[翻译] 完成所有元数据的翻译

大家好,为了统一整个网站标题,提供更好、更一致的用户体验,我会统一翻译所有的元数据。

元数据这里指的是 .md 文档的最上方,如 title: 之类的内容。

谢谢!

自我介绍 - Self Introductions

请在这个 Issue 下简要介绍自己的背景和关于 Flutter 的技术程度,再次谢谢你对 Flutter 文档的贡献!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.