Skip to content

Commit

Permalink
Merge branch 'main' into update-translation-template
Browse files Browse the repository at this point in the history
  • Loading branch information
lewtun committed Mar 28, 2022
2 parents 61d66b9 + c5f67e7 commit 1c907e6
Show file tree
Hide file tree
Showing 158 changed files with 1,281 additions and 2,060 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build documentation

on:
push:
branches:
- release
- doc-builder*

jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main
with:
commit_sha: ${{ github.sha }}
package: course
path_to_docs: course/chapters/en
additional_args: --not_python_module
secrets:
token: ${{ secrets.HUGGINGFACE_PUSH }}
18 changes: 18 additions & 0 deletions .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build PR Documentation

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
with:
commit_sha: ${{ github.event.pull_request.head.sha }}
pr_number: ${{ github.event.number }}
package: course
path_to_docs: course/chapters/en
additional_args: --not_python_module
13 changes: 13 additions & 0 deletions .github/workflows/delete_doc_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Delete dev documentation

on:
pull_request:
types: [ closed ]


jobs:
delete:
uses: huggingface/doc-builder/.github/workflows/delete_doc_comment.yml@main
with:
pr_number: ${{ github.event.number }}
package: course
22 changes: 0 additions & 22 deletions .github/workflows/deploy.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Quality Check

on: [pull_request]
on:
pull_request:

jobs:
quality:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ yarn.lock
notes

# Ignore Colab notebooks
nbs/
nbs/

# Byte-compiled
__pycache__/
.cache/
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ git clone https://github.com/YOUR-USERNAME/course
The course files are organised into two main directories:

* [`chapters`](https://github.com/huggingface/course/tree/master/chapters): all the text and code snippets associated with the course.
* [`static`](https://github.com/huggingface/course/tree/master/static): all the images and GIFs for the course website.
* [`huggingface-course/documentation-images`](https://huggingface.co/datasets/huggingface-course/documentation-images): repository that contains all the images and GIFs for the course website.

You'll only need to copy the files in the [`chapters/en`](https://github.com/huggingface/course/tree/master/chapters/en) directory, so first navigate to your fork of the repo and run the following:

Expand All @@ -47,8 +47,7 @@ Here, `LANG-ID` should be one of the ISO 639-1 or ISO 639-2 language codes -- se
Now comes the fun part - translating the text! The first thing we recommend is translating the `_chapters.yml` file. This file is used to render the table of contents on the website and provide the links to the Colab notebooks. The only fields you should change are `title`, `subtitle`, and `sections`. For example, here are the parts of `_chapters.yml` that we'd translate for [Chapter 0](https://huggingface.co/course/chapter0/1?fw=pt):

```yaml
- local: chapter0
title: Setup # Translate this!
- title: Setup # Translate this!
subtitle: This course looks cool, how can I run its code? # Translate this!
sections:
- Setting up a working environment # Translate this!
Expand Down Expand Up @@ -81,7 +80,7 @@ This script extracts all the code snippets from the English chapters and stores
Adding a new chapter to the course is quite simple:

1. Create a new directory under `chapters/en/chapterX`, where `chapterX` is the chapter you'd like to add.
2. Add numbered MDX files `sectionX.mdx` for each section. If you need to include images, place them in the `static` directory and use the [HTML Images Syntax](https://www.w3schools.com/html/html_images.asp) with the path `/course/static/chapterX/your-image.png`.
2. Add numbered MDX files `sectionX.mdx` for each section. If you need to include images, place them in the [huggingface-course/documentation-images](https://huggingface.co/datasets/huggingface-course/documentation-images) repository and use the [HTML Images Syntax](https://www.w3schools.com/html/html_images.asp) with the path `https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/{langY}/{chapterX}/{your-image.png}`.
3. Update the `_chapters.yml` file to include your chapter sections -- this information will render the table of contents on the website. If your section involves both the PyTorch and TensorFlow APIs of `transformers`, make sure you include links to both Colabs in the `colab` field.

If you get stuck, check out one of the existing chapters -- this will often show you the expected syntax.
Expand Down
Loading

0 comments on commit 1c907e6

Please sign in to comment.