├── .github └── workflows │ └── wangdoc.yml ├── .gitignore ├── .travis.yml.bak ├── README.md ├── chapters.yml ├── deploy.sh ├── docs ├── a.md ├── attribute.md ├── elements.md ├── encode.md ├── form.md ├── iframe.md ├── image.md ├── intro.md ├── link.md ├── list.md ├── mobile.md ├── multimedia.md ├── script.md ├── semantic.md ├── table.md ├── text.md └── url.md ├── loppo.yml ├── package.json └── wangdoc-deploy-rsa.enc /.github/workflows/wangdoc.yml: -------------------------------------------------------------------------------- 1 | name: HTML tutorial CI 2 | on: 3 | push: 4 | branches: 5 | - master 6 | 7 | jobs: 8 | page-generator: 9 | name: Generating pages 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v2 14 | with: 15 | persist-credentials: false 16 | - name: Setup Node.js 17 | uses: actions/setup-node@main 18 | with: 19 | node-version: '14' 20 | - name: Install dependencies 21 | run: npm install 22 | - name: Build pages 23 | run: npm run build 24 | - name: Deploy to website 25 | uses: JamesIves/github-pages-deploy-action@3.7.1 26 | with: 27 | GIT_CONFIG_NAME: wangdoc-bot 28 | GIT_CONFIG_EMAIL: yifeng.ruan@gmail.com 29 | REPOSITORY_NAME: wangdoc/website 30 | ACCESS_TOKEN: ${{ secrets.WANGDOC_BOT_TOKEN }} 31 | BASE_BRANCH: master 32 | BRANCH: master # The branch the action should deploy to. 33 | FOLDER: dist # The folder the action should deploy. 34 | TARGET_FOLDER: dist/html 35 | CLEAN: true # Automatically remove deleted files from the deploy branch 36 | COMMIT_MESSAGE: update from HTML tutorial 37 | 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | package-lock.json 4 | pnpm-lock.yaml 5 | -------------------------------------------------------------------------------- /.travis.yml.bak: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 'node' 4 | 5 | branches: 6 | only: 7 | - master 8 | 9 | install: 10 | - npm ci 11 | # keep the npm cache around to speed up installs 12 | cache: 13 | directories: 14 | - "$HOME/.npm" 15 | 16 | script: bash ./deploy.sh 17 | env: 18 | global: 19 | - ENCRYPTION_LABEL: fcf2c626dda7 20 | - COMMIT_AUTHOR_EMAIL: yifeng.ruan@gmail.com 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | HTML 语言是互联网开发的基础。 2 | 3 | 本教程完整介绍 HTML 语言的所有内容,既可以当作初学者的入门教程,也可以用作参考手册查阅语法。 4 | -------------------------------------------------------------------------------- /chapters.yml: -------------------------------------------------------------------------------- 1 | - intro.md: HTML 简介 2 | - url.md: URL 简介 3 | - attribute.md: 元素的属性 4 | - encode.md: 字符编码 5 | - semantic.md: 语义结构 6 | - text.md: 文本标签 7 | - list.md: 列表标签 8 | - image.md: 图像标签 9 | - a.md: 10 | - link.md: 11 | - script.md: 13 | ``` 14 | 15 | 上面代码嵌入网页,会立即执行。 16 | 17 | ` 21 | ``` 22 | 23 | 上面代码会加载`javascript.js`脚本文件,并执行。 24 | 25 | `type`属性给出脚本的类型,默认是 JavaScript 代码,所以可省略。完整的写法其实是下面这样。 26 | 27 | ```html 28 | 29 | ``` 30 | 31 | `type`属性也可以设成`module`,表示这是一个 ES6 模块,不是传统脚本。 32 | 33 | ```html 34 | 35 | ``` 36 | 37 | 对于那些不支持 ES6 模块的浏览器,可以设置`nomodule`属性。支持 ES6 模块的浏览器,会不加载指定的脚本。这个属性通常与`type="module"`配合使用,作为老式浏览器的回退方案。 38 | 39 | ```html 40 | 41 | 42 | ``` 43 | 44 | `