Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,5 +1,8 @@ | |||
| 1 | [ | 1 | [ |
| 2 | [ | 2 | [ |
| 3 | "2017-06-04", | ||
| 4 | "New documentation: <a href=\"/pug/\">Pug</a>" | ||
| 5 | ], [ | ||
| 3 | "2017-05-14", | 6 | "2017-05-14", |
| 4 | "New documentations: <a href=\"/jest/\">Jest</a>, <a href=\"/jasmine/\">Jasmine</a> and <a href=\"/liquid/\">Liquid</a>" | 7 | "New documentations: <a href=\"/jest/\">Jest</a>, <a href=\"/jasmine/\">Jasmine</a> and <a href=\"/liquid/\">Liquid</a>" |
| 5 | ], [ | 8 | ], [ |
| @@ -76,6 +76,7 @@ · 75 unmodified lines | |||
| 76 | 'pages/php', | 76 | 'pages/php', |
| 77 | 'pages/phpunit', | 77 | 'pages/phpunit', |
| 78 | 'pages/postgres', | 78 | 'pages/postgres', |
| 79 | 'pages/pug', | ||
| 79 | 'pages/ramda', | 80 | 'pages/ramda', |
| 80 | 'pages/rdoc', | 81 | 'pages/rdoc', |
| 81 | 'pages/react', | 82 | 'pages/react', |
| @@ -76,6 +76,7 @@ · 75 unmodified lines | |||
| 76 | 'pages/php', | 76 | 'pages/php', |
| 77 | 'pages/phpunit', | 77 | 'pages/phpunit', |
| 78 | 'pages/postgres', | 78 | 'pages/postgres', |
| 79 | 'pages/pug', | ||
| 79 | 'pages/ramda', | 80 | 'pages/ramda', |
| 80 | 'pages/rdoc', | 81 | 'pages/rdoc', |
| 81 | 'pages/react', | 82 | 'pages/react', |
| @@ -172,3 +172,4 @@ · 171 unmodified lines | |||
| 172 | ._icon-angular:before { background-position: -8rem -1rem; @extend %doc-icon-2; } | 172 | ._icon-angular:before { background-position: -8rem -1rem; @extend %doc-icon-2; } |
| 173 | ._icon-love:before { background-position: -9rem -1rem; @extend %doc-icon-2; } | 173 | ._icon-love:before { background-position: -9rem -1rem; @extend %doc-icon-2; } |
| 174 | ._icon-jasmine:before { background-position: 0 -2rem; @extend %doc-icon-2; } | 174 | ._icon-jasmine:before { background-position: 0 -2rem; @extend %doc-icon-2; } |
| 175 | ._icon-pug:before { background-position: -1rem -2rem; @extend %doc-icon-2; } | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | ._pug { | ||
| 2 | @extend %simple; | ||
| 3 | |||
| 4 | .alert { @extend %note; } | ||
| 5 | .alert-danger { @extend %note-orange; } | ||
| 6 | .alert h6 { margin-top: .25rem; } | ||
| 7 | |||
| 8 | h4 > code { @extend %label; } | ||
| 9 | } | ||
| @@ -0,0 +1,30 @@ | |||
| 1 | module Docs | ||
| 2 | class Pug | ||
| 3 | class CleanHtmlFilter < Filter | ||
| 4 | def call | ||
| 5 | @doc = at_css('.main') | ||
| 6 | |||
| 7 | at_css('h1').content = 'Pug Documentation' if root_page? | ||
| 8 | |||
| 9 | if slug == 'api/reference' | ||
| 10 | at_css('.alert-info').remove | ||
| 11 | end | ||
| 12 | |||
| 13 | css('.header-anchor').remove | ||
| 14 | |||
| 15 | css('.preview-wrapper').each do |node| | ||
| 16 | node.css('pre').each do |n| | ||
| 17 | node.before(n) | ||
| 18 | end | ||
| 19 | node.remove | ||
| 20 | end | ||
| 21 | |||
| 22 | css('pre').each do |node| | ||
| 23 | node.content = node.content | ||
| 24 | end | ||
| 25 | |||
| 26 | doc | ||
| 27 | end | ||
| 28 | end | ||
| 29 | end | ||
| 30 | end | ||
| @@ -0,0 +1,27 @@ | |||
| 1 | module Docs | ||
| 2 | class Pug | ||
| 3 | class EntriesFilter < Docs::EntriesFilter | ||
| 4 | def get_name | ||
| 5 | at_css('h1').content | ||
| 6 | end | ||
| 7 | |||
| 8 | def get_type | ||
| 9 | if subpath.start_with?('language') | ||
| 10 | 'Language' | ||
| 11 | elsif subpath.start_with?('api') | ||
| 12 | 'API' | ||
| 13 | end | ||
| 14 | end | ||
| 15 | |||
| 16 | def additional_entries | ||
| 17 | return [] unless slug == 'api/reference' | ||
| 18 | |||
| 19 | css('h3').each_with_object [] do |node, entries| | ||
| 20 | name = node.content | ||
| 21 | name.sub! %r{\(.*\)}, '()' | ||
| 22 | entries << [name, node['id']] | ||
| 23 | end | ||
| 24 | end | ||
| 25 | end | ||
| 26 | end | ||
| 27 | end | ||
| @@ -0,0 +1,28 @@ | |||
| 1 | module Docs | ||
| 2 | class Pug < UrlScraper | ||
| 3 | self.type = 'pug' | ||
| 4 | self.base_url = 'https://pugjs.org/' | ||
| 5 | self.root_path = 'api/getting-started.html' | ||
| 6 | self.release = '2.0.0-rc.2' | ||
| 7 | self.links = { | ||
| 8 | home: 'https://pugjs.org/', | ||
| 9 | code: 'https://github.com/pugjs/pug' | ||
| 10 | } | ||
| 11 | |||
| 12 | html_filters.push 'pug/clean_html', 'pug/entries' | ||
| 13 | |||
| 14 | options[:container] = 'body > .container' | ||
| 15 | |||
| 16 | options[:attribution] = <<-HTML | ||
| 17 | © Pug authors<br> | ||
| 18 | Licensed under the MIT license. | ||
| 19 | HTML | ||
| 20 | |||
| 21 | private | ||
| 22 | |||
| 23 | def parse(response) # Hook here because Nokogori removes whitespace from textareas | ||
| 24 | response.body.gsub! %r{<textarea\ [^>]*>([\W\w]+?)</textarea>}, '<pre>\1</pre>' | ||
| 25 | super | ||
| 26 | end | ||
| 27 | end | ||
| 28 | end | ||
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | |||
| 1 | https://github.com/pugjs/pug-www/blob/master/htdocs/images/logo.svg | ||