-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
946 changed files
with
20,418 additions
and
18,658 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Import community events | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * SUN" # Runs every Sunday at midnight | ||
workflow_dispatch: | ||
|
||
jobs: | ||
create_pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Set up git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Action" | ||
- name: Generate timestamp and readable date | ||
id: date | ||
run: | | ||
echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV | ||
echo "READABLE_DATE=$(date +'%B %-d')" >> $GITHUB_ENV | ||
- name: Fetch latest dev and create new branch | ||
run: | | ||
git fetch origin dev | ||
git checkout -b "automated-update-${{ env.TIMESTAMP }}" origin/dev | ||
- name: Run script | ||
run: yarn events-import | ||
env: | ||
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | ||
|
||
- name: Commit and push | ||
run: | | ||
git add -A | ||
git commit -m "Update community events" | ||
git push origin "automated-update-${{ env.TIMESTAMP }}" | ||
- name: Create PR body | ||
run: | | ||
echo "This PR was automatically created to update community events from external community spreadsheet." > pr_body.txt | ||
echo "This workflows runs every Sunday at 00:00 (UTC)." >> pr_body.txt | ||
echo "Source: https://docs.google.com/spreadsheets/d/1NEu_FCc1hnGAuRgPmbXXpf0h2lCrCOlMKbbFEqgkVDQ" >> pr_body.txt | ||
- name: Create Pull Request | ||
run: | | ||
gh auth login --with-token ${{ secrets.GITHUB_TOKEN }} | ||
gh pr create --base dev --head "automated-update-${{ env.TIMESTAMP }}" --title "Update community events from external spreadsheet - ${{ env.READABLE_DATE }}" --body-file pr_body.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Custom header IDs for markdown documents | ||
|
||
Html ID attributes are used to create links to specific sections of a document. In markdown, **custom header IDs** should be assigned to all header lines (lines that begin with one-or-more hash marks, `#`). | ||
|
||
## Markdown syntax | ||
|
||
A custom heading ID should follow these rules: | ||
|
||
- Placed at the end of a heading line, preceded by a space, followed by a line break | ||
- Wrapped in curly braces | ||
- Starts with a hash-mark | ||
- Uses kebab-case string | ||
- Unique for the current page | ||
|
||
For example: | ||
|
||
```markdown | ||
## My heading {#my-heading} | ||
|
||
### A subheading {#a-subheading} | ||
|
||
#### Or a longer title that can be shortened {#long-heading} | ||
``` | ||
|
||
Note that for short headers, simply lowercasing and using hyphens instead of spaces is sufficient. For longer headers, a shortened concise version of the header is encouraged. Must not repeat the same ID on the same page. | ||
|
||
## How are these used? | ||
|
||
When these headers are rendered, they come with a link icon attached to it that can be used to quickly link to that section of the document. | ||
|
||
Extending the above example, if we wanted to link to the `A subheading` section of the above document (for example living at path `/docs`), you could use the link`/docs#a-subheading` to link directly to that section. | ||
|
||
See a live example on ethereum.org: [https://ethereum.org/en/developers/docs/blocks/#block-anatomy](https://ethereum.org/en/developers/docs/blocks/#block-anatomy) | ||
|
||
## When to use custom header IDs | ||
|
||
### English content | ||
|
||
These should be created for header on every new English markdown document. | ||
|
||
### Translated content | ||
|
||
English files are uploaded to Crowdin for translation. Header ID's should be _inherited_ from the English version, and remain unchanged during translation. | ||
|
||
This is to ensure that the translated content can be linked to from other documents and external links, without breaking the path. This is similar to why path and filenames are not translated, but remain in English to simplify linking and referencing. | ||
|
||
See a live example on ethereum.org: [https://ethereum.org/es/developers/docs/blocks/#block-anatomy](https://ethereum.org/en/developers/docs/blocks/#block-anatomy) | ||
|
||
Notice the header ID is still in English (`#block-anatomy`), but links to the Spanish (`/es/`) version of the site, at the correct section. | ||
|
||
## When are these not needed? | ||
|
||
Markdown files in the repo `/docs` (such as this one) do not require custom header IDs, as they are not yet displayed on the website, and do not have translated versions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.