浏览代码

use python to call markdown-link-check (instead of bash magic) (#3866)

* use python to call markdown-link-check (instead of bash magic)

* fix azure marketplace link
/develop/dockerfile
GitHub 5 年前
当前提交
db84d459
共有 4 个文件被更改,包括 34 次插入10 次删除
  1. 14
      .pre-commit-config.yaml
  2. 5
      docs/Training-Curriculum-Learning.md
  3. 2
      docs/Training-on-Microsoft-Azure.md
  4. 23
      utils/run_markdown_link_check.py

14
.pre-commit-config.yaml


hooks:
- id: markdown-link-check
name: markdown-link-check
# markdown-link-check doesn't support multiple files on the commandline, so this hacks around that.
# Note that you must install the package separately via npm. For example:
# brew install npm; npm install -g markdown-link-check
entry: bash -c 'for i in "$@"; do markdown-link-check -c markdown-link-check.fast.json "$i"; done' --
language: system
entry: utils/run_markdown_link_check.py
language: script
types: [markdown]
# Don't check localized files since their target might not be localized.
exclude: ".*localized.*"

name: markdown-link-check-full
entry: bash -c 'for i in "$@"; do markdown-link-check -c markdown-link-check.full.json "$i"; done' --
language: system
entry: utils/run_markdown_link_check.py
language: script
# Don't check localized files since their target might not be localized.
# Only run manually, e.g. pre-commit run --hook-stage manual markdown-link-check-full
args: [--check-remote]
- id: validate-versions
name: validate library versions
language: script

5
docs/Training-Curriculum-Learning.md


## An Instructional Example
*[**Note**: The example provided below is for instructional purposes, and was based on an early version of the [Wall Jump example environment](Example-Environments.md). As such, it is not possible to directly replicate the results here using that environment.]*
*[**Note**: The example provided below is for instructional purposes, and was based on an early version of the [Wall Jump example environment](Learning-Environment-Examples.md).
As such, it is not possible to directly replicate the results here using that environment.]*
Imagine a task in which an agent needs to scale a wall to arrive at a goal. The
starting point when training an agent to accomplish this task will be a random

You can then keep track of the current lessons and progresses via TensorBoard.
__Note__: If you are resuming a training session that uses curriculum, please pass the number of the last-reached lesson using the `--lesson` flag when running `mlagents-learn`.
__Note__: If you are resuming a training session that uses curriculum, please pass the number of the last-reached lesson using the `--lesson` flag when running `mlagents-learn`.

2
docs/Training-on-Microsoft-Azure.md


A pre-configured virtual machine image is available in the Azure Marketplace and
is nearly completely ready for training. You can start by deploying the
[Data Science Virtual Machine for Linux (Ubuntu)](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/microsoft-dsvm.linux-data-science-vm-ubuntu)
[Data Science Virtual Machine for Linux (Ubuntu)](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/microsoft-dsvm.ubuntu-1804)
into your Azure subscription.
Note that, if you choose to deploy the image to an

23
utils/run_markdown_link_check.py


#!/usr/bin/env python3
import argparse
import subprocess
if __name__ == "__main__":
# markdown-link-check doesn't support multiple files on the commandline, so this hacks around that.
# Note that you must install the package separately via npm. For example:
# brew install npm; npm install -g markdown-link-check
parser = argparse.ArgumentParser()
parser.add_argument("--check-remote", action="store_true")
parser.add_argument("files", nargs="*")
args = parser.parse_args()
config_file = (
"markdown-link-check.full.json"
if args.check_remote
else "markdown-link-check.fast.json"
)
for f in args.files:
subprocess_args = ["markdown-link-check", "-c", config_file, f]
subprocess.check_call(subprocess_args)
正在加载...
取消
保存