File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change 2
2
3
3
contents = File . read ( "#{ root } /README.md" )
4
4
5
- # Fix links
6
- contents = contents . gsub ( /\] \( ([^)]+)\) / ) {
7
- link = $1
8
- if link . start_with? ( '#' )
9
- # link to same document
10
- elsif link . start_with? ( 'http://' ) or link . start_with? ( 'https://' )
11
- # absolute link
12
- elsif link . start_with? ( "doc/user/" )
13
- link = link . sub ( "doc/user/" , "" )
14
- else
15
- if link . end_with? ( '.png' )
16
- link = "https://raw.githubusercontent.com/oracle/truffleruby/master/#{ link } "
17
- else
18
- link = "https://github.com/oracle/truffleruby/blob/master/#{ link } "
19
- end
20
- end
21
- "](#{ link } )"
22
- }
23
-
24
5
# Remove the Documentation section for the website (redundant with the sidebar menu)
25
6
contents = contents . sub ( /^## Documentation\n .+?\n ##/m , '##' )
26
7
31
12
contents = "# TruffleRuby\n \n #{ contents } "
32
13
33
14
File . write ( "#{ root } /doc/user/README.md" , contents )
34
-
35
- # Fix links to README for all doc/user files
36
- Dir . glob ( "#{ root } /doc/user/*.md" ) do |file |
37
- contents = File . read ( file )
38
- contents = contents . gsub ( '](../../README.md#' , '](../#' )
39
- contents = contents . gsub ( '](../contributor/' , '](https://github.com/oracle/truffleruby/blob/master/doc/contributor/' )
40
- File . write ( file , contents )
41
- end
You can’t perform that action at this time.
0 commit comments