Skip to content

Commit 550b95b

Browse files
Fix the URL's in the docs (#637)
* Add template directory and copy the replaced markdown files to the tutorials directory. * Format code * Replace strings of file paths with joinpath() --------- Co-authored-by: Erik Faulhaber <[email protected]>
1 parent 089adbe commit 550b95b

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ docs/src/contributing.md
99
docs/src/license.md
1010
docs/src/code_of_conduct.md
1111
docs/src/news.md
12+
docs/src/tutorials
1213
*_replaced.md
1314
run
1415
*.json

docs/make.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,23 @@ function replace_with_code(filename)
6161
end
6262
end
6363

64+
# Check if tutorials directory exists, else create one
65+
path_tutorials = joinpath("docs", "src", "tutorials")
66+
if !isdir(path_tutorials)
67+
mkdir(path_tutorials)
68+
end
69+
70+
file_basename = basename(filename)
71+
6472
# Replace all occurrences in the markdown content
65-
filename_noext, extension = splitext(filename)
66-
copy_file(filename, new_file="$(filename_noext)_replaced$extension",
73+
copy_file(filename, new_file=joinpath(path_tutorials, file_basename),
6774
pattern => replace_include)
6875
end
6976

70-
replace_with_code("docs/src/tutorials/tut_setup.md")
71-
replace_with_code("docs/src/tutorials/tut_dam_break.md")
72-
replace_with_code("docs/src/tutorials/tut_beam.md")
73-
replace_with_code("docs/src/tutorials/tut_falling.md")
77+
replace_with_code(joinpath("docs", "src", "tutorials_template", "tut_setup.md"))
78+
replace_with_code(joinpath("docs", "src", "tutorials_template", "tut_dam_break.md"))
79+
replace_with_code(joinpath("docs", "src", "tutorials_template", "tut_beam.md"))
80+
replace_with_code(joinpath("docs", "src", "tutorials_template", "tut_falling.md"))
7481

7582
copy_file("AUTHORS.md",
7683
"in the [LICENSE.md](LICENSE.md) file" => "under [License](@ref)")

docs/src/tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33

44
## Fluid
5-
- [Setting up your simulation from scratch](tutorials/tut_setup_replaced.md)
6-
- [Setting up a dam break simulation](tutorials/tut_dam_break_replaced.md)
5+
- [Setting up your simulation from scratch](tutorials/tut_setup.md)
6+
- [Setting up a dam break simulation](tutorials/tut_dam_break.md)
77

88
## Mechanics
9-
- [Deforming a beam](tutorials/tut_beam_replaced.md)
9+
- [Deforming a beam](tutorials/tut_beam.md)
1010

1111

1212
## Fluid-Structure Interaction
13-
- [Setting up a falling structure](tutorials/tut_falling_replaced.md)
13+
- [Setting up a falling structure](tutorials/tut_falling.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)