diff --git a/doc/README.md b/doc/README.md index 18806bbf..0bb8ec7a 100644 --- a/doc/README.md +++ b/doc/README.md @@ -5,6 +5,6 @@ Showing incompatibilities against [Haml](https://github.com/haml/haml) and [Faml ## engine -- [engine/old\_attributes\_spec.rb](https://github.com/k0kubun/hamlit/blob/master/doc/engine/old_attributes.md) -- [engine/script\_spec.rb](https://github.com/k0kubun/hamlit/blob/master/doc/engine/script.md) -- [engine/text\_spec.rb](https://github.com/k0kubun/hamlit/blob/master/doc/engine/text.md) +- [engine/old\_attributes\_spec.rb](engine/old_attributes.md) +- [engine/script\_spec.rb](engine/script.md) +- [engine/text\_spec.rb](engine/text.md) diff --git a/doc/engine/old_attributes.md b/doc/engine/old_attributes.md index 0d25b6fc..3a7bbf02 100644 --- a/doc/engine/old_attributes.md +++ b/doc/engine/old_attributes.md @@ -1,4 +1,4 @@ -# [old\_attributes\_spec.rb:43](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/old_attributes_spec.rb#L43) +# [old\_attributes\_spec.rb:43](/spec/hamlit/engine/old_attributes_spec.rb#L43) ## Input ```haml %span{ class: '}}}', id: '{}}' } }{ @@ -26,7 +26,7 @@ Faml::Compiler::UnparsableRubyCode: Unparsable Ruby code is given to attributes: ``` -# [old\_attributes\_spec.rb:201](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/old_attributes_spec.rb#L201) +# [old\_attributes\_spec.rb:201](/spec/hamlit/engine/old_attributes_spec.rb#L201) ## Input ```haml / wontfix: Non-boolean attributes are not escaped for optimization. diff --git a/doc/engine/script.md b/doc/engine/script.md index 8a38b84f..2747ef8e 100644 --- a/doc/engine/script.md +++ b/doc/engine/script.md @@ -1,4 +1,4 @@ -# [script\_spec.rb:41](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/script_spec.rb#L41) +# [script\_spec.rb:41](/spec/hamlit/engine/script_spec.rb#L41) ## Input ```haml = 3.times do |i| @@ -28,7 +28,7 @@ ``` -# [script\_spec.rb:55](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/script_spec.rb#L55) +# [script\_spec.rb:55](/spec/hamlit/engine/script_spec.rb#L55) ## Input ```haml %span @@ -56,7 +56,7 @@ ``` -# [script\_spec.rb:87](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/script_spec.rb#L87) +# [script\_spec.rb:87](/spec/hamlit/engine/script_spec.rb#L87) ## Input ```haml != '<"&>' @@ -80,7 +80,7 @@ ``` -# [script\_spec.rb:98](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/script_spec.rb#L98) +# [script\_spec.rb:98](/spec/hamlit/engine/script_spec.rb#L98) ## Input ```haml &= '<"&>' diff --git a/doc/engine/text.md b/doc/engine/text.md index 29cd85aa..98228f2d 100644 --- a/doc/engine/text.md +++ b/doc/engine/text.md @@ -1,4 +1,4 @@ -# [text\_spec.rb:15](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/text_spec.rb#L15) +# [text\_spec.rb:15](/spec/hamlit/engine/text_spec.rb#L15) ## Input ```haml . @@ -33,7 +33,7 @@ Haml::SyntaxError: Illegal element: classes and ids must have values. ``` -# [text\_spec.rb:99](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/text_spec.rb#L99) +# [text\_spec.rb:99](/spec/hamlit/engine/text_spec.rb#L99) ## Input ```haml   @@ -63,7 +63,7 @@ hello ``` -# [text\_spec.rb:175](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/engine/text_spec.rb#L175) +# [text\_spec.rb:175](/spec/hamlit/engine/text_spec.rb#L175) ## Input ```haml 1#{2 diff --git a/doc/filters/coffee.md b/doc/filters/coffee.md index bff80c9e..14bfb596 100644 --- a/doc/filters/coffee.md +++ b/doc/filters/coffee.md @@ -1,4 +1,4 @@ -# [coffee\_spec.rb:3](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/coffee_spec.rb#L3) +# [coffee\_spec.rb:3](/spec/hamlit/filters/coffee_spec.rb#L3) ## Input ```haml :coffee @@ -40,7 +40,7 @@ ``` -# [coffee\_spec.rb:22](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/coffee_spec.rb#L22) +# [coffee\_spec.rb:22](/spec/hamlit/filters/coffee_spec.rb#L22) ## Input ```haml :coffee @@ -82,7 +82,7 @@ ``` -# [coffee\_spec.rb:41](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/coffee_spec.rb#L41) +# [coffee\_spec.rb:41](/spec/hamlit/filters/coffee_spec.rb#L41) ## Input ```haml :coffee diff --git a/doc/filters/erb.md b/doc/filters/erb.md index 76420684..20329cdb 100644 --- a/doc/filters/erb.md +++ b/doc/filters/erb.md @@ -1,4 +1,4 @@ -# [erb\_spec.rb:3](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/erb_spec.rb#L3) +# [erb\_spec.rb:3](/spec/hamlit/filters/erb_spec.rb#L3) ## Input ```haml :erb diff --git a/doc/filters/javascript.md b/doc/filters/javascript.md index fd449ba8..f0b52c0d 100644 --- a/doc/filters/javascript.md +++ b/doc/filters/javascript.md @@ -1,4 +1,4 @@ -# [javascript\_spec.rb:3](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/javascript_spec.rb#L3) +# [javascript\_spec.rb:3](/spec/hamlit/filters/javascript_spec.rb#L3) ## Input ```haml before @@ -36,7 +36,7 @@ after ``` -# [javascript\_spec.rb:32](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/javascript_spec.rb#L32) +# [javascript\_spec.rb:32](/spec/hamlit/filters/javascript_spec.rb#L32) ## Input ```haml :javascript diff --git a/doc/filters/less.md b/doc/filters/less.md index 3c0eac32..1dc0e54f 100644 --- a/doc/filters/less.md +++ b/doc/filters/less.md @@ -1,4 +1,4 @@ -# [less\_spec.rb:3](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/less_spec.rb#L3) +# [less\_spec.rb:3](/spec/hamlit/filters/less_spec.rb#L3) ## Input ```haml :less @@ -29,7 +29,7 @@ Faml::FilterCompilers::NotFound: Unable to find compiler for less ``` -# [less\_spec.rb:22](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/less_spec.rb#L22) +# [less\_spec.rb:22](/spec/hamlit/filters/less_spec.rb#L22) ## Input ```haml :less diff --git a/doc/filters/markdown.md b/doc/filters/markdown.md index eb3b9f83..9d6e9d77 100644 --- a/doc/filters/markdown.md +++ b/doc/filters/markdown.md @@ -1,4 +1,4 @@ -# [markdown\_spec.rb:15](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/markdown_spec.rb#L15) +# [markdown\_spec.rb:15](/spec/hamlit/filters/markdown_spec.rb#L15) ## Input ```haml - project = '' diff --git a/doc/filters/plain.md b/doc/filters/plain.md index f50e57c2..42d22ec2 100644 --- a/doc/filters/plain.md +++ b/doc/filters/plain.md @@ -1,4 +1,4 @@ -# [plain\_spec.rb:3](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/plain_spec.rb#L3) +# [plain\_spec.rb:3](/spec/hamlit/filters/plain_spec.rb#L3) ## Input ```haml :plain diff --git a/doc/filters/sass.md b/doc/filters/sass.md index c7fc869f..d8794d8f 100644 --- a/doc/filters/sass.md +++ b/doc/filters/sass.md @@ -1,4 +1,4 @@ -# [sass\_spec.rb:3](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/sass_spec.rb#L3) +# [sass\_spec.rb:3](/spec/hamlit/filters/sass_spec.rb#L3) ## Input ```haml :sass @@ -31,7 +31,7 @@ ``` -# [sass\_spec.rb:19](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/sass_spec.rb#L19) +# [sass\_spec.rb:19](/spec/hamlit/filters/sass_spec.rb#L19) ## Input ```haml :sass diff --git a/doc/filters/scss.md b/doc/filters/scss.md index b0cd9a6a..fb65e2cc 100644 --- a/doc/filters/scss.md +++ b/doc/filters/scss.md @@ -1,4 +1,4 @@ -# [scss\_spec.rb:3](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/scss_spec.rb#L3) +# [scss\_spec.rb:3](/spec/hamlit/filters/scss_spec.rb#L3) ## Input ```haml :scss @@ -34,7 +34,7 @@ ``` -# [scss\_spec.rb:21](https://github.com/k0kubun/hamlit/blob/master/spec/hamlit/filters/scss_spec.rb#L21) +# [scss\_spec.rb:21](/spec/hamlit/filters/scss_spec.rb#L21) ## Input ```haml :scss diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f553db64..8448c8d4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -165,8 +165,7 @@ class TestCase < Struct.new(:file, :dir, :lineno, :src_haml, :haml_html, :faml_h tests.group_by(&:doc_path).each do |path, tests| test = tests.first file_path = File.join(test.dir, test.file) - base_url = 'https://github.com/k0kubun/hamlit/blob/master/doc/' - table_of_contents << "\n- [#{escape_markdown(file_path)}](#{File.join(base_url, path)})" + table_of_contents << "\n- [#{escape_markdown(file_path)}](#{path})" end table_of_contents << "\n" end @@ -192,10 +191,10 @@ class TestCase < Struct.new(:file, :dir, :lineno, :src_haml, :haml_html, :faml_h end def document - base_url = 'https://github.com/k0kubun/hamlit/blob/master/spec/hamlit' - url = File.join(base_url, dir, file) + base_path = '/spec/hamlit' + path = File.join(base_path, dir, file) doc = <<-DOC -# [#{escape_markdown("#{file}:#{lineno}")}](#{url}#L#{lineno}) +# [#{escape_markdown("#{file}:#{lineno}")}](#{path}#L#{lineno}) ## Input ```haml #{src_haml}