diff --git a/assets/images/docs.png b/assets/images/docs.png index 90b7a21f..b62cd84f 100644 Binary files a/assets/images/docs.png and b/assets/images/docs.png differ diff --git a/assets/images/docs@2x.png b/assets/images/docs@2x.png index 0caf08f5..21f19709 100644 Binary files a/assets/images/docs@2x.png and b/assets/images/docs@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 94362be7..e96b63eb 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,5 +1,8 @@ [ [ + "2016-07-02", + "New documentation: CMake" + ], [ "2016-06-19", "New documentation: LÖVE" ], [ diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 535f488b..458a0492 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -135,6 +135,11 @@ credits = [ 'Rich Hickey', 'EPL', 'https://github.com/clojure/clojure/blob/master/epl-v10.html' + ], [ + 'CMake', + '2000-2016 Kitware, Inc.
© 2000-2011 Insight Software Consortium', + 'BSD', + 'https://cmake.org/licensing/' ], [ 'CodeIgniter', '2014-2016 British Columbia Institute of Technology', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index f41cda73..1396980d 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -132,6 +132,7 @@ ._icon-q:before { background-position: -5rem -8rem; } ._icon-react_native:before { background-position: 0 -9rem; } ._icon-phalcon:before { background-position: -1rem -9rem; } +._icon-cmake:before { background-position: -3rem -9rem; } ._icon-elixir:before { background-position: -4rem -9rem; @extend %darkIconFix !optional; } ._icon-vagrant:before { background-position: -5rem -9rem; } ._icon-dojo:before { background-position: -6rem -9rem; } diff --git a/lib/docs/filters/cmake/clean_html.rb b/lib/docs/filters/cmake/clean_html.rb index b499dbd3..e2c82fef 100644 --- a/lib/docs/filters/cmake/clean_html.rb +++ b/lib/docs/filters/cmake/clean_html.rb @@ -1,39 +1,47 @@ module Docs class Cmake class CleanHtmlFilter < Filter - # since each property category has its own entry redirect to that one instead - URL_MAPPING = { - '/manual/cmake-properties.7#properties-of-global-scope' => '/../cmake-properties-of-global-scope/', - '/manual/cmake-properties.7#properties-on-directories' => '/../cmake-properties-on-directories/', - '/manual/cmake-properties.7#target-properties' => '/../cmake-properties-on-targets/', - '/manual/cmake-properties.7.html#properties-on-tests' => '/../cmake-properties-on-tests/', - '/manual/cmake-properties.7.html#properties-on-source-files' => '/../cmake-properties-on-source-files/', - '/manual/cmake-properties.7.html#properties-on-cache-entries' => '/../cmake-properties-on-cache-entries/', - '/manual/cmake-properties.7.html#properties-on-installed-files' => '/../cmake-properties-on-installed-files/', - '/manual/cmake-properties.7.html#deprecated-properties-on-directories' => '/../cmake-deprecated-properties-on-directories/', - '/manual/cmake-properties.7.html#deprecated-properties-on-targets' => '/../cmake-deprecated-properties-on-targets/', - '/manual/cmake-properties.7.html#deprecated-properties-on-source-files' => '/../cmake-deprecated-properties-on-source-files/' - } - def call - css('.headerlink').remove + css('.headerlink', '#contents .topic-title').remove + if root_page? - css('#release-notes').remove - css('#index-and-search').remove - return doc + css('#release-notes', '#index-and-search').remove + + css('h1').each do |node| + node.name = 'h2' + end + end + + css('.contents > ul.simple > li:first-child:last-child').each do |node| + node.parent.before(node.at_css('> ul')) + node.remove end - css('.toc-backref').each do |link| - link.replace(link.text) + + css('.toc-backref', '.toctree-wrapper', '.contents', 'span.pre', 'pre a > code').each do |node| + node.before(node.children).remove + end + + css('div[class*="highlight-"]').each do |node| + pre = node.at_css('pre') + pre.content = pre.content + node.replace(pre) end - css('#contents').remove - # change urls pointing to entries which don't have a default entry - css('a').each do |link| - URL_MAPPING.each do |key, value| - if link['href'].end_with? key - link['href'] = link['href'][0..-(key.length + 1)] + value + css('span[id]:empty').each do |node| + node.next_element['id'] = node['id'] + node.remove + end + + css('.section').each do |node| + if node['id'] + if node.first_element_child['id'] + node.element_children[1]['id'] = node['id'] + else + node.first_element_child['id'] = node['id'] end end + + node.before(node.children).remove end doc diff --git a/lib/docs/filters/cmake/entries.rb b/lib/docs/filters/cmake/entries.rb index 5d6f8cea..f58c49fc 100644 --- a/lib/docs/filters/cmake/entries.rb +++ b/lib/docs/filters/cmake/entries.rb @@ -1,63 +1,41 @@ module Docs class Cmake class EntriesFilter < Docs::EntriesFilter - MISCELLANEOUS = { + NAME_BY_SLUG = { 'manual/cmake.1' => 'CMake', 'manual/ctest.1' => 'CTest', 'manual/cpack.1' => 'CPack', 'manual/cmake-gui.1' => 'CMake GUI', - 'manual/ccmake.1' => 'CCMake', - 'manual/cmake-buildsystem.7' => 'Buildsystem', - 'manual/cmake-commands.7' => 'Commands', - 'manual/cmake-compile-features.7' => 'Compile Features', - 'manual/cmake-developer.7' => 'Developer', - 'manual/cmake-generator-expressions.7' => 'Generator Expressions', - 'manual/cmake-generators.7' => 'Generators', - 'manual/cmake-language.7' => 'Language', - 'manual/cmake-modules.7' => 'Modules', - 'manual/cmake-packages.7' => 'Packages', - 'manual/cmake-policies.7' => 'Policies', - 'manual/cmake-properties.7' => 'Properties', - 'manual/cmake-qt.7' => 'Qt', - 'manual/cmake-toolchains.7' => 'Toolchains', - 'manual/cmake-variables.7' => 'Variables' } + 'manual/ccmake.1' => 'CCMake' } - GROUPS = { + TYPE_BY_DIR = { 'command' => 'Commands', + 'manual' => 'Manual', + 'module' => 'Modules', 'policy' => 'Policies', + 'prop_cache' => 'Properties: Cache Entries', + 'prop_dir' => 'Properties: Directories', 'prop_gbl' => 'Properties of Global Scope', - 'prop_dir' => 'Properties on Directories', - 'prop_tgt' => 'Properties on Targets', - 'prop_test' => 'Properties on Tests', - 'prop_sf' => 'Properties on Source Files', - 'prop_cache' => 'Properties on Cache Entries', - 'prop_inst' => 'Properties on Installed Files', + 'prop_inst' => 'Properties: Installed Files', + 'prop_sf' => 'Properties: Source Files', + 'prop_test' => 'Properties: Tests', + 'prop_tgt' => 'Properties: Targets', 'variable' => 'Variables' } def get_name - if MISCELLANEOUS.key?(slug) - return MISCELLANEOUS[slug] + if NAME_BY_SLUG.key?(slug) + NAME_BY_SLUG[slug] + elsif slug =~ /\Amanual\/cmake-([\w\-]+)\.7\z/ + $1.titleize + else + dir, name = slug.split('/') + name << '()' if dir == 'command' + name end - parts = slug.split('/') - name = parts.drop(1).first - if name == '' - return slug - end - if parts.first == 'command' - name += '()' - end - name end def get_type - if MISCELLANEOUS.key?(slug) - return 'Miscellaneous' - end - parts = slug.split('/') - if GROUPS.key?(parts.first) - return GROUPS[parts.first] - end - slug + TYPE_BY_DIR[slug.split('/').first] end end end diff --git a/lib/docs/scrapers/cmake.rb b/lib/docs/scrapers/cmake.rb index 631ecc31..254cad44 100644 --- a/lib/docs/scrapers/cmake.rb +++ b/lib/docs/scrapers/cmake.rb @@ -1,32 +1,29 @@ module Docs class Cmake < UrlScraper self.name = 'CMake' - self.slug = 'cmake' - self.type = 'cmake' - self.release = '3.5' - self.base_url = 'https://cmake.org/cmake/help/v3.5/' + self.type = 'sphinx_simple' + self.links = { + home: 'https://cmake.org/', + code: 'https://cmake.org/gitweb?p=cmake.git;a=summary' + } - options[:skip] = %w( - release/index.html - genindex.html - search.html - ) - - options[:only_patterns] = [ - /manual/, - /command/, - /policy/, - /prop_/, - /variable/ - ] + html_filters.push 'cmake/clean_html', 'cmake/entries', 'title' options[:container] = '.body' - - html_filters.push 'cmake/clean_html', 'cmake/entries' + options[:title] = false + options[:root_title] = 'CMake Reference Documentation' + options[:skip] = %w(release/index.html genindex.html search.html) + options[:skip_patterns] = [/\Agenerator/, /\Ainclude/, /\Arelease/] options[:attribution] = <<-HTML © 2000–2016 Kitware, Inc.
+ © 2000–2011 Insight Software Consortium
Licensed under the BSD 3-clause License. HTML + + version '3.5' do + self.release = '3.5.2' + self.base_url = 'https://cmake.org/cmake/help/v3.5/' + end end end diff --git a/public/icons/docs/cmake/16.png b/public/icons/docs/cmake/16.png new file mode 100644 index 00000000..fe82b4bc Binary files /dev/null and b/public/icons/docs/cmake/16.png differ diff --git a/public/icons/docs/cmake/16@2x.png b/public/icons/docs/cmake/16@2x.png new file mode 100644 index 00000000..4dcfc24c Binary files /dev/null and b/public/icons/docs/cmake/16@2x.png differ diff --git a/public/icons/docs/cmake/SOURCE b/public/icons/docs/cmake/SOURCE new file mode 100644 index 00000000..dbfc5e62 --- /dev/null +++ b/public/icons/docs/cmake/SOURCE @@ -0,0 +1 @@ +https://cmake.org/gitweb?p=cmake.git;a=blob_plain;f=Source/QtDialog/CMakeSetup.ico;hb=refs/heads/master