Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | − "2018-08-06", | |
| 4 | − "New documentation: <a href=\"/dart/\">Dart</a>" | |
| 3 | + "2018-08-12", | |
| 4 | + "New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>" | |
| 5 | 5 | ], [ |
| 6 | 6 | "2018-07-29", |
| 7 | 7 | "New documentations: <a href=\"/bash/\">Bash</a>, <a href=\"/graphite/\">Graphite</a> and <a href=\"/pygame/\">Pygame</a>" |
| @@ -177,3 +177,4 @@ · 176 unmodified lines | ||
| 177 | 177 | ._icon-pygame:before { background-position: -5rem -3rem; @extend %doc-icon-2; } |
| 178 | 178 | ._icon-bash:before { background-position: -6rem -3rem; @extend %doc-icon-2; } |
| 179 | 179 | ._icon-dart:before { background-position: -7rem -3rem; @extend %doc-icon-2; } |
| 180 | +._icon-qt:before { background-position: -8rem -3rem; @extend %doc-icon-2; } | |
| @@ -1,63 +1,9 @@ | ||
| 1 | 1 | ._qt { |
| 2 | 2 | @extend %simple; |
| 3 | 3 | |
| 4 | − h1 { | |
| 5 | − margin-top: 0; | |
| 6 | − @extend %lined-heading; | |
| 7 | − } | |
| 8 | − | |
| 9 | − // Home page | |
| 10 | − .landingicons { | |
| 11 | − .icons1of3 { | |
| 12 | − display: flex; | |
| 13 | − flex-wrap: wrap; | |
| 14 | − align-items: center; | |
| 15 | − margin: 1em 0; | |
| 16 | − | |
| 17 | − @if $style == 'dark' { | |
| 18 | − &:nth-child(3) img { | |
| 19 | − filter: invert(1) hue-rotate(180deg) brightness(1.5) | |
| 20 | − } | |
| 21 | − } | |
| 22 | − } | |
| 23 | − | |
| 24 | − h2 { | |
| 25 | − flex: 1; | |
| 26 | − margin: 0; | |
| 27 | − margin-left: 10px; | |
| 28 | − } | |
| 29 | − | |
| 30 | − h2 + p { | |
| 31 | − width: 100%; | |
| 32 | − padding-left: 70px; | |
| 33 | − } | |
| 34 | − | |
| 35 | − .centerAlign, | |
| 36 | − .centerAlign img { // Icon | |
| 37 | − width: 60px; | |
| 38 | − height: 60px; | |
| 39 | − margin: 0; | |
| 40 | − } | |
| 41 | − } | |
| 42 | − | |
| 43 | − // Syntax highlighting | |
| 44 | − .pre { | |
| 45 | − .operator { @extend .token, .operator; } | |
| 46 | − .number { @extend .token, .number; } | |
| 47 | − .keyword { @extend .token, .keyword; } | |
| 48 | − .type { @extend .token, .function; } | |
| 49 | − .type a { color: inherit; } | |
| 50 | − .pun, .comment { @extend .token, .punctuation; } | |
| 51 | − .kwd, .preprocessor { @extend .token, .keyword; } | |
| 52 | − .str, .string { @extend .token, .string; } | |
| 53 | − } | |
| 54 | − | |
| 55 | 4 | // Function headers |
| 56 | − h3.fn code { | |
| 57 | − @extend %label; | |
| 5 | + h3.fn > code { | |
| 58 | 6 | float: right; |
| 59 | − font-size: .8em; | |
| 60 | − padding: 0; | |
| 61 | − margin-right: -.5em; | |
| 7 | + color: $textColorLight; | |
| 62 | 8 | } |
| 63 | 9 | } |
| @@ -3,17 +3,27 @@ module Docs · 2 unmodified lines | ||
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | 5 | # Remove unneeded elements |
| 6 | − css('.copy-notice, .navigationbar, .headerNavi, .footerNavi, .sidebar, .toc, #ec_toggle').remove | |
| 6 | + css('.copy-notice, .navigationbar, .headerNavi, .footerNavi, .sidebar, .toc, #ec_toggle', '.landingicons img', 'br').remove | |
| 7 | 7 | |
| 8 | 8 | # QML property/method header |
| 9 | 9 | css('.qmlproto').each do |node| |
| 10 | 10 | id = node.at_css('tr')['id'] |
| 11 | 11 | node.inner_html = node.at_css('td').inner_html |
| 12 | 12 | node.name = 'h3' |
| 13 | − node.add_class '_qml_header' | |
| 14 | 13 | node['id'] = id |
| 15 | 14 | end |
| 16 | 15 | |
| 16 | + css('.main-rounded', '.content', '.line', '.context', '.descr', '.types', '.func', '.table', 'div:not([class])', '.landing', '.col-1', '.heading', '.qmlitem', '.qmldoc', 'div.pre').each do |node| | |
| 17 | + node.before(node.children).remove | |
| 18 | + end | |
| 19 | + | |
| 20 | + css('pre').each do |node| | |
| 21 | + node.content = node.content | |
| 22 | + node['data-language'] = 'cpp' if node['class'].include?('cpp') | |
| 23 | + node['data-language'] = 'qml' if node['class'].include?('qml') | |
| 24 | + node.remove_attribute('class') | |
| 25 | + end | |
| 26 | + | |
| 17 | 27 | doc |
| 18 | 28 | end |
| 19 | 29 | end |
| @@ -1,3 +1,5 @@ | ||
| 1 | +# frozen_string_literal: true | |
| 2 | + | |
| 1 | 3 | module Docs |
| 2 | 4 | class Qt |
| 3 | 5 | class EntriesFilter < Docs::EntriesFilter |
| @@ -9,7 +11,7 @@ module Docs · 5 unmodified lines | ||
| 9 | 11 | name.sub! %r{ QML Basic Type$}, ' (QML basic type)' |
| 10 | 12 | |
| 11 | 13 | # Add '(class)' to the class pages where the subtitle name is used (e.g. qset-const-iterator.html) |
| 12 | − if at_css('h1.title').content.strip.end_with?(' Class') and !name.include?('(class)') | |
| 14 | + if at_css('h1.title').content.strip.end_with?(' Class') && !name.include?('(class)') | |
| 13 | 15 | name = "#{name} (class) " |
| 14 | 16 | end |
| 15 | 17 | |
| @@ -19,34 +21,34 @@ module Docs · 3 unmodified lines | ||
| 19 | 21 | def get_type |
| 20 | 22 | breadcrumb = css('#main_title_bar + ul li') |
| 21 | 23 | category = if breadcrumb.length < 3 |
| 22 | − then 'Qt' | |
| 24 | + then 'Qt'.dup | |
| 23 | 25 | else breadcrumb.at(1).content |
| 24 | 26 | end |
| 25 | 27 | |
| 26 | 28 | if category == 'Qt' |
| 27 | − return 'Qt Platforms' if name.include? ' for ' or name == 'Qt Platform Abstraction' | |
| 28 | − return 'Qt Quick' if name == 'Qt Quick Test' or name == 'Qt Quick Test Reference Documentation' | |
| 29 | + return 'Qt Platforms' if name.include?(' for ') || name == 'Qt Platform Abstraction' | |
| 30 | + return 'Qt Quick' if name == 'Qt Quick Test' || name == 'Qt Quick Test Reference Documentation' | |
| 29 | 31 | |
| 30 | − alwaysInQt = ["Qt Configure Options", "Qt Image Formats"] | |
| 32 | + alwaysInQt = ['Qt Configure Options', 'Qt Image Formats'] | |
| 31 | 33 | category = name if name.start_with?('Qt ') && !alwaysInQt.include?(name) |
| 32 | 34 | end |
| 33 | 35 | |
| 34 | 36 | qtPlatformsTypes = ['Qt Platform Headers', 'Qt Android Extras', 'Qt Mac Extras', 'Qt Windows Extras', 'Qt X11 Extras'] |
| 35 | − return 'Qt Platforms' if qtPlatformsTypes.include? category | |
| 37 | + return 'Qt Platforms' if qtPlatformsTypes.include?(category) | |
| 36 | 38 | |
| 37 | − category.sub! ' Manual', '' | |
| 39 | + category.remove!(' Manual') | |
| 38 | 40 | category |
| 39 | 41 | end |
| 40 | 42 | |
| 41 | 43 | def include_default_entry? |
| 42 | − name != 'All Classes' and name != 'All QML Types' | |
| 44 | + name != 'All Classes' && name != 'All QML Types' | |
| 43 | 45 | end |
| 44 | 46 | |
| 45 | 47 | def additional_entries |
| 46 | 48 | entries = [] |
| 47 | 49 | titles = [] |
| 48 | 50 | |
| 49 | − className = at_css('h1.title').content.strip.sub ' Class', '' | |
| 51 | + className = at_css('h1.title').content.strip.remove(' Class') | |
| 50 | 52 | displayedClassName = className |
| 51 | 53 | alternativeClassName = at_css('h1.title + .small-subtitle a') |
| 52 | 54 | displayedClassName = alternativeClassName.content if alternativeClassName |
| @@ -56,7 +58,7 @@ module Docs · 3 unmodified lines | ||
| 56 | 58 | header = node.clone |
| 57 | 59 | |
| 58 | 60 | # Skip typenames |
| 59 | − next if header.content.strip.start_with? 'typename ' | |
| 61 | + next if header.content.strip.start_with?('typename ') | |
| 60 | 62 | |
| 61 | 63 | # Remove leading <a name=""> |
| 62 | 64 | header.children.css('a[name]').remove |
| @@ -66,7 +68,7 @@ module Docs · 3 unmodified lines | ||
| 66 | 68 | code.remove if code.name == 'code' |
| 67 | 69 | |
| 68 | 70 | # Remove leading ‘const’ |
| 69 | − header.children.first.remove if header.content.strip.start_with? 'const ' | |
| 71 | + header.children.first.remove if header.content.strip.start_with?('const ') | |
| 70 | 72 | |
| 71 | 73 | # Remove return type |
| 72 | 74 | returnType = header.children.first |
| @@ -78,57 +80,57 @@ module Docs · 5 unmodified lines | ||
| 78 | 80 | title[0] = '' if title[0] == '&' || title[0] == '*' |
| 79 | 81 | |
| 80 | 82 | # Ignore operator overloads |
| 81 | − next if title.start_with? 'operator' | |
| 83 | + next if title.start_with?('operator') | |
| 82 | 84 | |
| 83 | 85 | # Remove function parameters |
| 84 | 86 | title.sub! %r{\(.*\)}, '()' |
| 85 | 87 | |
| 86 | 88 | # Remove template generics |
| 87 | − title.sub! %r{^<.*> }, '' | |
| 89 | + title.remove!(%r{^<.*> }) | |
| 88 | 90 | |
| 89 | 91 | # Remove ‘const’ at the end |
| 90 | − title.sub! %r{ const$}, '' | |
| 92 | + title.remove!(%r{ const$}) | |
| 91 | 93 | |
| 92 | 94 | # Enum/typedef formatting |
| 93 | 95 | title.sub! %r{(enum|typedef) (.*)}, '\2 (\1)' |
| 94 | 96 | |
| 95 | 97 | # Remove property type |
| 96 | − title = "#{displayedClassName}::#{title}" if title.sub! %r{ : .*$}, '' | |
| 98 | + title = "#{displayedClassName}::#{title}" if title.sub!(%r{ : .*$}, '') | |
| 97 | 99 | |
| 98 | 100 | # Replace the class name by the alternative class name if available |
| 99 | − title.sub! className, displayedClassName if alternativeClassName | |
| 101 | + title = title.sub(className, displayedClassName) if alternativeClassName | |
| 100 | 102 | |
| 101 | − unless titles.include? title # Remove duplicates (function overloading) | |
| 103 | + unless titles.include?(title) # Remove duplicates (function overloading) | |
| 102 | 104 | entries << [title, header['id']] |
| 103 | 105 | titles.push title |
| 104 | 106 | end |
| 105 | 107 | end |
| 106 | 108 | |
| 107 | 109 | # QML properties/functions |
| 108 | − qmlTypeName = at_css('h1.title').content.sub ' QML Type', '' | |
| 110 | + qmlTypeName = at_css('h1.title').content.remove(' QML Type', '') | |
| 109 | 111 | css('.qmlproto').each do |node| |
| 110 | 112 | title = node.content.strip |
| 111 | 113 | id = node.at_css('tr')['id'] |
| 112 | 114 | |
| 113 | 115 | # Remove options |
| 114 | − title.sub! %r{^\[.*\] }, '' | |
| 116 | + title.remove!(%r{^\[.*\] }) | |
| 115 | 117 | |
| 116 | 118 | # Remove function parameters |
| 117 | 119 | title.sub! %r{\(.*\)}, '()' |
| 118 | 120 | |
| 119 | 121 | # Remove property type |
| 120 | − title.sub! %r{ : .*$}, '' | |
| 122 | + title.remove!(%r{ : .*$}) | |
| 121 | 123 | |
| 122 | 124 | # Remove return type |
| 123 | − title.sub! %r{.* }, '' | |
| 125 | + title.remove!(%r{.* }) | |
| 124 | 126 | |
| 125 | 127 | # Remove return type |
| 126 | − title.sub! %r{.* }, '' | |
| 128 | + title.remove!(%r{.* }) | |
| 127 | 129 | |
| 128 | 130 | title = "#{qmlTypeName}.#{title.strip}" |
| 129 | − unless titles.include? title # Remove duplicates (function overloading) | |
| 131 | + unless titles.include?(title) # Remove duplicates (function overloading) | |
| 130 | 132 | entries << [title, id] |
| 131 | − titles.push title | |
| 133 | + titles.push(title) | |
| 132 | 134 | end |
| 133 | 135 | end |
| 134 | 136 | |
| @@ -12,7 +12,7 @@ module Docs · 11 unmodified lines | ||
| 12 | 12 | html_filters.push 'qt/entries', 'qt/clean_html' |
| 13 | 13 | |
| 14 | 14 | options[:container] = '.main' |
| 15 | − | |
| 15 | + options[:max_image_size] = 156_000 | |
| 16 | 16 | options[:skip_patterns] = [ |
| 17 | 17 | # License, copyright attributions |
| 18 | 18 | /3rdparty/, |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.