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 | 6 | "2017-06-04", |
| 4 | 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 | 268 | 'Google, Inc.', |
| 269 | 269 | 'CC BY', |
| 270 | 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 | 277 | 'Grunt', |
| 273 | 278 | 'GruntJS Team', |
| @@ -175,3 +175,4 @@ · 174 unmodified lines | ||
| 175 | 175 | ._icon-pug:before { background-position: -1rem -2rem; @extend %doc-icon-2; } |
| 176 | 176 | ._icon-electron:before { background-position: -2rem -2rem; @extend %doc-icon-2; } |
| 177 | 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 | 4 | .admonition { @extend %note; } |
| 5 | 5 | .admonition.warning { @extend %note-orange; } |
| 6 | + .admonition.tip { @extend %note-green; } | |
| 6 | 7 | .admonition-title { |
| 7 | 8 | margin: 0 0 .25rem; |
| 8 | 9 | font-weight: $boldFontWeight; |
| @@ -2,7 +2,23 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Godot |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 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 | 23 | doc |
| 8 | 24 | end |
| @@ -2,33 +2,43 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Godot |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | 4 | def get_name |
| 5 | − name = at_css('.document h1').content | |
| 5 | + name = at_css('h1').content | |
| 6 | 6 | name.remove! "\u{00B6}" # Remove the pilcrow |
| 7 | 7 | name |
| 8 | 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 | 18 | def get_type |
| 11 | 19 | if slug.start_with?('learning') |
| 12 | − 'Learning' | |
| 20 | + TYPE_BY_LEARNING_PATH[slug.split('/')[1]] | |
| 13 | 21 | else |
| 14 | − 'API Reference' | |
| 22 | + name | |
| 15 | 23 | end |
| 16 | 24 | end |
| 17 | 25 | |
| 18 | 26 | def additional_entries |
| 19 | 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 | |
| 25 | − # individual sections. | |
| 26 | − css('.simple[id]').each do |node| | |
| 27 | − fn_name = node.at_css('strong') | |
| 28 | − entries << [class_name + '.' + fn_name + '()', node['id']] | |
| 29 | + css('.simple[id]').each_with_object [] do |node, entries| | |
| 30 | + name = node.at_css('strong').content | |
| 31 | + next if name == self.name | |
| 32 | + name.prepend "#{self.name}." | |
| 33 | + name << '()' | |
| 34 | + entries << [name, node['id']] unless entries.any? { |entry| entry[0] == name } | |
| 29 | 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 | 42 | end |
| 33 | 43 | end |
| 34 | 44 | end |
| @@ -87,9 +87,7 @@ module Docs · 86 unmodified lines | ||
| 87 | 87 | node.remove_attribute 'cellspacing' |
| 88 | 88 | end |
| 89 | 89 | |
| 90 | − css('code[class]').each do |node| | |
| 91 | − node.remove_attribute 'class' | |
| 92 | − end | |
| 90 | + css('code', 'tr').remove_attr('class') | |
| 93 | 91 | |
| 94 | 92 | css('h1').each do |node| |
| 95 | 93 | node.content = node.content |
| @@ -8,18 +8,29 @@ module Docs · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | html_filters.push 'godot/entries', 'godot/clean_html', 'sphinx/clean_html' |
| 10 | 10 | |
| 11 | − # `learning/` contains the guided learning materials, and `classes/` | |
| 12 | − # contains the API reference. | |
| 11 | + options[:download_images] = false | |
| 12 | + options[:container] = '.document .section' | |
| 13 | + | |
| 13 | 14 | options[:only_patterns] = [/\Alearning\//, /\Aclasses\//] |
| 15 | + options[:skip] = %w(classes/class_@global\ scope.html) | |
| 14 | 16 | |
| 15 | − options[:attribution] = <<-HTML | |
| 16 | − © Copyright 2014–2017, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0). | |
| 17 | − HTML | |
| 17 | + options[:attribution] = ->(filter) do | |
| 18 | + if filter.subpath.start_with?('classes') | |
| 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 | 31 | version '2.1' do |
| 20 | 32 | self.release = '2.1' |
| 21 | 33 | self.base_url = "http://docs.godotengine.org/en/#{self.version}/" |
| 22 | 34 | end |
| 23 | − | |
| 24 | 35 | end |
| 25 | 36 | end |
Binary file not shown.
Binary file not shown.