Skip to content

Commit 56eea11

Browse files
committed
docs: Re-organize README
1 parent 4a91cfb commit 56eea11

File tree

1 file changed

+42
-40
lines changed

1 file changed

+42
-40
lines changed

README.md

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,46 @@
22
<img src="assets/front.png" alt="Image" />
33

44

5-
Code embedder is a GitHub action that updates your README.md with up-to-date code snippets from your scripts.
5+
Keep your code snippets in README files up-to-date with Code-Embedder.
66

77
## Description
8-
This action:
9-
1. reads one or more README files from `readme_paths` input,
10-
1. looks for specific script tags in the READMEs,
11-
1. reads the content of the scripts and embeds it in the READMEs at the corresponding tags,
12-
1. pushes the changes to the repository.
138

14-
## Workflow file structure
9+
This action looks for the following sections in the readme file:
10+
````md
11+
```language:path/to/script
12+
```
13+
````
14+
This action will update the code snippets with the content of the script located at `path/to/script` and push the changes to the repository.
15+
16+
### Example
17+
18+
You will add the code block sections with path to the scripts in the following format:
19+
````md
20+
# README
21+
22+
This is a readme.
23+
24+
```python:main.py
25+
```
26+
````
27+
And once the worklow runs, the code block sections will be filled with the content of the script located at `main.py` and updated in the readme file.
28+
29+
````md
30+
# README
31+
32+
This is a readme.
33+
34+
```python:main.py
35+
print("Embedding successful")
36+
```
37+
````
38+
Once the content of the script located at `main.py` changes, the code block section will be updated in the readme file with the next workflow run.
39+
40+
41+
## Setup
1542
To use this action, you need to configure a yaml workflow file in `.github/workflows` folder (e.g. `.github/workflows/code-embedder.yaml`) with the following content:
1643

17-
```yaml:.github/workflows/code-embedder.yml
44+
```yaml
1845
name: Code Embedder
1946

2047
on: pull_request
@@ -39,36 +66,11 @@ jobs:
3966
```
4067
It requires a secret `GITHUB_TOKEN` with write and repo permission.
4168

42-
## README file configuration
43-
You can specify which README files you want to update with `readme_paths` (paths to markdown files). If no README files are provided, it will by default look for it in the root `README.md`. Argument `readme_paths` accepts multiple paths separated by spaces, example: `README.md README2.md`.
44-
45-
The action looks for the following sections in the readme file based on which it will update the code snippets:
46-
````md
47-
```language:path/to/script
48-
```
49-
````
50-
These sections will be filled in by content of path/to/script and updated with up-to-date content of the scripts.
51-
52-
## Example
69+
You can specify which README files you want to update with `readme_paths` (paths to markdown files). If no README files are provided, it will by default look for a README file in the root `README.md`. Argument `readme_paths` accepts multiple paths separated by spaces, example: `README.md README2.md`.
5370

54-
You will add the code block sections with path to the scripts in the following format:
55-
````md
56-
# README
57-
58-
This is a readme.
59-
60-
```python:main.py
61-
```
62-
````
63-
And once the worklow runs, the code block sections will be filled with the content of the script and updated in the readme file.
64-
65-
````md
66-
# README
67-
68-
This is a readme.
69-
70-
```python:main.py
71-
print("Embedding successful")
72-
```
73-
````
74-
Once the content of the script changes, the code block sections will be updated in the readme file.
71+
## Under the hood
72+
This action:
73+
1. reads one or more README files from `readme_paths` input,
74+
1. looks for script paths in the READMEs,
75+
1. reads the content of the scripts and embeds it in the READMEs at the corresponding locations,
76+
1. pushes the changes to the repository.

0 commit comments

Comments
 (0)