Skip to content

Commit a377699

Browse files
holamgadolKateVishnyaЕкатерина Московская
authored
feat: recursive link processing for url and repo_url (#23)
* Updating processing the url and repo_url (#22) * update (includes.py): path processing * upgate (includes.py): update processing repo_url * update: add test * update (readme.md): add note for repo_url * update readme and test * resolve conflict * update: deleted print * fix: added error handling * fix: full links Co-authored-by: Екатерина Московская <ekaterina.markova@rt.ru> * update: bump version to 1.1.15 * fix (docs): minor fixes * fix: style errors Co-authored-by: Ekaterina <69527819+KateVishnya@users.noreply.github.com> Co-authored-by: Екатерина Московская <ekaterina.markova@rt.ru>
1 parent 333b08e commit a377699

File tree

5 files changed

+191
-73
lines changed

5 files changed

+191
-73
lines changed

README.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,28 @@ Text below is taken from a remote repository on branch develop.
110110
<include repo_url="https://github.com/foo/bar.git" revision="develop" path="path/to/doc.md"></include>
111111
```
112112

113+
To include a text from HTTP(S) URL use the `url` attributes:
114+
115+
```markdown
116+
Text below is taken from a remote repository on the default branch.
117+
118+
<include url="https://github.com/foo/bar/path/to/doc.md"></include>
119+
```
120+
121+
> **Note**
122+
>
123+
> For projects in GitHub, you must specify the full path to the raw file, while not specifying the file extension `.md`.
124+
125+
``` markdown
126+
<include url="https://github.com/path/to/doc/raw/master/doc" nohead="true"></include>
127+
```
128+
129+
> For projects in GitLab, you must specify the full path to the raw file, and you must specify the file extension `.md`.
130+
131+
```markdown
132+
<include url="https://gitlub.com/path/to/doc/raw/master/doc.md" nohead="true"></include>
133+
```
134+
113135
To include a code snippet, use `wrap_code` and `code_language` attributes:
114136

115137
```markdown
@@ -118,8 +140,6 @@ wrap_code="triple_backticks" code_language="yaml">
118140
</include>
119141
```
120142

121-
122-
123143
#### Attributes
124144

125145
`src`
@@ -134,13 +154,18 @@ wrap_code="triple_backticks" code_language="yaml">
134154
`path`
135155
: Path to the file inside the remote Git repository.
136156

137-
> **Note**
138-
>
139-
> If you are using the new syntax, the `src` attribute is required to include a local file, `url` is required to include a remote file, and the `repo_url` and `path` attributes are required to include a file from a remote Git repository. All other attributes are optional.
157+
> **Note**
158+
>
159+
> Path parameter is required!
160+
Its absence will lead to incorrect operation Foliant.
140161

141-
> **Note**
142-
>
143-
> Foliant 1.0.9 supports the processing of attribute values as YAML. You can precede the values of attributes by the `!path`, `!project_path`, and `!rel_path` modifiers (i.e. YAML tags). These modifiers can be useful in the `src`, `path`, and `project_root` attributes.
162+
> **Note**
163+
>
164+
> If you are using the new syntax, the `src` attribute is required to include a local file, `url` is required to include a remote file, and the `repo_url` and `path` attributes are required to include a file from a remote Git repository. All other attributes are optional.
165+
166+
> **Note**
167+
>
168+
> Foliant 1.0.9 supports the processing of attribute values as YAML. You can precede the values of attributes by the `!path`, `!project_path`, and `!rel_path` modifiers (i.e. YAML tags). These modifiers can be useful in the `src`, `path`, and `project_root` attributes.
144169

145170
`revision`
146171
: Revision of the Git repository.
@@ -280,4 +305,4 @@ Include content from “Intro” up to the next heading of the same level:
280305
<include>sample.md#Intro</include>
281306
```
282307

283-
In the legacy syntax, problems may occur with the use of `$`, `#`, and `:` characters in filenames and headings, since these characters may be interpreted as delimeters.
308+
In the legacy syntax, problems may occur with the use of `$`, `#`, and `:` characters in filenames and headings, since these characters may be interpreted as delimiters.

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 1.1.15
2+
3+
- Feat: recursive link processing for _url_ and _repo_url_
4+
5+
16
# 1.1.14
27

38
- Fix `image_pattern` for `adjust_image_paths` method

0 commit comments

Comments
 (0)