Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,5 +1,8 @@ | |||
| 1 | [ | 1 | [ |
| 2 | [ | 2 | [ |
| 3 | "2017-07-23", | ||
| 4 | "New documentation: <a href=\"/godot/\">Godot</a>" | ||
| 5 | ], [ | ||
| 3 | "2017-06-04", | 6 | "2017-06-04", |
| 4 | "New documentations: <a href=\"/electron/\">Electron</a>, <a href=\"/pug/\">Pug</a>, and <a href=\"/falcon/\">Falcon</a>" | 7 | "New documentations: <a href=\"/electron/\">Electron</a>, <a href=\"/pug/\">Pug</a>, and <a href=\"/falcon/\">Falcon</a>" |
| 5 | ], [ | 8 | ], [ |
| @@ -268,6 +268,11 @@ credits = [ · 267 unmodified lines | |||
| 268 | 'Google, Inc.', | 268 | 'Google, Inc.', |
| 269 | 'CC BY', | 269 | 'CC BY', |
| 270 | 'https://creativecommons.org/licenses/by/3.0/' | 270 | 'https://creativecommons.org/licenses/by/3.0/' |
| 271 | ], [ | ||
| 272 | 'Godot', | ||
| 273 | '2014-2017 Juan Linietsky, Ariel Manzur, Godot Engine contributors', | ||
| 274 | 'MIT', | ||
| 275 | 'https://raw.githubusercontent.com/godotengine/godot/master/LICENSE.txt' | ||
| 271 | ], [ | 276 | ], [ |
| 272 | 'Grunt', | 277 | 'Grunt', |
| 273 | 'GruntJS Team', | 278 | 'GruntJS Team', |
| @@ -175,3 +175,4 @@ · 174 unmodified lines | |||
| 175 | ._icon-pug:before { background-position: -1rem -2rem; @extend %doc-icon-2; } | 175 | ._icon-pug:before { background-position: -1rem -2rem; @extend %doc-icon-2; } |
| 176 | ._icon-electron:before { background-position: -2rem -2rem; @extend %doc-icon-2; } | 176 | ._icon-electron:before { background-position: -2rem -2rem; @extend %doc-icon-2; } |
| 177 | ._icon-falcon:before { background-position: -3rem -2rem; @extend %doc-icon-2; } | 177 | ._icon-falcon:before { background-position: -3rem -2rem; @extend %doc-icon-2; } |
| 178 | ._icon-godot:before { background-position: -4rem -2rem; @extend %doc-icon-2; } | ||
| @@ -3,6 +3,7 @@ · 2 unmodified lines | |||
| 3 | 3 | ||
| 4 | .admonition { @extend %note; } | 4 | .admonition { @extend %note; } |
| 5 | .admonition.warning { @extend %note-orange; } | 5 | .admonition.warning { @extend %note-orange; } |
| 6 | .admonition.tip { @extend %note-green; } | ||
| 6 | .admonition-title { | 7 | .admonition-title { |
| 7 | margin: 0 0 .25rem; | 8 | margin: 0 0 .25rem; |
| 8 | font-weight: $boldFontWeight; | 9 | font-weight: $boldFontWeight; |
| @@ -2,7 +2,23 @@ module Docs · 1 unmodified line | |||
| 2 | class Godot | 2 | class Godot |
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | @doc = at_css('.document .section') | 5 | if root_page? |
| 6 | at_css('h1').content = 'Godot Engine' | ||
| 7 | at_css('.admonition.tip').remove | ||
| 8 | end | ||
| 9 | |||
| 10 | css('ul[id].simple li:first-child:last-child').each do |node| | ||
| 11 | heading = Nokogiri::XML::Node.new 'h3', doc | ||
| 12 | heading['id'] = node.parent['id'] | ||
| 13 | heading.children = node.children | ||
| 14 | node.parent.before(heading).remove | ||
| 15 | end | ||
| 16 | |||
| 17 | css('h3 strong').each do |node| | ||
| 18 | node.before(node.children).remove | ||
| 19 | end | ||
| 20 | |||
| 21 | css('a.reference').remove_attr('class') | ||
| 6 | 22 | ||
| 7 | doc | 23 | doc |
| 8 | end | 24 | end |
| @@ -2,33 +2,43 @@ module Docs · 1 unmodified line | |||
| 2 | class Godot | 2 | class Godot |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | def get_name | 4 | def get_name |
| 5 | name = at_css('.document h1').content | 5 | name = at_css('h1').content |
| 6 | name.remove! "\u{00B6}" # Remove the pilcrow | 6 | name.remove! "\u{00B6}" # Remove the pilcrow |
| 7 | name | 7 | name |
| 8 | end | 8 | end |
| 9 | 9 | ||
| 10 | TYPE_BY_LEARNING_PATH = { | ||
| 11 | 'step_by_step' => 'Guides: Step by step', | ||
| 12 | 'editor' => 'Guides: Editor', | ||
| 13 | 'features' => 'Guides: Engine features', | ||
| 14 | 'scripting' => 'Guides: Scripting', | ||
| 15 | 'workflow' => 'Guides: Project workflow' | ||
| 16 | } | ||
| 17 | |||
| 10 | def get_type | 18 | def get_type |
| 11 | if slug.start_with?('learning') | 19 | if slug.start_with?('learning') |
| 12 | 'Learning' | 20 | TYPE_BY_LEARNING_PATH[slug.split('/')[1]] |
| 13 | else | 21 | else |
| 14 | 'API Reference' | 22 | name |
| 15 | end | 23 | end |
| 16 | end | 24 | end |
| 17 | 25 | ||
| 18 | def additional_entries | 26 | def additional_entries |
| 19 | return [] unless slug.start_with?('classes') | 27 | return [] unless slug.start_with?('classes') |
| 20 | class_name = at_css('h1').content | ||
| 21 | class_name.remove! "\u{00B6}" # Remove the pilcrow | ||
| 22 | entries = [] | ||
| 23 | 28 | ||
| 24 | # Each page represents a class, and class methods are defined in | 29 | css('.simple[id]').each_with_object [] do |node, entries| |
| 25 | # individual sections. | 30 | name = node.at_css('strong').content |
| 26 | css('.simple[id]').each do |node| | 31 | next if name == self.name |
| 27 | fn_name = node.at_css('strong') | 32 | name.prepend "#{self.name}." |
| 28 | entries << [class_name + '.' + fn_name + '()', node['id']] | 33 | name << '()' |
| 34 | entries << [name, node['id']] unless entries.any? { |entry| entry[0] == name } | ||
| 29 | end | 35 | end |
| 36 | end | ||
| 30 | 37 | ||
| 31 | entries | 38 | def include_default_entry? |
| 39 | return false if subpath.start_with?('learning') && subpath.end_with?('index.html') | ||
| 40 | return false if subpath == 'classes/index.html' | ||
| 41 | true | ||
| 32 | end | 42 | end |
| 33 | end | 43 | end |
| 34 | end | 44 | end |
| @@ -87,9 +87,7 @@ module Docs · 86 unmodified lines | |||
| 87 | node.remove_attribute 'cellspacing' | 87 | node.remove_attribute 'cellspacing' |
| 88 | end | 88 | end |
| 89 | 89 | ||
| 90 | css('code[class]').each do |node| | 90 | css('code', 'tr').remove_attr('class') |
| 91 | node.remove_attribute 'class' | ||
| 92 | end | ||
| 93 | 91 | ||
| 94 | css('h1').each do |node| | 92 | css('h1').each do |node| |
| 95 | node.content = node.content | 93 | node.content = node.content |
| @@ -8,18 +8,29 @@ module Docs · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | html_filters.push 'godot/entries', 'godot/clean_html', 'sphinx/clean_html' | 9 | html_filters.push 'godot/entries', 'godot/clean_html', 'sphinx/clean_html' |
| 10 | 10 | ||
| 11 | # `learning/` contains the guided learning materials, and `classes/` | 11 | options[:download_images] = false |
| 12 | # contains the API reference. | 12 | options[:container] = '.document .section' |
| 13 | |||
| 13 | options[:only_patterns] = [/\Alearning\//, /\Aclasses\//] | 14 | options[:only_patterns] = [/\Alearning\//, /\Aclasses\//] |
| 15 | options[:skip] = %w(classes/class_@global\ scope.html) | ||
| 14 | 16 | ||
| 15 | options[:attribution] = <<-HTML | 17 | options[:attribution] = ->(filter) do |
| 16 | © Copyright 2014–2017, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0). | 18 | if filter.subpath.start_with?('classes') |
| 17 | HTML | 19 | <<-HTML |
| 20 | © 2014–2017 Juan Linietsky, Ariel Manzur, Godot Engine contributors<br> | ||
| 21 | Licensed under the MIT License. | ||
| 22 | HTML | ||
| 23 | else | ||
| 24 | <<-HTML | ||
| 25 | © 2014–2017 Juan Linietsky, Ariel Manzur and the Godot community<br> | ||
| 26 | Licensed under the Creative Commons Attribution Unported License v3.0. | ||
| 27 | HTML | ||
| 28 | end | ||
| 29 | end | ||
| 18 | 30 | ||
| 19 | version '2.1' do | 31 | version '2.1' do |
| 20 | self.release = '2.1' | 32 | self.release = '2.1' |
| 21 | self.base_url = "http://docs.godotengine.org/en/#{self.version}/" | 33 | self.base_url = "http://docs.godotengine.org/en/#{self.version}/" |
| 22 | end | 34 | end |
| 23 | |||
| 24 | end | 35 | end |
| 25 | end | 36 | end |
Binary file not shown.
Binary file not shown.